qos

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QFDParameterId5Qi     uint8 = 0x01
	QFDParameterIdGfbrUl  uint8 = 0x02
	QFDParameterIdGfbrDl  uint8 = 0x03
	QFDParameterIdMfbrUl  uint8 = 0x04
	QFDParameterIdMfbrDl  uint8 = 0x05
	QFDParameterIdAvgWind uint8 = 0x06
	QFDParameterIdEpsBId  uint8 = 0x07
)

TS 24.501 Table 9.11.4.12

- 01H (5QI); - 02H (GFBR uplink); - 03H (GFBR downlink); - 04H (MFBR uplink); - 05H (MFBR downlink); - 06H (Averaging window); and - 07H (EPS bearer identity).

View Source
const (
	QFBitRate1Kbps uint8 = 0x01
	QFBitRate1Mbps uint8 = 0x06
	QFBitRate1Gbps uint8 = 0x0B
)
View Source
const (
	QFDOpCreate uint8 = 0x20
	QFDOpModify uint8 = 0x40
	QFDOpDelete uint8 = 0x60
)
View Source
const (
	QFDQfiBitmask    uint8 = 0x3f // bits 6 to 1 of octet
	QFDOpCodeBitmask uint8 = 0xe0 // bits 8 to 6 of octet
	QFDEbit          uint8 = 0x40 // 7th bit of param length octet
)
View Source
const (
	OperationCodeCreateNewQoSRule                                   uint8 = 1
	OperationCodeDeleteExistingQoSRule                              uint8 = 2
	OperationCodeModifyExistingQoSRuleAndAddPacketFilters           uint8 = 3
	OperationCodeModifyExistingQoSRuleAndReplaceAllPacketFilters    uint8 = 4
	OperationCodeModifyExistingQoSRuleAndDeletePacketFilters        uint8 = 5
	OperationCodeModifyExistingQoSRuleWithoutModifyingPacketFilters uint8 = 6
)
View Source
const (
	PacketFilterDirectionDownlink      uint8 = 1
	PacketFilterDirectionUplink        uint8 = 2
	PacketFilterDirectionBidirectional uint8 = 3
)
View Source
const (
	PFComponentTypeMatchAll                       uint8 = 0x01
	PFComponentTypeIPv4RemoteAddress              uint8 = 0x10
	PFComponentTypeIPv4LocalAddress               uint8 = 0x11
	PFComponentTypeIPv6RemoteAddress              uint8 = 0x21
	PFComponentTypeIPv6LocalAddress               uint8 = 0x23
	PFComponentTypeProtocolIdentifierOrNextHeader uint8 = 0x30
	PFComponentTypeSingleLocalPort                uint8 = 0x40
	PFComponentTypeLocalPortRange                 uint8 = 0x41
	PFComponentTypeSingleRemotePort               uint8 = 0x50
	PFComponentTypeRemotePortRange                uint8 = 0x51
	PFComponentTypeSecurityParameterIndex         uint8 = 0x60
	PFComponentTypeTypeOfServiceOrTrafficClass    uint8 = 0x70
	PFComponentTypeFlowLabel                      uint8 = 0x80
	PFComponentTypeDestinationMACAddress          uint8 = 0x81
	PFComponentTypeSourceMACAddress               uint8 = 0x82
	PFComponentType8021Q_CTAG_VID                 uint8 = 0x83
	PFComponentType8021Q_STAG_VID                 uint8 = 0x84
	PFComponentType8021Q_CTAG_PCPOrDEI            uint8 = 0x85
	PFComponentType8021Q_STAG_PCPOrDEI            uint8 = 0x86
	PFComponentTypeEthertype                      uint8 = 0x87
)

TS 24.501 Table 9.11.4.13.1

View Source
const (
	PacketFilterIdBitmask uint8 = 0x0f
)
View Source
const (
	QFDFixLen uint8 = 0x03
)

Variables

This section is empty.

Functions

func CommitConditionDataUpdate

func CommitConditionDataUpdate(smCtxtPolData *SmCtxtPolicyData, update *CondDataUpdate)

func CommitPccRulesUpdate

func CommitPccRulesUpdate(smCtxtPolData *SmCtxtPolicyData, update *PccRulesUpdate)

func CommitQosFlowDescUpdate

func CommitQosFlowDescUpdate(smCtxtPolData *SmCtxtPolicyData, update *QosFlowsUpdate)

func CommitSessionRulesUpdate

func CommitSessionRulesUpdate(smCtxtPolData *SmCtxtPolicyData, update *SessRulesUpdate)

func CommitSmPolicyDecision

func CommitSmPolicyDecision(smCtxtPolData *SmCtxtPolicyData, smPolicyUpdate *PolicyUpdate) error

func CommitTrafficControlUpdate

func CommitTrafficControlUpdate(smCtxtPolData *SmCtxtPolicyData, update *TrafficControlUpdate)

func GetBitRate

func GetBitRate(sBitRate string) (val uint16, unit uint8)

func GetDefaultQoSDataFromPolicyDecision

func GetDefaultQoSDataFromPolicyDecision(smPolicyDecision *models.SmPolicyDecision) *models.QosData

func GetPccRuleChanges

func GetPccRuleChanges(s, d *models.PccRule) bool

Get the difference between 2 pcc rules

func GetPfDirectionFromPccFlowInfo

func GetPfDirectionFromPccFlowInfo(flowDir models.FlowDirectionRm) uint8

Get Packet Filter Directions

func GetPfId

func GetPfId(ids string) uint8

func GetQoSDataFromPolicyDecision

func GetQoSDataFromPolicyDecision(smPolicyDecision *models.SmPolicyDecision, refQosData string) *models.QosData

func GetQosDataChanges

func GetQosDataChanges(qf1, qf2 *models.QosData) bool

Compare if any change in QoS Data

func GetQosFlowIdFromQosId

func GetQosFlowIdFromQosId(qosId string) uint8

func GetQosRuleIdFromPccRuleId

func GetQosRuleIdFromPccRuleId(pccRuleId string) uint8

func GetTCDataChanges

func GetTCDataChanges(pcfTc, ctxtTc *models.TrafficControlData) bool

func GetTcDataFromPolicyDecision

func GetTcDataFromPolicyDecision(smPolicyDecision *models.SmPolicyDecision, refTcData string) *models.TrafficControlData

func PccFlowInfosString

func PccFlowInfosString(flows []models.FlowInformation) []string

func PccRuleString

func PccRuleString(pcc *models.PccRule) string

func QosDataString

func QosDataString(q *models.QosData) string

func SessRuleString

func SessRuleString(s *models.SessionRule) string

func TCDataString

func TCDataString(tcData *models.TrafficControlData) string

Types

type CondDataUpdate

type CondDataUpdate struct {
	// contains filtered or unexported fields
}

func GetConditionDataUpdate

func GetConditionDataUpdate(condData, ctxtCondData map[string]*models.ConditionData) *CondDataUpdate

type IPFilterRule

type IPFilterRule struct {
	// contains filtered or unexported fields
}

func DecodeFlowDescToIPFilters

func DecodeFlowDescToIPFilters(flowDesc string) *IPFilterRule

See spec 29212-5.4.2 / 29512-5.6.3.2

func (*IPFilterRule) IsMatchAllIPFilter

func (ipf *IPFilterRule) IsMatchAllIPFilter() bool

type IPFilterRuleIpAddrV4

type IPFilterRuleIpAddrV4 struct {
	// contains filtered or unexported fields
}

type IPFilterRulePortRange

type IPFilterRulePortRange struct {
	// contains filtered or unexported fields
}

type PacketFilter

type PacketFilter struct {
	Content       []PacketFilterComponent
	Direction     uint8
	Identifier    uint8 // only 0-15
	ContentLength uint8
}

func GetPacketFilterFromFlowInfo

func GetPacketFilterFromFlowInfo(flowInfo *models.FlowInformation) PacketFilter

func (*PacketFilter) GetPfContent

func (pf *PacketFilter) GetPfContent(flowDesc string)

func (*PacketFilter) MarshalBinary

func (pf *PacketFilter) MarshalBinary() (data []byte, err error)

type PacketFilterComponent

type PacketFilterComponent struct {
	ComponentValue []byte
	ComponentType  uint8
}

func BuildPFCompProtocolId

func BuildPFCompProtocolId(val string) (*PacketFilterComponent, uint8)

type PccRulesUpdate

type PccRulesUpdate struct {
	// contains filtered or unexported fields
}

func GetPccRulesUpdate

func GetPccRulesUpdate(pcfPccRules, ctxtPccRules map[string]*models.PccRule) *PccRulesUpdate

func (*PccRulesUpdate) GetAddPccRuleUpdate

func (upd *PccRulesUpdate) GetAddPccRuleUpdate() map[string]*models.PccRule

func (PccRulesUpdate) String

func (obj PccRulesUpdate) String() string

type PolicyUpdate

type PolicyUpdate struct {
	SessRuleUpdate *SessRulesUpdate
	PccRuleUpdate  *PccRulesUpdate
	QosFlowUpdate  *QosFlowsUpdate
	TCUpdate       *TrafficControlUpdate
	CondDataUpdate *CondDataUpdate

	// relevant SM Policy Decision from PCF
	SmPolicyDecision *models.SmPolicyDecision
}

Define SMF Session-Rule/PccRule/Rule-Qos-Data

func BuildSmPolicyUpdate

func BuildSmPolicyUpdate(smCtxtPolData *SmCtxtPolicyData, smPolicyDecision *models.SmPolicyDecision) *PolicyUpdate

func (PolicyUpdate) String

func (obj PolicyUpdate) String() string

type QoSFlowDescription

type QoSFlowDescription struct {
	ParamList  []QosFlowParameter
	Qfi        uint8
	OpCode     uint8
	NumOfParam uint8
	QFDLen     uint8
}

func (*QoSFlowDescription) AddQosFlowParam5Qi

func (q *QoSFlowDescription) AddQosFlowParam5Qi(val uint8)

func (*QoSFlowDescription) SetQFDEBitCreateNewQFD

func (f *QoSFlowDescription) SetQFDEBitCreateNewQFD()

E-Bit Encoding For the "create new QoS flow description" operation, 1: parameters list is included

func (*QoSFlowDescription) SetQoSFlowDescOpCode

func (f *QoSFlowDescription) SetQoSFlowDescOpCode(val uint8)

Operation code -bits 8 to 6 of octet(xxx00000)

func (*QoSFlowDescription) SetQoSFlowDescQfi

func (f *QoSFlowDescription) SetQoSFlowDescQfi(val uint8)

bits 6 to 1 of octet(00xxxxxx)

type QoSRules

type QoSRules []QosRule

func BuildQosRules

func BuildQosRules(smPolicyUpdates *PolicyUpdate) QoSRules

func (QoSRules) MarshalBinary

func (rs QoSRules) MarshalBinary() (data []byte, err error)

type QosFlowDescriptionsAuthorized

type QosFlowDescriptionsAuthorized struct {
	Content []byte
	IeType  uint8
	IeLen   uint16
}

func BuildAuthorizedQosFlowDescriptions

func BuildAuthorizedQosFlowDescriptions(smPolicyUpdates *PolicyUpdate) *QosFlowDescriptionsAuthorized

Build Qos Flow Description to be sent to UE

func (*QosFlowDescriptionsAuthorized) AddQFD

Encode QoSFlowDescriptions IE

func (*QosFlowDescriptionsAuthorized) BuildAddQosFlowDescFromQoSDesc

func (d *QosFlowDescriptionsAuthorized) BuildAddQosFlowDescFromQoSDesc(qosData *models.QosData)

type QosFlowParameter

type QosFlowParameter struct {
	ParamContent []byte
	ParamId      uint8
	ParamLen     uint8
}

Qos Flow Description Parameter

func (*QosFlowParameter) SetQosFlowParamBitRate

func (p *QosFlowParameter) SetQosFlowParamBitRate(rateType, rateUnit uint8, rateVal uint16)

type QosFlowsUpdate

type QosFlowsUpdate struct {
	// contains filtered or unexported fields
}

func GetQosFlowDescUpdate

func GetQosFlowDescUpdate(pcfQosData, ctxtQosData map[string]*models.QosData) *QosFlowsUpdate

func (*QosFlowsUpdate) GetAddQosFlowUpdate

func (upd *QosFlowsUpdate) GetAddQosFlowUpdate() map[string]*models.QosData

func (QosFlowsUpdate) String

func (obj QosFlowsUpdate) String() string

type QosRule

type QosRule struct {
	PacketFilterList []PacketFilter
	Identifier       uint8 // 0 0 0 0 0 0 0 1	QRI 1 to 1 1 1 1 1 1 1 1	QRI 255
	OperationCode    uint8
	DQR              uint8
	Segregation      uint8
	Precedence       uint8
	QFI              uint8
	Length           uint8
}

func BuildAddQoSRuleFromPccRule

func BuildAddQoSRuleFromPccRule(pccRule *models.PccRule, qosData *models.QosData, pccRuleOpCode uint8) *QosRule

func (*QosRule) BuildPacketFilterListFromPccRule

func (q *QosRule) BuildPacketFilterListFromPccRule(pccRule *models.PccRule)

func (*QosRule) MarshalBinary

func (r *QosRule) MarshalBinary() ([]byte, error)

type SessRulesUpdate

type SessRulesUpdate struct {
	ActiveSessRule *models.SessionRule
	// contains filtered or unexported fields
}

Handle Session Rule related info

func GetSessionRulesUpdate

func GetSessionRulesUpdate(pcfSessRules, ctxtSessRules map[string]*models.SessionRule) *SessRulesUpdate

Get Session rule changes delta

func (SessRulesUpdate) String

func (obj SessRulesUpdate) String() string

type SmCtxtChargingData

type SmCtxtChargingData struct {
	ChargingData map[string]*models.ChargingData
}

type SmCtxtCondData

type SmCtxtCondData struct {
	CondData map[string]*models.ConditionData
}

type SmCtxtPccRulesInfo

type SmCtxtPccRulesInfo struct {
	PccRules map[string]*models.PccRule
}

type SmCtxtPolicyData

type SmCtxtPolicyData struct {
	// maintain all session rule-info and current active sess rule
	SmCtxtPccRules     SmCtxtPccRulesInfo
	SmCtxtQosData      SmCtxtQosData
	SmCtxtTCData       SmCtxtTrafficControlData
	SmCtxtChargingData SmCtxtChargingData
	SmCtxtCondData     SmCtxtCondData
	SmCtxtSessionRules SmCtxtSessionRulesInfo
}

func (*SmCtxtPolicyData) Initialize

func (obj *SmCtxtPolicyData) Initialize()

type SmCtxtQosData

type SmCtxtQosData struct {
	QosData map[string]*models.QosData
}

type SmCtxtSessionRulesInfo

type SmCtxtSessionRulesInfo struct {
	ActiveRule     *models.SessionRule
	SessionRules   map[string]*models.SessionRule
	ActiveRuleName string
}

maintain all session rule-info and current active sess rule

type SmCtxtTrafficControlData

type SmCtxtTrafficControlData struct {
	TrafficControlData map[string]*models.TrafficControlData
}

type TrafficControlUpdate

type TrafficControlUpdate struct {
	// contains filtered or unexported fields
}

func GetTrafficControlUpdate

func GetTrafficControlUpdate(tcData, ctxtTcData map[string]*models.TrafficControlData) *TrafficControlUpdate

func (TrafficControlUpdate) String

func (obj TrafficControlUpdate) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL