Loading...
Searching...
No Matches
benchmark_udp.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2021 ML!PA Consulting GmbH
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
7 */
8
20#ifndef TEST_UTILS_BENCHMARK_UDP_H
21#define TEST_UTILS_BENCHMARK_UDP_H
22
23#include <stdbool.h>
24#include <stdint.h>
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
33#ifndef BENCH_PAYLOAD_SIZE_MAX
34#define BENCH_PAYLOAD_SIZE_MAX (1024)
35#endif
36
40#ifndef BENCH_SERVER_DEFAULT
41#define BENCH_SERVER_DEFAULT "fd00:dead:beef::1"
42#endif
43
47#ifndef BENCH_PORT_DEFAULT
48#define BENCH_PORT_DEFAULT (12345)
49#endif
50
54#define BENCH_FLAG_CMD_PKT (1 << 0)
55
59#define BENCH_MASK_COOKIE (0xFFFFFF00)
60
66typedef struct {
67 uint32_t flags;
68 uint32_t seq_no;
69 uint32_t replies;
70 uint32_t rtt_last;
71 uint8_t payload[];
80typedef struct {
81 uint32_t flags;
82 uint32_t delay_us;
83 uint16_t payload_len;
98int benchmark_udp_start(const char *server, uint16_t port);
99
107
108#ifdef __cplusplus
109}
110#endif
111
112#endif /* TEST_UTILS_BENCHMARK_UDP_H */
bool benchmark_udp_stop(void)
Stop the benchmark process.
int benchmark_udp_start(const char *server, uint16_t port)
This will start the benchmark process.
Command response from the server.
uint32_t delay_us
delay between benchmark messages in µs
uint16_t payload_len
payload of benchmark messages
uint32_t flags
contains new config cookie
Benchmark message to the server.
uint32_t replies
number of replies received from server
uint32_t seq_no
number of packets sent sind config update
uint32_t flags
must include config cookie
uint32_t rtt_last
round trip time of the last packet