2019-10-07 16:19:00 +02:00
|
|
|
/* SPDX-License-Identifier: LGPL-2.1+
|
|
|
|
* Copyright © 2019 VMware, Inc. */
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "sd-netlink.h"
|
|
|
|
|
|
|
|
#include "conf-parser.h"
|
2019-10-30 09:02:15 +01:00
|
|
|
#include "networkd-link.h"
|
2019-10-07 16:19:00 +02:00
|
|
|
#include "time-util.h"
|
|
|
|
|
2019-10-30 09:02:15 +01:00
|
|
|
typedef struct NetworkEmulator {
|
2019-10-07 16:19:00 +02:00
|
|
|
usec_t delay;
|
|
|
|
usec_t jitter;
|
|
|
|
|
|
|
|
uint32_t limit;
|
|
|
|
uint32_t loss;
|
2019-10-30 18:58:02 +01:00
|
|
|
uint32_t duplicate;
|
2019-10-30 09:02:15 +01:00
|
|
|
} NetworkEmulator;
|
2019-10-07 16:19:00 +02:00
|
|
|
|
|
|
|
int network_emulator_new(NetworkEmulator **ret);
|
2019-11-25 15:13:54 +01:00
|
|
|
int network_emulator_fill_message(Link *link, const NetworkEmulator *ne, sd_netlink_message *req);
|
2019-10-07 16:19:00 +02:00
|
|
|
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_tc_network_emulator_delay);
|
2019-10-30 18:58:02 +01:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_tc_network_emulator_rate);
|
2019-10-07 16:19:00 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_tc_network_emulator_packet_limit);
|