#include "test/network/simulated_network.h"
#include <algorithm>
#include <cmath>
#include <cstdint>
#include <utility>
#include "absl/types/optional.h"
#include "api/test/simulated_network.h"
#include "api/units/data_rate.h"
#include "api/units/data_size.h"
#include "api/units/time_delta.h"
#include "api/units/timestamp.h"
#include "rtc_base/checks.h"
namespace webrtc {
namespace {
Timestamp CalculateArrivalTime(Timestamp start_time,
int64_t bits,
DataRate capacity) { … }
void UpdateLegacyConfiguration(SimulatedNetwork::Config& config) { … }
}
SimulatedNetwork::SimulatedNetwork(Config config, uint64_t random_seed)
: … { … }
SimulatedNetwork::~SimulatedNetwork() = default;
void SimulatedNetwork::SetConfig(const Config& config) { … }
void SimulatedNetwork::SetConfig(const BuiltInNetworkBehaviorConfig& new_config,
Timestamp config_update_time) { … }
void SimulatedNetwork::UpdateConfig(
std::function<void(BuiltInNetworkBehaviorConfig*)> config_modifier) { … }
void SimulatedNetwork::PauseTransmissionUntil(int64_t until_us) { … }
bool SimulatedNetwork::EnqueuePacket(PacketInFlightInfo packet) { … }
absl::optional<int64_t> SimulatedNetwork::NextDeliveryTimeUs() const { … }
void SimulatedNetwork::UpdateCapacityQueue(ConfigState state,
Timestamp time_now) { … }
SimulatedNetwork::ConfigState SimulatedNetwork::GetConfigState() const { … }
std::vector<PacketDeliveryInfo> SimulatedNetwork::DequeueDeliverablePackets(
int64_t receive_time_us) { … }
bool SimulatedNetwork::UpdateNextProcessTime() { … }
void SimulatedNetwork::RegisterDeliveryTimeChangedCallback(
absl::AnyInvocable<void()> callback) { … }
}