Add setters to NetworkEmulationManager::SimulatedNetworkNode::Builder.
Bug: b/294494713
Change-Id: I89130a4742da5f04680aa38721afcd7f91fb30ad
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/314980
Auto-Submit: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40511}
diff --git a/api/test/network_emulation_manager.cc b/api/test/network_emulation_manager.cc
index 236e2f0..756fe4e 100644
--- a/api/test/network_emulation_manager.cc
+++ b/api/test/network_emulation_manager.cc
@@ -82,6 +82,33 @@
return *this;
}
+NetworkEmulationManager::SimulatedNetworkNode::Builder&
+NetworkEmulationManager::SimulatedNetworkNode::Builder::
+ delay_standard_deviation_ms(int delay_standard_deviation_ms) {
+ config_.delay_standard_deviation_ms = delay_standard_deviation_ms;
+ return *this;
+}
+
+NetworkEmulationManager::SimulatedNetworkNode::Builder&
+NetworkEmulationManager::SimulatedNetworkNode::Builder::allow_reordering() {
+ config_.allow_reordering = true;
+ return *this;
+}
+
+NetworkEmulationManager::SimulatedNetworkNode::Builder&
+NetworkEmulationManager::SimulatedNetworkNode::Builder::avg_burst_loss_length(
+ int avg_burst_loss_length) {
+ config_.avg_burst_loss_length = avg_burst_loss_length;
+ return *this;
+}
+
+NetworkEmulationManager::SimulatedNetworkNode::Builder&
+NetworkEmulationManager::SimulatedNetworkNode::Builder::packet_overhead(
+ int packet_overhead) {
+ config_.packet_overhead = packet_overhead;
+ return *this;
+}
+
NetworkEmulationManager::SimulatedNetworkNode
NetworkEmulationManager::SimulatedNetworkNode::Builder::Build(
uint64_t random_seed) const {
diff --git a/api/test/network_emulation_manager.h b/api/test/network_emulation_manager.h
index bc9279d..6b66d81 100644
--- a/api/test/network_emulation_manager.h
+++ b/api/test/network_emulation_manager.h
@@ -184,6 +184,10 @@
Builder& capacity_Mbps(int link_capacity_Mbps);
Builder& loss(double loss_rate);
Builder& packet_queue_length(int max_queue_length_in_packets);
+ Builder& delay_standard_deviation_ms(int delay_standard_deviation_ms);
+ Builder& allow_reordering();
+ Builder& avg_burst_loss_length(int avg_burst_loss_length);
+ Builder& packet_overhead(int packet_overhead);
SimulatedNetworkNode Build(uint64_t random_seed = 1) const;
SimulatedNetworkNode Build(NetworkEmulationManager* net,
uint64_t random_seed = 1) const;