-
Notifications
You must be signed in to change notification settings - Fork 13
Feat multiple dnn #194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Feat multiple dnn #194
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -64,11 +64,12 @@ type Configuration struct { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type DevGroup struct { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Name string `yaml:"name,omitempty"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SiteInfo string `yaml:"site-info,omitempty" json:"site-info,omitempty"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Imsis []string `yaml:"imsis,omitempty" json:"imsis,omitempty"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| IpDomainName string `yaml:"ip-domain-name,omitempty" json:"ip-domain-name,omitempty"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| IpDomain *IpDomain `yaml:"ip-domain-expanded,omitempty" json:"ip-domain-expanded,omitempty"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Name string `yaml:"name,omitempty"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SiteInfo string `yaml:"site-info,omitempty" json:"site-info,omitempty"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Imsis []string `yaml:"imsis,omitempty" json:"imsis,omitempty"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Msisdns []string `yaml:"msisdns,omitempty" json:"msisdns,omitempty"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| IpDomainName string `yaml:"ip-domain-name,omitempty" json:"ip-domain-name,omitempty"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| IpDomains []IpDomain `yaml:"ip-domains,omitempty" json:"ip-domains,omitempty"` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| visited bool | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -586,6 +587,13 @@ func compareGroup(groupNew *DevGroup, groupOld *DevGroup) bool { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| logger.SimappLog.Infoln("number of Imsis changed") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Compare MSISDN list length | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if !reflect.DeepEqual(groupNew.Msisdns, groupOld.Msisdns) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| logger.SimappLog.Infoln("msisdns list has changed") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var allimsiNew string | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for _, imsi := range groupNew.Imsis { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| allimsiNew = allimsiNew + imsi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -609,26 +617,41 @@ func compareGroup(groupNew *DevGroup, groupOld *DevGroup) bool { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| oldipdomain := groupOld.IpDomain | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| newipdomain := groupNew.IpDomain | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if oldipdomain.Dnn != newipdomain.Dnn { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if oldipdomain.Mtu != newipdomain.Mtu { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if oldipdomain.UePool != newipdomain.UePool { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if oldipdomain.UeDnnQos != nil && newipdomain.UeDnnQos != nil { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if oldipdomain.UeDnnQos.TrafficClass != nil && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| newipdomain.UeDnnQos.TrafficClass != nil { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (oldipdomain.UeDnnQos.TrafficClass.Name != newipdomain.UeDnnQos.TrafficClass.Name) || | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (oldipdomain.UeDnnQos.TrafficClass.Qci != newipdomain.UeDnnQos.TrafficClass.Qci) || | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (oldipdomain.UeDnnQos.TrafficClass.Arp != newipdomain.UeDnnQos.TrafficClass.Arp) || | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (oldipdomain.UeDnnQos.TrafficClass.Pdb != newipdomain.UeDnnQos.TrafficClass.Pdb) || | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (oldipdomain.UeDnnQos.TrafficClass.Pelr != newipdomain.UeDnnQos.TrafficClass.Pelr) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for i := range groupNew.IpDomains { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if i >= len(groupOld.IpDomains) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // If groupOld doesn't have enough IpDomains | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| oldIpDomain := groupOld.IpDomains[i] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| newIpDomain := groupNew.IpDomains[i] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if oldIpDomain.Dnn != newIpDomain.Dnn { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| logger.SimappLog.Infoln("DNN changed") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if oldIpDomain.Mtu != newIpDomain.Mtu { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| logger.SimappLog.Infoln("MTU changed") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if oldIpDomain.UePool != newIpDomain.UePool { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| logger.SimappLog.Infoln("UePool changed") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Compare UeDnnQos if not nil | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if oldIpDomain.UeDnnQos != nil && newIpDomain.UeDnnQos != nil { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+644
to
+645
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Compare UeDnnQos if not nil | |
| if oldIpDomain.UeDnnQos != nil && newIpDomain.UeDnnQos != nil { | |
| // Detect changes in presence of UeDnnQos (nil vs non-nil) | |
| if (oldIpDomain.UeDnnQos == nil) != (newIpDomain.UeDnnQos == nil) { | |
| logger.SimappLog.Infoln("UeDnnQos presence changed (nil vs non-nil)") | |
| return true | |
| } | |
| // Compare UeDnnQos fields when both are non-nil | |
| if oldIpDomain.UeDnnQos != nil && newIpDomain.UeDnnQos != nil { | |
| // Detect changes in presence of TrafficClass (nil vs non-nil) | |
| if (oldIpDomain.UeDnnQos.TrafficClass == nil) != (newIpDomain.UeDnnQos.TrafficClass == nil) { | |
| logger.SimappLog.Infoln("TrafficClass presence changed (nil vs non-nil)") | |
| return true | |
| } |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to UeDnnQos, the TrafficClass comparison doesn't detect transitions between nil and non-nil states. If one TrafficClass is nil and the other isn't, this represents a configuration change that should be detected.
| // Compare UeDnnQos if not nil | |
| if oldIpDomain.UeDnnQos != nil && newIpDomain.UeDnnQos != nil { | |
| // Compare UeDnnQos, including nil/non-nil transitions and TrafficClass | |
| if (oldIpDomain.UeDnnQos == nil) != (newIpDomain.UeDnnQos == nil) { | |
| logger.SimappLog.Infoln("UeDnnQos presence changed") | |
| return true | |
| } | |
| if oldIpDomain.UeDnnQos != nil && newIpDomain.UeDnnQos != nil { | |
| // Detect nil/non-nil transitions for TrafficClass itself | |
| if (oldIpDomain.UeDnnQos.TrafficClass == nil) != (newIpDomain.UeDnnQos.TrafficClass == nil) { | |
| logger.SimappLog.Infoln("TrafficClass presence changed") | |
| return true | |
| } |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The TrafficClass comparison doesn't check the UeDnnQos bitrate fields (dnn-mbr-downlink, dnn-mbr-uplink, bitrate-unit shown in the PR description). Changes to these QoS parameters won't be detected, leading to stale configurations. Include comparisons for all relevant UeDnnQos fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comparison logic doesn't account for cases where groupOld has more IpDomains than groupNew. If groupOld.IpDomains has 3 entries and groupNew.IpDomains has 2, the function will only compare the first 2 and miss the deletion. Add a length comparison before the loop to check if
len(groupNew.IpDomains) != len(groupOld.IpDomains).