Skip to content

Commit

Permalink
Merge pull request #139 from lyz508/feat/ulcl-charging
Browse files Browse the repository at this point in the history
feat: Add session level charging URRs to ULCL created path
  • Loading branch information
ianchen0119 authored Dec 26, 2024
2 parents 8fa79e3 + 00e4b4e commit fb543b8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
7 changes: 5 additions & 2 deletions internal/context/sm_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -586,8 +586,11 @@ func (c *SMContext) SelectDefaultDataPath() error {
if GetSelf().ULCLSupport && CheckUEHasPreConfig(c.Supi) {
c.Log.Infof("Has pre-config default path")
uePreConfigPaths := GetUEPreConfigPaths(c.Supi, c.SelectedUPF.Name)
c.Tunnel.DataPathPool = uePreConfigPaths.DataPathPool
c.Tunnel.PathIDGenerator = uePreConfigPaths.PathIDGenerator
for _, dp := range uePreConfigPaths.DataPathPool {
if !dp.IsDefaultPath {
c.Tunnel.AddDataPath(dp)
}
}
defaultPath = uePreConfigPaths.DataPathPool.GetDefaultPath()
} else if c.Tunnel.DataPathPool.GetDefaultPath() == nil {
// UE has no pre-config path and default path
Expand Down
24 changes: 24 additions & 0 deletions internal/sbi/processor/ulcl_procedure.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,30 @@ func EstablishULCL(smContext *context.SMContext) {

// find updatedUPF in activatingPath
for curDPNode := activatingPath.FirstDPNode; curDPNode != nil; curDPNode = curDPNode.Next() {
smContext.Log.Traceln("Current DP Node IP: ", curDPNode.UPF.NodeID.ResolveNodeIdToIp().String())

if curDPNode.IsAnchorUPF() {
var pduLevelChargingUrrs []*context.URR

// Select PDU session level charging URRs from pcc rule
for _, pccRule := range smContext.PCCRules {
if chargingLevel, err := pccRule.IdentifyChargingLevel(); err != nil {
continue
} else if chargingLevel == context.PduSessionCharging {
pduLevelChargingUrrs = pccRule.Datapath.GetChargingUrr(smContext)
break
}
}

// Append URRs to anchor UPF
if curDPNode.UpLinkTunnel != nil && curDPNode.UpLinkTunnel.PDR != nil {
curDPNode.UpLinkTunnel.PDR.AppendURRs(pduLevelChargingUrrs)
}
if curDPNode.DownLinkTunnel != nil && curDPNode.DownLinkTunnel.PDR != nil {
curDPNode.DownLinkTunnel.PDR.AppendURRs(pduLevelChargingUrrs)
}
}

if reflect.DeepEqual(ulcl.NodeID, curDPNode.UPF.NodeID) {
UPLinkPDR := curDPNode.UpLinkTunnel.PDR
DownLinkPDR := curDPNode.DownLinkTunnel.PDR
Expand Down

0 comments on commit fb543b8

Please sign in to comment.