Skip to content

Commit

Permalink
Merge pull request #640 from LibreQoE/zero_min_integrations
Browse files Browse the repository at this point in the history
Set bandwidth minimums to 1M for CRM/NMS integrations
  • Loading branch information
rchac authored Feb 24, 2025
2 parents 62ae714 + 488ae11 commit 5a93bb5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/integrationCommon.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,8 @@ def createShapedDevices(self):
device["mac"],
device["ipv4"],
device["ipv6"],
int(float(circuit["download"]) * committed_bandwidth_multiplier()),
int(float(circuit["upload"]) * committed_bandwidth_multiplier()),
int(1),
int(1),
int(float(circuit["download"]) * bandwidth_overhead_factor()),
int(float(circuit["upload"]) * bandwidth_overhead_factor()),
""
Expand Down
14 changes: 6 additions & 8 deletions src/rust/uisp_integration/src/strategies/flat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,9 @@ pub async fn build_flat_network(
config.queues.generated_pn_download_mbps,
config.queues.generated_pn_upload_mbps,
);
let download_min = (download_max as f32
* config.uisp_integration.commit_bandwidth_multiplier)
let download_min = 1
as u64;
let upload_min = (upload_max as f32
* config.uisp_integration.commit_bandwidth_multiplier)
let upload_min = 1
as u64;
for device in devices.iter() {
let dev = UispDevice::from_uisp(device, &config, &ip_ranges, &ipv4_to_v6);
Expand All @@ -103,10 +101,10 @@ pub async fn build_flat_network(
mac: device.identification.mac.clone().unwrap_or("".to_string()),
ipv4: dev.ipv4_list(),
ipv6: dev.ipv6_list(),
download_min: u64::max(2, download_min),
download_max: u64::max(3, download_max as u64),
upload_min: u64::max(2, upload_min),
upload_max: u64::max(3, upload_max as u64),
download_min: u64::max(1, download_min),
download_max: u64::max(2, download_max as u64),
upload_min: u64::max(1, upload_min),
upload_max: u64::max(2, upload_max as u64),
comment: "".to_string(),
};
shaped_devices.push(sd);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ fn traverse(
mac: device.mac.clone(),
ipv4: device.ipv4_list(),
ipv6: device.ipv6_list(),
download_min: u64::max(2, download_min),
download_min: u64::min(1, download_min),
download_max: u64::max(3, download_max),
upload_min: u64::max(2, upload_min),
upload_min: u64::min(1, upload_min),
upload_max: u64::max(3, upload_max),
comment: "".to_string(),
};
Expand Down

0 comments on commit 5a93bb5

Please sign in to comment.