Loading...
Searching...
No Matches
UDP benchmark

Detailed Description

Files

file  benchmark_udp.h
 Continuously send UDP packets with configurable size and interval.
 

Data Structures

struct  benchmark_msg_ping_t
 Benchmark message to the server. More...
 
struct  benchmark_msg_cmd_t
 Command response from the server. More...
 

Macros

#define BENCH_PAYLOAD_SIZE_MAX   (1024)
 Maximum size of a benchmark packet.
 
#define BENCH_SERVER_DEFAULT   "fd00:dead:beef::1"
 Default address of the benchmark server.
 
#define BENCH_PORT_DEFAULT   (12345)
 Default port of the benchmark server.
 
#define BENCH_FLAG_CMD_PKT   (1 << 0)
 Flag indicating the benchmark packet is a configuration command.
 
#define BENCH_MASK_COOKIE   (0xFFFFFF00)
 Configuration Cookie mask.
 

Functions

int benchmark_udp_start (const char *server, uint16_t port)
 This will start the benchmark process.
 
bool benchmark_udp_stop (void)
 Stop the benchmark process.
 

Macro Definition Documentation

◆ BENCH_FLAG_CMD_PKT

#define BENCH_FLAG_CMD_PKT   (1 << 0)

Flag indicating the benchmark packet is a configuration command.

Definition at line 54 of file benchmark_udp.h.

◆ BENCH_MASK_COOKIE

#define BENCH_MASK_COOKIE   (0xFFFFFF00)

Configuration Cookie mask.

Definition at line 59 of file benchmark_udp.h.

◆ BENCH_PAYLOAD_SIZE_MAX

#define BENCH_PAYLOAD_SIZE_MAX   (1024)

Maximum size of a benchmark packet.

Definition at line 34 of file benchmark_udp.h.

◆ BENCH_PORT_DEFAULT

#define BENCH_PORT_DEFAULT   (12345)

Default port of the benchmark server.

Definition at line 48 of file benchmark_udp.h.

◆ BENCH_SERVER_DEFAULT

#define BENCH_SERVER_DEFAULT   "fd00:dead:beef::1"

Default address of the benchmark server.

Definition at line 41 of file benchmark_udp.h.

Function Documentation

◆ benchmark_udp_start()

int benchmark_udp_start ( const char *  server,
uint16_t  port 
)

This will start the benchmark process.

Two threads will be spawned, one to send packets to the server and one to handle the response.

Parameters
[in]serverbenchmark server (address or hostname)
[in]portbenchmark server port
Returns
0 on success error otherwise

◆ benchmark_udp_stop()

bool benchmark_udp_stop ( void  )

Stop the benchmark process.

Returns
true if the benchmark process was stopped false if no benchmark process was running