Flowgrind
Advanced TCP traffic generator
common.h File Reference

Data structures used by the Flowgrind daemon and controller. More...

#include "config.h"
#include <sys/time.h>
#include <time.h>
#include <stdint.h>
#include "gitversion.h"

Go to the source code of this file.

Data Structures

struct  block
 Flowgrind's data block layout. More...
 
struct  flow_settings::extra_socket_options
 
struct  fg_tcp_info
 
struct  flow_settings
 Settings that describe a flow between from a endpoint's perspective. More...
 
struct  report
 
struct  trafgen_options
 Options for stochastic traffic generation. More...
 

Macros

#define DEFAULT_LISTEN_PORT   5999
 Daemon's default listen port. More...
 
#define FLOWGRIND_API_VERSION   3
 XML-RPC API version in integer representation. More...
 
#define FLOWGRIND_AUTHORS
 Flowgrind's authors in a printable string. More...
 
#define FLOWGRIND_COPYING
 Standard GPL3 no warranty message. More...
 
#define FLOWGRIND_COPYRIGHT   "Copyright (C) 2007 - 2021 Flowgrind authors."
 Flowgrind's copyright year. More...
 
#define FLOWGRIND_VERSION   GITVERSION
 Flowgrind version number. More...
 
#define MAX_EXTRA_SOCKET_OPTION_VALUE_LENGTH   100
 Ensures extra options are limited in length on both controller and deamon. More...
 
#define MAX_EXTRA_SOCKET_OPTIONS   10
 Max number of arbitrary extra socket options which may sent to the deamon. More...
 
#define MAX_FLOWS_CONTROLLER   2048
 Maximal number of parallel flows supported by one controller. More...
 
#define MAX_FLOWS_DAEMON   FD_SETSIZE >> 1
 Maximal number of parallel flows supported by one daemon instance. More...
 
#define MIN_BLOCK_SIZE   (signed) sizeof (struct block)
 Minium block (message) size we can send. More...
 
#define TCP_CA_NAME_MAX   16
 Max size of the congestion control algorithm specifier string. More...
 

Enumerations

enum  distribution_t {
  CONSTANT = 0, NORMAL, WEIBULL, UNIFORM,
  EXPONENTIAL, PARETO, LOGNORMAL
}
 Stochastic distributions for traffic generation. More...
 
enum  endpoint_t { SOURCE = 0, DESTINATION }
 Flow endpoint types. More...
 
enum  extra_socket_option_level {
  level_sol_socket, level_sol_tcp, level_ipproto_ip, level_ipproto_sctp,
  level_ipproto_tcp, level_ipproto_udp
}
 
enum  io_t { WRITE = 0, READ }
 I/O operation types. More...
 
enum  report_t { INTERVAL = 0, FINAL }
 Report types. More...
 

Detailed Description

Data structures used by the Flowgrind daemon and controller.

Definition in file common.h.

Macro Definition Documentation

◆ DEFAULT_LISTEN_PORT

#define DEFAULT_LISTEN_PORT   5999

Daemon's default listen port.

Definition at line 55 of file common.h.

◆ FLOWGRIND_API_VERSION

#define FLOWGRIND_API_VERSION   3

XML-RPC API version in integer representation.

Definition at line 52 of file common.h.

◆ FLOWGRIND_AUTHORS

#define FLOWGRIND_AUTHORS
Value:
"Written by Arnd Hannemann, Tim Kosse, Christian Samsel, Daniel Schaffrath\n" \
"and Alexander Zimmermann."

Flowgrind's authors in a printable string.

Definition at line 91 of file common.h.

◆ FLOWGRIND_COPYING

#define FLOWGRIND_COPYING
Value:
"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.\n" \
"This is free software: you are free to change and redistribute it.\n" \
"There is NO WARRANTY, to the extent permitted by law."

Standard GPL3 no warranty message.

Definition at line 85 of file common.h.

◆ FLOWGRIND_COPYRIGHT

#define FLOWGRIND_COPYRIGHT   "Copyright (C) 2007 - 2021 Flowgrind authors."

Flowgrind's copyright year.

Definition at line 82 of file common.h.

◆ FLOWGRIND_VERSION

#define FLOWGRIND_VERSION   GITVERSION

Flowgrind version number.

Definition at line 44 of file common.h.

◆ MAX_EXTRA_SOCKET_OPTION_VALUE_LENGTH

#define MAX_EXTRA_SOCKET_OPTION_VALUE_LENGTH   100

Ensures extra options are limited in length on both controller and deamon.

Definition at line 71 of file common.h.

◆ MAX_EXTRA_SOCKET_OPTIONS

#define MAX_EXTRA_SOCKET_OPTIONS   10

Max number of arbitrary extra socket options which may sent to the deamon.

Definition at line 68 of file common.h.

◆ MAX_FLOWS_CONTROLLER

#define MAX_FLOWS_CONTROLLER   2048

Maximal number of parallel flows supported by one controller.

Definition at line 58 of file common.h.

◆ MAX_FLOWS_DAEMON

#define MAX_FLOWS_DAEMON   FD_SETSIZE >> 1

Maximal number of parallel flows supported by one daemon instance.

This is currenty limited by the file descriptor number which can be added to an fd_set. As we currently may need up to two FDs per destination, we limit this to half of FD_SETSIZE.

Definition at line 65 of file common.h.

◆ MIN_BLOCK_SIZE

#define MIN_BLOCK_SIZE   (signed) sizeof (struct block)

Minium block (message) size we can send.

Definition at line 79 of file common.h.

◆ TCP_CA_NAME_MAX

#define TCP_CA_NAME_MAX   16

Max size of the congestion control algorithm specifier string.

Definition at line 75 of file common.h.

Enumeration Type Documentation

◆ distribution_t

Stochastic distributions for traffic generation.

Enumerator
CONSTANT 

No stochastic distribution.

NORMAL 

Normal distribution.

WEIBULL 

Weibull distribution.

UNIFORM 

Uniform distribution.

EXPONENTIAL 

Exponential distribution.

PARETO 

Pareto distribution.

LOGNORMAL 

Log Normal distribution.

Definition at line 130 of file common.h.

130  {
132  CONSTANT = 0,
134  NORMAL,
136  WEIBULL,
138  UNIFORM,
140  EXPONENTIAL,
142  PARETO,
144  LOGNORMAL,
145 };

◆ endpoint_t

enum endpoint_t

Flow endpoint types.

Enumerator
SOURCE 

Endpoint that opens the connection.

DESTINATION 

Endpoint that accepts the connection.

Definition at line 96 of file common.h.

96  {
98  SOURCE = 0,
100  DESTINATION,
101 };

◆ extra_socket_option_level

Enumerator
level_sol_socket 
level_sol_tcp 
level_ipproto_ip 
level_ipproto_sctp 
level_ipproto_tcp 
level_ipproto_udp 

Definition at line 120 of file common.h.

120  {
127 };

◆ io_t

enum io_t

I/O operation types.

Enumerator
WRITE 

Write operation.

READ 

Read operation.

Definition at line 104 of file common.h.

104  {
106  WRITE = 0,
108  READ,
109 };

◆ report_t

enum report_t

Report types.

Enumerator
INTERVAL 

Intermediated interval report.

FINAL 

Final report.

Definition at line 112 of file common.h.

112  {
114  INTERVAL = 0,
116  FINAL,
117 };
UNIFORM
@ UNIFORM
Uniform distribution.
Definition: common.h:138
FINAL
@ FINAL
Final report.
Definition: common.h:116
level_sol_socket
@ level_sol_socket
Definition: common.h:121
INTERVAL
@ INTERVAL
Intermediated interval report.
Definition: common.h:114
WRITE
@ WRITE
Write operation.
Definition: common.h:106
level_ipproto_udp
@ level_ipproto_udp
Definition: common.h:126
READ
@ READ
Read operation.
Definition: common.h:108
DESTINATION
@ DESTINATION
Endpoint that accepts the connection.
Definition: common.h:100
PARETO
@ PARETO
Pareto distribution.
Definition: common.h:142
LOGNORMAL
@ LOGNORMAL
Log Normal distribution.
Definition: common.h:144
CONSTANT
@ CONSTANT
No stochastic distribution.
Definition: common.h:132
WEIBULL
@ WEIBULL
Weibull distribution.
Definition: common.h:136
SOURCE
@ SOURCE
Endpoint that opens the connection.
Definition: common.h:98
EXPONENTIAL
@ EXPONENTIAL
Exponential distribution.
Definition: common.h:140
level_ipproto_ip
@ level_ipproto_ip
Definition: common.h:123
level_ipproto_sctp
@ level_ipproto_sctp
Definition: common.h:124
level_sol_tcp
@ level_sol_tcp
Definition: common.h:122
NORMAL
@ NORMAL
Normal distribution.
Definition: common.h:134
level_ipproto_tcp
@ level_ipproto_tcp
Definition: common.h:125