Skip to content

Commit

Permalink
Update message definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
wmnsk committed Apr 25, 2021
1 parent bb5ea42 commit b079f5d
Show file tree
Hide file tree
Showing 8 changed files with 220 additions and 92 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -470,14 +470,14 @@ IEs are (basically) implemented in conformance with TS29.244 V16.3.1(2020-04).
| 254 | Ethernet Context Information | Yes |
| 255 | Redundant Transmission Parameters | Yes |
| 256 | Updated PDR | Yes |
| 257 | S-NSSAI | |
| 258 | IP version | |
| 259 | PFCPASReq-Flags | |
| 260 | Data Status | |
| 261 | Provide RDS configuration information | |
| 262 | RDS configuration information | |
| 263 | Query Packet Rate Status IE within PFCP Session Modification Request | |
| 264 | Packet Rate Status Report IE within PFCP Session Modification Response | |
| 257 | S-NSSAI | Yes |
| 258 | IP version | Yes |
| 259 | PFCPASReq-Flags | Yes |
| 260 | Data Status | Yes |
| 261 | Provide RDS configuration information | Yes |
| 262 | RDS configuration information | Yes |
| 263 | Query Packet Rate Status IE within PFCP Session Modification Request | Yes |
| 264 | Packet Rate Status Report IE within PFCP Session Modification Response | Yes |
| 265 | MPTCP Applicable Indication | |
| 266 | Bridge Management Information Container | |
| 267 | UE IP Address Usage Information | |
Expand Down
14 changes: 14 additions & 0 deletions message/association-setup-request.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type AssociationSetupRequest struct {
GTPUPathQoSControlInformation []*ie.IE
ClockDriftControlInformation []*ie.IE
UPFInstanceID *ie.IE
PFCPASReqFlags *ie.IE
IEs []*ie.IE
}

Expand Down Expand Up @@ -62,6 +63,8 @@ func NewAssociationSetupRequest(seq uint32, ies ...*ie.IE) *AssociationSetupRequ
m.ClockDriftControlInformation = append(m.ClockDriftControlInformation, i)
case ie.NFInstanceID:
m.UPFInstanceID = i
case ie.PFCPASReqFlags:
m.PFCPASReqFlags = i
default:
m.IEs = append(m.IEs, i)
}
Expand Down Expand Up @@ -161,6 +164,12 @@ func (m *AssociationSetupRequest) MarshalTo(b []byte) error {
}
offset += i.MarshalLen()
}
if i := m.PFCPASReqFlags; i != nil {
if err := i.MarshalTo(m.Payload[offset:]); err != nil {
return err
}
offset += i.MarshalLen()
}

for _, ie := range m.IEs {
if ie == nil {
Expand Down Expand Up @@ -227,6 +236,8 @@ func (m *AssociationSetupRequest) UnmarshalBinary(b []byte) error {
m.ClockDriftControlInformation = append(m.ClockDriftControlInformation, i)
case ie.NFInstanceID:
m.UPFInstanceID = i
case ie.PFCPASReqFlags:
m.PFCPASReqFlags = i
default:
m.IEs = append(m.IEs, i)
}
Expand Down Expand Up @@ -275,6 +286,9 @@ func (m *AssociationSetupRequest) MarshalLen() int {
if i := m.UPFInstanceID; i != nil {
l += i.MarshalLen()
}
if i := m.PFCPASReqFlags; i != nil {
l += i.MarshalLen()
}

for _, ie := range m.IEs {
if ie == nil {
Expand Down
70 changes: 49 additions & 21 deletions message/session-establishment-request.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,29 @@ import (
// TODO: add S-NSSAI and Provide RDS configuration information.
type SessionEstablishmentRequest struct {
*Header
NodeID *ie.IE
CPFSEID *ie.IE
CreatePDR []*ie.IE
CreateFAR []*ie.IE
CreateURR []*ie.IE
CreateQER []*ie.IE
CreateBAR *ie.IE
CreateTrafficEndpoint []*ie.IE
PDNType *ie.IE
FQCSID *ie.IE
UserPlaneInactivityTimer *ie.IE
UserID *ie.IE
TraceInformation *ie.IE
APNDNN *ie.IE
CreateMAR []*ie.IE
PFCPSEReqFlags *ie.IE
CreateBridgeInfoForTSC *ie.IE
CreateSRR []*ie.IE
ProvideATSSSControlInformation *ie.IE
RecoveryTimeStamp *ie.IE
IEs []*ie.IE
NodeID *ie.IE
CPFSEID *ie.IE
CreatePDR []*ie.IE
CreateFAR []*ie.IE
CreateURR []*ie.IE
CreateQER []*ie.IE
CreateBAR *ie.IE
CreateTrafficEndpoint []*ie.IE
PDNType *ie.IE
FQCSID *ie.IE
UserPlaneInactivityTimer *ie.IE
UserID *ie.IE
TraceInformation *ie.IE
APNDNN *ie.IE
CreateMAR []*ie.IE
PFCPSEReqFlags *ie.IE
CreateBridgeInfoForTSC *ie.IE
CreateSRR []*ie.IE
ProvideATSSSControlInformation *ie.IE
RecoveryTimeStamp *ie.IE
SNSSAI *ie.IE
ProvideRDSConfigurationInformation *ie.IE
IEs []*ie.IE
}

// NewSessionEstablishmentRequest creates a new SessionEstablishmentRequest.
Expand Down Expand Up @@ -88,6 +90,10 @@ func NewSessionEstablishmentRequest(mp, fo uint8, seid uint64, seq uint32, pri u
m.ProvideATSSSControlInformation = i
case ie.RecoveryTimeStamp:
m.RecoveryTimeStamp = i
case ie.SNSSAI:
m.SNSSAI = i
case ie.ProvideRDSConfigurationInformation:
m.ProvideRDSConfigurationInformation = i
default:
m.IEs = append(m.IEs, i)
}
Expand Down Expand Up @@ -235,6 +241,18 @@ func (m *SessionEstablishmentRequest) MarshalTo(b []byte) error {
}
offset += i.MarshalLen()
}
if i := m.SNSSAI; i != nil {
if err := i.MarshalTo(m.Payload[offset:]); err != nil {
return err
}
offset += i.MarshalLen()
}
if i := m.ProvideRDSConfigurationInformation; i != nil {
if err := i.MarshalTo(m.Payload[offset:]); err != nil {
return err
}
offset += i.MarshalLen()
}

for _, ie := range m.IEs {
if ie == nil {
Expand Down Expand Up @@ -317,6 +335,10 @@ func (m *SessionEstablishmentRequest) UnmarshalBinary(b []byte) error {
m.ProvideATSSSControlInformation = i
case ie.RecoveryTimeStamp:
m.RecoveryTimeStamp = i
case ie.SNSSAI:
m.SNSSAI = i
case ie.ProvideRDSConfigurationInformation:
m.ProvideRDSConfigurationInformation = i
default:
m.IEs = append(m.IEs, i)
}
Expand Down Expand Up @@ -389,6 +411,12 @@ func (m *SessionEstablishmentRequest) MarshalLen() int {
if i := m.RecoveryTimeStamp; i != nil {
l += i.MarshalLen()
}
if i := m.SNSSAI; i != nil {
l += i.MarshalLen()
}
if i := m.ProvideRDSConfigurationInformation; i != nil {
l += i.MarshalLen()
}

for _, ie := range m.IEs {
if ie == nil {
Expand Down
16 changes: 14 additions & 2 deletions message/session-establishment-request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,13 @@ func TestSessionEstablishmentRequest(t *testing.T) {
ie.NewPMFControlInformation(1),
),
ie.NewRecoveryTimeStamp(time.Date(2019, time.January, 1, 0, 0, 0, 0, time.UTC)),
ie.NewSNSSAI(0x11, 0x223344),
ie.NewProvideRDSConfigurationInformation(
ie.NewRDSConfigurationInformation(0x01),
),
),
Serialized: []byte{
0x21, 0x32, 0x06, 0x9a, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x11, 0x22, 0x33, 0x00,
0x21, 0x32, 0x06, 0xab, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x11, 0x22, 0x33, 0x00,
0x00, 0x3c, 0x00, 0x1d, 0x02, 0x07, 0x67, 0x6f, 0x2d, 0x70, 0x66, 0x63, 0x70, 0x03, 0x65, 0x70, 0x63, 0x0b, 0x33, 0x67, 0x70, 0x70, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x03, 0x6f, 0x72, 0x67,
0x00, 0x39, 0x00, 0x0d, 0x02, 0x11, 0x11, 0x11, 0x11, 0x22, 0x22, 0x22, 0x22, 0x7f, 0x00, 0x00, 0x01,
// CreatePDR
Expand Down Expand Up @@ -436,6 +440,8 @@ func TestSessionEstablishmentRequest(t *testing.T) {
0x00, 0xdf, 0x00, 0x01, 0x01,
0x00, 0xe0, 0x00, 0x01, 0x01,
0x00, 0x60, 0x00, 0x04, 0xdf, 0xd5, 0x2c, 0x00,
0x01, 0x01, 0x00, 0x04, 0x11, 0x22, 0x33, 0x44,
0x01, 0x05, 0x00, 0x05, 0x01, 0x06, 0x00, 0x01, 0x01,
},
}, {
Description: "Multiple IEs",
Expand Down Expand Up @@ -676,9 +682,13 @@ func TestSessionEstablishmentRequest(t *testing.T) {
ie.NewPMFControlInformation(1),
),
ie.NewRecoveryTimeStamp(time.Date(2019, time.January, 1, 0, 0, 0, 0, time.UTC)),
ie.NewSNSSAI(0x11, 0x223344),
ie.NewProvideRDSConfigurationInformation(
ie.NewRDSConfigurationInformation(0x01),
),
),
Serialized: []byte{
0x21, 0x32, 0x08, 0x24, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x11, 0x22, 0x33, 0x00,
0x21, 0x32, 0x08, 0x35, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x11, 0x22, 0x33, 0x00,
0x00, 0x3c, 0x00, 0x1d, 0x02, 0x07, 0x67, 0x6f, 0x2d, 0x70, 0x66, 0x63, 0x70, 0x03, 0x65, 0x70, 0x63, 0x0b, 0x33, 0x67, 0x70, 0x70, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x03, 0x6f, 0x72, 0x67,
0x00, 0x39, 0x00, 0x0d, 0x02, 0x11, 0x11, 0x11, 0x11, 0x22, 0x22, 0x22, 0x22, 0x7f, 0x00, 0x00, 0x01,
// CreatePDR 1
Expand Down Expand Up @@ -955,6 +965,8 @@ func TestSessionEstablishmentRequest(t *testing.T) {
0x00, 0xdf, 0x00, 0x01, 0x01,
0x00, 0xe0, 0x00, 0x01, 0x01,
0x00, 0x60, 0x00, 0x04, 0xdf, 0xd5, 0x2c, 0x00,
0x01, 0x01, 0x00, 0x04, 0x11, 0x22, 0x33, 0x44,
0x01, 0x05, 0x00, 0x05, 0x01, 0x06, 0x00, 0x01, 0x01,
},
},
}
Expand Down
Loading

0 comments on commit b079f5d

Please sign in to comment.