Loading...
Searching...
No Matches
benchmark_udp.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2021 ML!PA Consulting GmbH
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
18
19#include <stdbool.h>
20#include <stdint.h>
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
29#ifndef BENCH_PAYLOAD_SIZE_MAX
30#define BENCH_PAYLOAD_SIZE_MAX (1024)
31#endif
32
36#ifndef BENCH_SERVER_DEFAULT
37#define BENCH_SERVER_DEFAULT "fd00:dead:beef::1"
38#endif
39
43#ifndef BENCH_PORT_DEFAULT
44#define BENCH_PORT_DEFAULT (12345)
45#endif
46
50#define BENCH_FLAG_CMD_PKT (1 << 0)
51
55#define BENCH_MASK_COOKIE (0xFFFFFF00)
56
62typedef struct {
63 uint32_t flags;
64 uint32_t seq_no;
65 uint32_t replies;
66 uint32_t rtt_last;
67 uint8_t payload[];
69
70
76typedef struct {
77 uint32_t flags;
78 uint32_t delay_us;
79 uint16_t payload_len;
81
82
94int benchmark_udp_start(const char *server, uint16_t port);
95
103
104#ifdef __cplusplus
105}
106#endif
107
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
uint8_t payload[]
variable length payload
uint32_t flags
must include config cookie
uint32_t rtt_last
round trip time of the last packet