File tree Expand file tree Collapse file tree 12 files changed +211
-7
lines changed
Expand file tree Collapse file tree 12 files changed +211
-7
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,9 @@ type ControlURI struct {
1616}
1717
1818func (u * ControlURI ) UnmarshalText (text []byte ) error {
19+ if len (text ) == 0 {
20+ return fmt .Errorf ("Control URI should not be empty." )
21+ }
1922 if text [len (text )- 1 ] == '/' {
2023 return fmt .Errorf ("Control URI should not contains trailing slash." )
2124 }
Original file line number Diff line number Diff line change 1+ // Copyright 2024 Louis Royer and the NextMN contributors. All rights reserved.
2+ // Use of this source code is governed by a MIT-style license that can be
3+ // found in the LICENSE file.
4+ // SPDX-License-Identifier: MIT
5+
6+ package jsonapi
7+
8+ import "net/netip"
9+
10+ type Fteid struct {
11+ Addr netip.Addr `json:"addr"`
12+ Teid uint32 `json:"teid"`
13+ }
14+
15+ func NewFteid (addr netip.Addr , teid uint32 ) * Fteid {
16+ return & Fteid {
17+ Addr : addr ,
18+ Teid : teid ,
19+ }
20+ }
Original file line number Diff line number Diff line change 1+ // Copyright 2024 Louis Royer and the NextMN contributors. All rights reserved.
2+ // Use of this source code is governed by a MIT-style license that can be
3+ // found in the LICENSE file.
4+ // SPDX-License-Identifier: MIT
5+
6+ package n1n2
7+
8+ import (
9+ "github.com/nextmn/json-api/jsonapi"
10+ )
11+
12+ // HandoverCommand is sent by the CP to the source gNB to start the execution of handover, and forwarded to the UE
13+ type HandoverCommand struct {
14+ // Header
15+ UeCtrl jsonapi.ControlURI `json:"ue-ctrl"`
16+ Cp jsonapi.ControlURI `json:"cp"`
17+ SourceGnb jsonapi.ControlURI `json:"source-gnb"`
18+
19+ // Handover Command
20+ Sessions []Session `json:"sessions"` // contains new ForwardDownlinkFteid
21+ TargetGnb jsonapi.ControlURI `json:"target-gnb"`
22+ }
Original file line number Diff line number Diff line change 1+ // Copyright 2024 Louis Royer and the NextMN contributors. All rights reserved.
2+ // Use of this source code is governed by a MIT-style license that can be
3+ // found in the LICENSE file.
4+ // SPDX-License-Identifier: MIT
5+
6+ package n1n2
7+
8+ import (
9+ "github.com/nextmn/json-api/jsonapi"
10+ )
11+
12+ // HandoverConfirm is send by the target UE to the target gNB after the UE is synchronized to the new cell
13+ type HandoverConfirm struct {
14+ // Header
15+ UeCtrl jsonapi.ControlURI `json:"ue-ctrl"`
16+ Cp jsonapi.ControlURI `json:"cp"`
17+
18+ // Handover Confirm
19+ Sessions []Session `json:"sessions"`
20+ SourceGnb jsonapi.ControlURI `json:"source-gnb"`
21+ TargetGnb jsonapi.ControlURI `json:"target-gnb"`
22+ }
Original file line number Diff line number Diff line change 1+ // Copyright 2024 Louis Royer and the NextMN contributors. All rights reserved.
2+ // Use of this source code is governed by a MIT-style license that can be
3+ // found in the LICENSE file.
4+ // SPDX-License-Identifier: MIT
5+
6+ package n1n2
7+
8+ import (
9+ "github.com/nextmn/json-api/jsonapi"
10+ )
11+
12+ // HandoverNotify is send by the target gNB to the CP after handover have been confirmed by the UE
13+ type HandoverNotify struct {
14+ // Header
15+ UeCtrl jsonapi.ControlURI `json:"ue-ctrl"`
16+ Cp jsonapi.ControlURI `json:"cp"`
17+ TargetGnb jsonapi.ControlURI `json:"target-gnb"`
18+
19+ // Handover Notify
20+ Sessions []Session `json:"sessions"`
21+ SourceGnb jsonapi.ControlURI `json:"source-gnb"`
22+ }
Original file line number Diff line number Diff line change 1+ // Copyright 2024 Louis Royer and the NextMN contributors. All rights reserved.
2+ // Use of this source code is governed by a MIT-style license that can be
3+ // found in the LICENSE file.
4+ // SPDX-License-Identifier: MIT
5+
6+ package n1n2
7+
8+ import (
9+ "github.com/nextmn/json-api/jsonapi"
10+ )
11+
12+ // HandoverRequest is send by the CP to the target gNB during the handover preparation phase
13+ type HandoverRequest struct {
14+ // Header
15+ UeCtrl jsonapi.ControlURI `json:"ue-ctrl"`
16+ Cp jsonapi.ControlURI `json:"cp"`
17+ TargetgNB jsonapi.ControlURI `json:"target-gnb"`
18+
19+ // Handover Request
20+ SourcegNB jsonapi.ControlURI `json:"source-gnb"`
21+ Sessions []Session `json:"sessions"` // contains new UL FTeid
22+ }
Original file line number Diff line number Diff line change 1+ // Copyright 2024 Louis Royer and the NextMN contributors. All rights reserved.
2+ // Use of this source code is governed by a MIT-style license that can be
3+ // found in the LICENSE file.
4+ // SPDX-License-Identifier: MIT
5+
6+ package n1n2
7+
8+ import (
9+ "github.com/nextmn/json-api/jsonapi"
10+ )
11+
12+ // HandoverRequestAck is send by the target gNB to the CP in response to an HandoverRequest
13+ type HandoverRequestAck struct {
14+ // Header
15+ Cp jsonapi.ControlURI `json:"cp"`
16+ TargetgNB jsonapi.ControlURI `json:"target-gnb"`
17+
18+ // Handover Request Ack
19+ SourcegNB jsonapi.ControlURI `json:"source-gnb"`
20+ UeCtrl jsonapi.ControlURI `json:"ue-ctrl"`
21+ Sessions []Session `json:"sessions"` // contains new DL FTeid
22+ }
Original file line number Diff line number Diff line change 1+ // Copyright 2024 Louis Royer and the NextMN contributors. All rights reserved.
2+ // Use of this source code is governed by a MIT-style license that can be
3+ // found in the LICENSE file.
4+ // SPDX-License-Identifier: MIT
5+
6+ package n1n2
7+
8+ import (
9+ "github.com/nextmn/json-api/jsonapi"
10+ )
11+
12+ // HandoverRequired is send by the source gNB to the CP to start the handover preparation phase
13+ type HandoverRequired struct {
14+ // Header
15+ SourcegNB jsonapi.ControlURI `json:"source-gnb"`
16+ Cp jsonapi.ControlURI `json:"cp"`
17+
18+ // Handover Required content
19+ Ue jsonapi.ControlURI `json:"ue"`
20+ Sessions []Session `json:"sessions"` // list of all pdu sessions of the UE to be moved
21+ TargetgNB jsonapi.ControlURI `json:"target-gnb"`
22+ }
Original file line number Diff line number Diff line change 66package n1n2
77
88import (
9- "net/netip"
10-
119 "github.com/nextmn/json-api/jsonapi"
1210)
1311
@@ -17,6 +15,5 @@ type N2PduSessionReqMsg struct {
1715 UeInfo PduSessionEstabAcceptMsg `json:"ue-info"` // information to forward to the UE
1816
1917 // Uplink FTEID: the gNB will establish an Uplink GTP Tunnel using the following
20- Upf netip.Addr `json:"upf"`
21- UplinkTeid uint32 `json:"uplink-teid"`
18+ UplinkFteid jsonapi.Fteid `json:"uplink-fteid"`
2219}
Original file line number Diff line number Diff line change 55
66package n1n2
77
8- import "net/netip"
8+ import (
9+ "github.com/nextmn/json-api/jsonapi"
10+ )
911
1012// N2PduSessionRespMsg is sent to the CP by the gNB as a response of N2PduSessionReqMsg.
1113type N2PduSessionRespMsg struct {
1214 UeInfo PduSessionEstabAcceptMsg `json:"ue-info"` // used to identify the PDU Session
1315
1416 // Downlink FTEID: the CP will use this to configure a downlink GTP Tunnel in Upf-i
15- DownlinkTeid uint32 `json:"downlink-teid"`
16- Gnb netip.Addr `json:"gnb"`
17+ DownlinkFteid jsonapi.Fteid `json:"downlink-fteid"`
1718}
You can’t perform that action at this time.
0 commit comments