From b079f5d886f3cf532beecff33eb92889b285f6b7 Mon Sep 17 00:00:00 2001 From: Yoshiyuki Kurauchi Date: Mon, 26 Apr 2021 00:55:25 +0900 Subject: [PATCH] Update message definitions --- README.md | 16 +-- message/association-setup-request.go | 14 +++ message/session-establishment-request.go | 70 +++++++---- message/session-establishment-request_test.go | 16 ++- message/session-modification-request.go | 118 +++++++++++------- message/session-modification-request_test.go | 34 +++-- message/session-modification-response.go | 14 +++ message/session-modification-response_test.go | 30 ++++- 8 files changed, 220 insertions(+), 92 deletions(-) diff --git a/README.md b/README.md index bd9f3278..dcd8d97c 100644 --- a/README.md +++ b/README.md @@ -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 | | diff --git a/message/association-setup-request.go b/message/association-setup-request.go index 6edf36fc..847f9e95 100644 --- a/message/association-setup-request.go +++ b/message/association-setup-request.go @@ -23,6 +23,7 @@ type AssociationSetupRequest struct { GTPUPathQoSControlInformation []*ie.IE ClockDriftControlInformation []*ie.IE UPFInstanceID *ie.IE + PFCPASReqFlags *ie.IE IEs []*ie.IE } @@ -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) } @@ -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 { @@ -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) } @@ -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 { diff --git a/message/session-establishment-request.go b/message/session-establishment-request.go index 19849794..a23cb2e0 100644 --- a/message/session-establishment-request.go +++ b/message/session-establishment-request.go @@ -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. @@ -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) } @@ -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 { @@ -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) } @@ -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 { diff --git a/message/session-establishment-request_test.go b/message/session-establishment-request_test.go index 5ae431f7..a6eb9533 100644 --- a/message/session-establishment-request_test.go +++ b/message/session-establishment-request_test.go @@ -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 @@ -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", @@ -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 @@ -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, }, }, } diff --git a/message/session-modification-request.go b/message/session-modification-request.go index a8796464..4090b2e0 100644 --- a/message/session-modification-request.go +++ b/message/session-modification-request.go @@ -9,49 +9,47 @@ import ( ) // SessionModificationRequest is a SessionModificationRequest formed PFCP Header and its IEs above. -// -// TODO: add Query Packet Rate Status IE -// -// TODO: rename PortManagementInformationForTSC => TSCManagementInformation type SessionModificationRequest struct { *Header - CPFSEID *ie.IE - RemovePDR []*ie.IE - RemoveFAR []*ie.IE - RemoveURR []*ie.IE - RemoveQER []*ie.IE - RemoveBAR *ie.IE - RemoveTrafficEndpoint []*ie.IE - CreatePDR []*ie.IE - CreateFAR []*ie.IE - CreateURR []*ie.IE - CreateQER []*ie.IE - CreateBAR *ie.IE - CreateTrafficEndpoint []*ie.IE - UpdatePDR []*ie.IE - UpdateFAR []*ie.IE - UpdateURR []*ie.IE - UpdateQER []*ie.IE - UpdateBAR *ie.IE - UpdateTrafficEndpoint []*ie.IE - PFCPSMReqFlags *ie.IE - QueryURR []*ie.IE - FQCSID *ie.IE - UserPlaneInactivityTimer *ie.IE - QueryURRReference *ie.IE - TraceInformation *ie.IE - RemoveMAR []*ie.IE - UpdateMAR []*ie.IE - CreateMAR []*ie.IE - NodeID *ie.IE - PortManagementInformationForTSC *ie.IE - RemoveSRR []*ie.IE - CreateSRR []*ie.IE - UpdateSRR []*ie.IE - ProvideATSSSControlInformation *ie.IE - EthernetContextInformation *ie.IE - AccessAvailabilityInformation []*ie.IE - IEs []*ie.IE + CPFSEID *ie.IE + RemovePDR []*ie.IE + RemoveFAR []*ie.IE + RemoveURR []*ie.IE + RemoveQER []*ie.IE + RemoveBAR *ie.IE + RemoveTrafficEndpoint []*ie.IE + CreatePDR []*ie.IE + CreateFAR []*ie.IE + CreateURR []*ie.IE + CreateQER []*ie.IE + CreateBAR *ie.IE + CreateTrafficEndpoint []*ie.IE + UpdatePDR []*ie.IE + UpdateFAR []*ie.IE + UpdateURR []*ie.IE + UpdateQER []*ie.IE + UpdateBAR *ie.IE + UpdateTrafficEndpoint []*ie.IE + PFCPSMReqFlags *ie.IE + QueryURR []*ie.IE + FQCSID *ie.IE + UserPlaneInactivityTimer *ie.IE + QueryURRReference *ie.IE + TraceInformation *ie.IE + RemoveMAR []*ie.IE + UpdateMAR []*ie.IE + CreateMAR []*ie.IE + NodeID *ie.IE + TSCManagementInformation *ie.IE + RemoveSRR []*ie.IE + CreateSRR []*ie.IE + UpdateSRR []*ie.IE + ProvideATSSSControlInformation *ie.IE + EthernetContextInformation *ie.IE + AccessAvailabilityInformation []*ie.IE + QueryPacketRateStatus []*ie.IE + SNSSAI *ie.IE + IEs []*ie.IE } // NewSessionModificationRequest creates a new SessionModificationRequest. @@ -124,8 +122,8 @@ func NewSessionModificationRequest(mp, fo uint8, seid uint64, seq uint32, pri ui m.CreateMAR = append(m.CreateMAR, i) case ie.NodeID: m.NodeID = i - case ie.PortManagementInformationForTSCWithinSessionModificationRequest: - m.PortManagementInformationForTSC = i + case ie.TSCManagementInformationWithinSessionModificationRequest: + m.TSCManagementInformation = i case ie.RemoveSRR: m.RemoveSRR = append(m.RemoveSRR, i) case ie.CreateSRR: @@ -138,6 +136,10 @@ func NewSessionModificationRequest(mp, fo uint8, seid uint64, seq uint32, pri ui m.EthernetContextInformation = i case ie.AccessAvailabilityInformation: m.AccessAvailabilityInformation = append(m.AccessAvailabilityInformation, i) + case ie.QueryPacketRateStatusWithinSessionModificationRequest: + m.QueryPacketRateStatus = append(m.QueryPacketRateStatus, i) + case ie.SNSSAI: + m.SNSSAI = i default: m.IEs = append(m.IEs, i) } @@ -339,7 +341,7 @@ func (m *SessionModificationRequest) MarshalTo(b []byte) error { } offset += i.MarshalLen() } - if i := m.PortManagementInformationForTSC; i != nil { + if i := m.TSCManagementInformation; i != nil { if err := i.MarshalTo(m.Payload[offset:]); err != nil { return err } @@ -381,6 +383,18 @@ func (m *SessionModificationRequest) MarshalTo(b []byte) error { } offset += i.MarshalLen() } + for _, i := range m.QueryPacketRateStatus { + if err := i.MarshalTo(m.Payload[offset:]); err != nil { + return err + } + offset += i.MarshalLen() + } + if i := m.SNSSAI; i != nil { + if err := i.MarshalTo(m.Payload[offset:]); err != nil { + return err + } + offset += i.MarshalLen() + } for _, ie := range m.IEs { if ie == nil { @@ -481,8 +495,8 @@ func (m *SessionModificationRequest) UnmarshalBinary(b []byte) error { m.CreateMAR = append(m.CreateMAR, i) case ie.NodeID: m.NodeID = i - case ie.PortManagementInformationForTSCWithinSessionModificationRequest: - m.PortManagementInformationForTSC = i + case ie.TSCManagementInformationWithinSessionModificationRequest: + m.TSCManagementInformation = i case ie.RemoveSRR: m.RemoveSRR = append(m.RemoveSRR, i) case ie.CreateSRR: @@ -495,6 +509,10 @@ func (m *SessionModificationRequest) UnmarshalBinary(b []byte) error { m.EthernetContextInformation = i case ie.AccessAvailabilityInformation: m.AccessAvailabilityInformation = append(m.AccessAvailabilityInformation, i) + case ie.QueryPacketRateStatusWithinSessionModificationRequest: + m.QueryPacketRateStatus = append(m.QueryPacketRateStatus, i) + case ie.SNSSAI: + m.SNSSAI = i default: m.IEs = append(m.IEs, i) } @@ -594,7 +612,7 @@ func (m *SessionModificationRequest) MarshalLen() int { if i := m.NodeID; i != nil { l += i.MarshalLen() } - if i := m.PortManagementInformationForTSC; i != nil { + if i := m.TSCManagementInformation; i != nil { l += i.MarshalLen() } for _, i := range m.RemoveSRR { @@ -615,6 +633,12 @@ func (m *SessionModificationRequest) MarshalLen() int { for _, i := range m.AccessAvailabilityInformation { l += i.MarshalLen() } + for _, i := range m.QueryPacketRateStatus { + l += i.MarshalLen() + } + if i := m.SNSSAI; i != nil { + l += i.MarshalLen() + } for _, ie := range m.IEs { if ie == nil { diff --git a/message/session-modification-request_test.go b/message/session-modification-request_test.go index efa21b03..6b47f7e6 100644 --- a/message/session-modification-request_test.go +++ b/message/session-modification-request_test.go @@ -435,12 +435,14 @@ func TestSessionModificationRequest(t *testing.T) { mac1, mac2, mac3, mac4, ), ), - ie.NewAccessAvailabilityControlInformation( - ie.NewRequestedAccessAvailabilityInformation(1), + ie.NewAccessAvailabilityInformation(3, 3), + ie.NewQueryPacketRateStatusWithinSessionModificationRequest( + ie.NewQERID(0xffffffff), ), + ie.NewSNSSAI(0x11, 0x223344), ), Serialized: []byte{ - 0x21, 0x34, 0x0c, 0xd0, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x11, 0x22, 0x33, 0x00, + 0x21, 0x34, 0x0c, 0xe0, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x11, 0x22, 0x33, 0x00, 0x00, 0x39, 0x00, 0x0d, 0x02, 0x11, 0x11, 0x11, 0x11, 0x22, 0x22, 0x22, 0x22, 0x7f, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x06, 0x00, 0x38, 0x00, 0x02, 0xff, 0xff, @@ -891,9 +893,12 @@ func TestSessionModificationRequest(t *testing.T) { 0x04, 0x12, 0x34, 0x56, 0x78, 0x90, 0x01, 0x12, 0x34, 0x56, 0x78, 0x90, 0x02, 0x12, 0x34, 0x56, 0x78, 0x90, 0x03, 0x12, 0x34, 0x56, 0x78, 0x90, 0x04, 0x03, 0x07, 0xf9, 0xff, 0x03, 0x07, 0xf9, 0xff, - // AccessAvailabilityControlInformation - 0x00, 0xd8, 0x00, 0x05, - 0x00, 0xd9, 0x00, 0x01, 0x01, + // AccessAvailabilityInformation + 0x00, 0xdb, 0x00, 0x01, 0x0f, + // QueryPacketRateStatusWithinSessionModificationRequest + 0x01, 0x07, 0x00, 0x08, 0x00, 0x6d, 0x00, 0x04, 0xff, 0xff, 0xff, 0xff, + // SNSSAI + 0x01, 0x01, 0x00, 0x04, 0x11, 0x22, 0x33, 0x44, }, }, { @@ -1355,12 +1360,14 @@ func TestSessionModificationRequest(t *testing.T) { mac1, mac2, mac3, mac4, ), ), - ie.NewAccessAvailabilityControlInformation( - ie.NewRequestedAccessAvailabilityInformation(1), + ie.NewAccessAvailabilityInformation(3, 3), + ie.NewQueryPacketRateStatusWithinSessionModificationRequest( + ie.NewQERID(0xffffffff), ), + ie.NewSNSSAI(0x11, 0x223344), ), Serialized: []byte{ - 0x21, 0x34, 0x0e, 0x5a, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x11, 0x22, 0x33, 0x00, + 0x21, 0x34, 0x0e, 0x6a, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x11, 0x22, 0x33, 0x00, 0x00, 0x39, 0x00, 0x0d, 0x02, 0x11, 0x11, 0x11, 0x11, 0x22, 0x22, 0x22, 0x22, 0x7f, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x06, 0x00, 0x38, 0x00, 0x02, 0xff, 0xff, @@ -1869,9 +1876,12 @@ func TestSessionModificationRequest(t *testing.T) { 0x04, 0x12, 0x34, 0x56, 0x78, 0x90, 0x01, 0x12, 0x34, 0x56, 0x78, 0x90, 0x02, 0x12, 0x34, 0x56, 0x78, 0x90, 0x03, 0x12, 0x34, 0x56, 0x78, 0x90, 0x04, 0x03, 0x07, 0xf9, 0xff, 0x03, 0x07, 0xf9, 0xff, - // AccessAvailabilityControlInformation - 0x00, 0xd8, 0x00, 0x05, - 0x00, 0xd9, 0x00, 0x01, 0x01, + // AccessAvailabilityInformation + 0x00, 0xdb, 0x00, 0x01, 0x0f, + // QueryPacketRateStatusWithinSessionModificationRequest + 0x01, 0x07, 0x00, 0x08, 0x00, 0x6d, 0x00, 0x04, 0xff, 0xff, 0xff, 0xff, + // SNSSAI + 0x01, 0x01, 0x00, 0x04, 0x11, 0x22, 0x33, 0x44, }, }, } diff --git a/message/session-modification-response.go b/message/session-modification-response.go index b2243f4f..1257db63 100644 --- a/message/session-modification-response.go +++ b/message/session-modification-response.go @@ -27,6 +27,7 @@ type SessionModificationResponse struct { CreatedBridgeInfoForTSC *ie.IE ATSSSControlParameters *ie.IE UpdatedPDR []*ie.IE + PacketRateStatusReport []*ie.IE IEs []*ie.IE } @@ -66,6 +67,8 @@ func NewSessionModificationResponse(mp, fo uint8, seid uint64, seq uint32, pri u m.ATSSSControlParameters = i case ie.UpdatedPDR: m.UpdatedPDR = append(m.UpdatedPDR, i) + case ie.PacketRateStatusReport: + m.PacketRateStatusReport = append(m.PacketRateStatusReport, i) default: m.IEs = append(m.IEs, i) } @@ -165,6 +168,12 @@ func (m *SessionModificationResponse) MarshalTo(b []byte) error { } offset += i.MarshalLen() } + for _, i := range m.PacketRateStatusReport { + if err := i.MarshalTo(m.Payload[offset:]); err != nil { + return err + } + offset += i.MarshalLen() + } for _, ie := range m.IEs { if ie == nil { @@ -231,6 +240,8 @@ func (m *SessionModificationResponse) UnmarshalBinary(b []byte) error { m.ATSSSControlParameters = i case ie.UpdatedPDR: m.UpdatedPDR = append(m.UpdatedPDR, i) + case ie.PacketRateStatusReport: + m.PacketRateStatusReport = append(m.PacketRateStatusReport, i) default: m.IEs = append(m.IEs, i) } @@ -279,6 +290,9 @@ func (m *SessionModificationResponse) MarshalLen() int { for _, i := range m.UpdatedPDR { l += i.MarshalLen() } + for _, i := range m.PacketRateStatusReport { + l += i.MarshalLen() + } for _, ie := range m.IEs { if ie == nil { diff --git a/message/session-modification-response_test.go b/message/session-modification-response_test.go index 70d46067..7bced186 100644 --- a/message/session-modification-response_test.go +++ b/message/session-modification-response_test.go @@ -90,9 +90,13 @@ func TestSessionModificationResponse(t *testing.T) { ie.NewPDRID(0xffff), ie.NewFTEID(0x01, 0x11111111, net.ParseIP("127.0.0.1"), nil, 0), ), + ie.NewPacketRateStatusReportWithinSessionModificationResponse( + ie.NewQERID(0xffffffff), + ie.NewPacketRateStatus(0x07, 0x1111, 0x2222, 0x3333, 0x4444, time.Date(2019, time.January, 1, 0, 0, 0, 0, time.UTC)), + ), ), Serialized: []byte{ - 0x21, 0x35, 0x02, 0x39, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x11, 0x22, 0x33, 0x00, + 0x21, 0x35, 0x02, 0x5a, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x11, 0x22, 0x33, 0x00, 0x00, 0x13, 0x00, 0x01, 0x01, 0x00, 0x28, 0x00, 0x02, 0x00, 0x13, 0x00, 0x08, 0x00, 0x29, @@ -174,6 +178,15 @@ func TestSessionModificationResponse(t *testing.T) { 0x01, 0x00, 0x00, 0x13, 0x00, 0x38, 0x00, 0x02, 0xff, 0xff, 0x00, 0x15, 0x00, 0x09, 0x01, 0x11, 0x11, 0x11, 0x11, 0x7f, 0x00, 0x00, 0x01, + 0x01, 0x08, 0x00, 0x1d, + 0x00, 0x6d, 0x00, 0x04, 0xff, 0xff, 0xff, 0xff, + 0x00, 0xc1, 0x00, 0x11, + 0x07, + 0x11, 0x11, + 0x22, 0x22, + 0x33, 0x33, + 0x44, 0x44, + 0x00, 0x00, 0x00, 0x00, 0xdf, 0xd5, 0x2c, 0x00, }, }, { @@ -255,9 +268,13 @@ func TestSessionModificationResponse(t *testing.T) { ie.NewPDRID(0xffff), ie.NewFTEID(0x01, 0x11111111, net.ParseIP("127.0.0.1"), nil, 0), ), + ie.NewPacketRateStatusReportWithinSessionModificationResponse( + ie.NewQERID(0xffffffff), + ie.NewPacketRateStatus(0x07, 0x1111, 0x2222, 0x3333, 0x4444, time.Date(2019, time.January, 1, 0, 0, 0, 0, time.UTC)), + ), ), Serialized: []byte{ - 0x21, 0x35, 0x02, 0x66, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x11, 0x22, 0x33, 0x00, + 0x21, 0x35, 0x02, 0x87, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x11, 0x22, 0x33, 0x00, 0x00, 0x13, 0x00, 0x01, 0x01, 0x00, 0x28, 0x00, 0x02, 0x00, 0x13, 0x00, 0x08, 0x00, 0x29, @@ -344,6 +361,15 @@ func TestSessionModificationResponse(t *testing.T) { 0x01, 0x00, 0x00, 0x13, 0x00, 0x38, 0x00, 0x02, 0xff, 0xff, 0x00, 0x15, 0x00, 0x09, 0x01, 0x11, 0x11, 0x11, 0x11, 0x7f, 0x00, 0x00, 0x01, + 0x01, 0x08, 0x00, 0x1d, + 0x00, 0x6d, 0x00, 0x04, 0xff, 0xff, 0xff, 0xff, + 0x00, 0xc1, 0x00, 0x11, + 0x07, + 0x11, 0x11, + 0x22, 0x22, + 0x33, 0x33, + 0x44, 0x44, + 0x00, 0x00, 0x00, 0x00, 0xdf, 0xd5, 0x2c, 0x00, }, }, }