Flowgrind
Advanced TCP traffic generator
flowgrind.h
Go to the documentation of this file.
1 
6 /*
7  * Copyright (C) 2013-2014 Alexander Zimmermann <alexander.zimmermann@netapp.com>
8  * Copyright (C) 2010-2013 Arnd Hannemann <arnd@arndnet.de>
9  * Copyright (C) 2010-2013 Christian Samsel <christian.samsel@rwth-aachen.de>
10  * Copyright (C) 2009 Tim Kosse <tim.kosse@gmx.de>
11  * Copyright (C) 2007-2008 Daniel Schaffrath <daniel.schaffrath@mac.com>
12  *
13  * This file is part of Flowgrind.
14  *
15  * Flowgrind is free software: you can redistribute it and/or modify
16  * it under the terms of the GNU General Public License as published by
17  * the Free Software Foundation, either version 3 of the License, or
18  * (at your option) any later version.
19  *
20  * Flowgrind is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23  * GNU General Public License for more details.
24  *
25  * You should have received a copy of the GNU General Public License
26  * along with Flowgrind. If not, see <http://www.gnu.org/licenses/>.
27  *
28  */
29 
30 #ifndef _FLOWGRIND_H_
31 #define _FLOWGRIND_H_
32 
33 #ifdef HAVE_CONFIG_H
34 #include "config.h"
35 #endif /* HAVE_CONFIG_H */
36 
37 #include <stdbool.h>
38 #include <limits.h>
39 
40 #include "common.h"
41 #include "fg_list.h"
42 
44 #define GUARDBAND 2
45 
47 #define MAX_COLUM_TOO_LARGE 5
48 
50 #define MAX_REPORTS_IN_ROW 25
51 
53 enum protocol_t {
55  PROTO_TCP = 1,
58 };
59 
61 enum os_t {
63  LINUX = 0,
70 };
71 
78 };
79 
80 #ifndef HAVE_TCP_CA_STATE
81 
82 enum tcp_ca_state {
84  TCP_CA_Open = 0,
86  TCP_CA_Disorder = 1,
88  TCP_CA_CWR = 2,
90  TCP_CA_Recovery = 3,
92  TCP_CA_Loss = 4,
93 };
94 #endif /* HAVE_TCP_CA_STATE */
95 
97 enum column_id {
139 #ifdef DEBUG
140 
142 #endif /* DEBUG */
143 
145 };
146 
148 enum option_t {
157 };
158 
169 };
170 
174  LOG_FILE_OPTION = CHAR_MAX + 1,
175 };
176 
180  unsigned short num_flows;
188  const char *dump_prefix;
190  bool clobber;
192  bool mbyte;
194  bool symbolic;
197 };
198 
200 struct daemon {
201 /* Note: a daemon can potentially managing multiple flows */
203  char uuid[38];
207  char os_name[257];
209  char os_release[257];
211  char *url;
212 };
213 
215 struct rpc_info {
217  char server_url[1000];
219  char server_name[257];
221  unsigned short server_port;
222 };
223 
233  struct daemon* daemon;
235  char test_address[1000];
236 };
237 
239 struct cflow {
241  enum protocol_t proto;
242 
243  /* TODO Some of this flow option members are duplicates from the
244  * _flow_settings struct (see common.h). Flowgrind contoller
245  * should use this one */
246 
250  char shutdown;
256  unsigned random_seed;
257 
258  /* For the following arrays: 0 stands for source; 1 for destination */
259 
261  int endpoint_id[2];
263  struct timespec start_timestamp[2];
265  struct flow_endpoint endpoint[2];
267  struct flow_settings settings[2];
269  char finished[2];
271  struct report *final_report[2];
272 };
273 
277  const char* name;
279  const char* unit;
280 };
281 
283 struct column_state {
285  bool visible;
287  unsigned oversized;
289  size_t last_width;
290 };
291 
293 struct column {
295  enum column_id type;
297  struct column_header header;
299  struct column_state state;
300 };
301 
302 #endif /* _FLOWGRIND_H_ */
Number of elements in enum.
Definition: flowgrind.h:144
bool clobber
Overwrite existing log files (option -o).
Definition: flowgrind.h:190
Infos about a flowgrind daemon.
Definition: flowgrind.h:200
Infos about the flow including flow options.
Definition: flowgrind.h:239
Metric from the Linux / BSD TCP stack.
Definition: flowgrind.h:126
Metric from the Linux / BSD TCP stack.
Definition: flowgrind.h:135
bool mbyte
Report in MByte/s instead of MBit/s (option -m).
Definition: flowgrind.h:192
unsigned random_seed
Random seed for stochastic traffic generation (option -J).
Definition: flowgrind.h:256
Metric from the Linux / BSD TCP stack.
Definition: flowgrind.h:138
Report interval.
Definition: flowgrind.h:102
Metric from the Linux / BSD TCP stack.
Definition: flowgrind.h:130
struct rpc_info * rpc_info
Pointer to manage flow endpoint XMLRPC information.
Definition: flowgrind.h:231
Metric from the Linux / BSD TCP stack.
Definition: flowgrind.h:134
tcp_stack_t
Unit of the TCP Stack.
Definition: flowgrind.h:73
Flow option without endpoint string.
Definition: flowgrind.h:154
Linux is a segment-based stack.
Definition: flowgrind.h:75
option_t
Option types in flowgrind controller.
Definition: flowgrind.h:148
bool log_to_stdout
Write output to screen (option -q).
Definition: flowgrind.h:184
Metric from the Linux / BSD TCP stack.
Definition: flowgrind.h:132
protocol_t
Transport protocols.
Definition: flowgrind.h:53
struct daemon * daemon
Pointer to manage flow endpoint daemon.
Definition: flowgrind.h:233
char shutdown
shutdown() each socket direction after test flow (option (-N).
Definition: flowgrind.h:250
Context for flow options on source side.
Definition: flowgrind.h:166
Metric from the Linux / BSD TCP stack.
Definition: flowgrind.h:133
size_t last_width
Last width of the column.
Definition: flowgrind.h:289
Infos about the flow endpoint.
Definition: flowgrind.h:225
const char * unit
Second header row: unit of the column.
Definition: flowgrind.h:279
User Datagram Protocol.
Definition: flowgrind.h:57
Apple OS X.
Definition: flowgrind.h:67
char byte_counting
Enumerate bytes in payload instead of sending zeros (option -E).
Definition: flowgrind.h:254
unsigned short server_port
Port of the XMLRPC server.
Definition: flowgrind.h:221
Metric from the Linux / BSD TCP stack.
Definition: flowgrind.h:125
Definition: common.h:286
Metric from the Linux / BSD TCP stack.
Definition: flowgrind.h:136
Application level round-trip time.
Definition: flowgrind.h:113
char summarize_only
Summarize only, no intermediated interval reports (option -Q).
Definition: flowgrind.h:252
Context for controller options.
Definition: flowgrind.h:162
Application level one-way delay.
Definition: flowgrind.h:119
Throughput per seconds.
Definition: flowgrind.h:104
Number of elements in enum.
Definition: flowgrind.h:69
Application level round-trip time.
Definition: flowgrind.h:112
mutex_context_t
Mutual exclusion contexts for options.
Definition: flowgrind.h:160
Linux.
Definition: flowgrind.h:63
Transactions per second.
Definition: flowgrind.h:106
General controller options.
Definition: flowgrind.h:150
Transmission Control Protocol.
Definition: flowgrind.h:55
Infos about a flowgrind daemon and daemon-controller connection.
Definition: flowgrind.h:215
FreeBSD.
Definition: flowgrind.h:65
Flow option with endpoint string.
Definition: flowgrind.h:156
int send_buffer_size_real
Sending buffer (SO_SNDBUF).
Definition: flowgrind.h:227
bool symbolic
Don&#39;t use symbolic values instead of number (option -p).
Definition: flowgrind.h:194
double reporting_interval
Length of reporting interval, in seconds (option -i).
Definition: flowgrind.h:182
Metric from the Linux / BSD TCP stack.
Definition: flowgrind.h:128
Pseudo short option for option –log-file.
Definition: flowgrind.h:174
Metric from the Linux / BSD TCP stack.
Definition: flowgrind.h:127
Application level inter-arrival time.
Definition: flowgrind.h:117
Controller options.
Definition: flowgrind.h:178
Blocks per second.
Definition: flowgrind.h:109
long_opt_only
For long options with no equivalent short option, use pseudo short option.
Definition: flowgrind.h:172
FreeBSD and OS X stack is a bytes-based stack.
Definition: flowgrind.h:77
unsigned short num_flows
Number of test flows (option -n).
Definition: flowgrind.h:180
unsigned oversized
How often the current column width was too high.
Definition: flowgrind.h:287
const char * name
First header row: name of the column.
Definition: flowgrind.h:277
Metric from the Linux / BSD TCP stack.
Definition: flowgrind.h:124
int receive_buffer_size_real
Receiver buffer (SO_RCVBUF).
Definition: flowgrind.h:229
char * url
Pointer to daemon XMLPRC URL.
Definition: flowgrind.h:211
Application level round-trip time.
Definition: flowgrind.h:111
Metric from the Linux / BSD TCP stack.
Definition: flowgrind.h:123
Report interval.
Definition: flowgrind.h:101
Application level one-way delay.
Definition: flowgrind.h:121
os_t
Supported operating systems.
Definition: flowgrind.h:61
Flow ID.
Definition: flowgrind.h:99
column_id
IDs to explicit address an intermediated interval report column.
Definition: flowgrind.h:97
bool log_to_file
Write output to logfile (option -w).
Definition: flowgrind.h:186
Data structures used by the Flowgrind daemon and controller.
Metric from the Linux / BSD TCP stack.
Definition: flowgrind.h:131
Intermediated interval report column.
Definition: flowgrind.h:293
enum tcp_stack_t force_unit
Force kernel output to specific unit (option -s).
Definition: flowgrind.h:196
Context for flow options on destination side.
Definition: flowgrind.h:168
Application level inter-arrival time.
Definition: flowgrind.h:116
Blocks per second.
Definition: flowgrind.h:108
Selects a subset of flows to apply options to (-F).
Definition: flowgrind.h:152
const char * dump_prefix
Prefix for dumpfile (option -e).
Definition: flowgrind.h:188
Metric from the Linux / BSD TCP stack.
Definition: flowgrind.h:129
Generic doubly linked list implementation.
Metric from the Linux / BSD TCP stack.
Definition: flowgrind.h:137
Header of an intermediated interval report column.
Definition: flowgrind.h:275
Context for flow options for both endpoints.
Definition: flowgrind.h:164
int api_version
Flowgrind API version supported by this daemon.
Definition: flowgrind.h:205
State of an intermediated interval report column.
Definition: flowgrind.h:283
bool visible
Dynamically turn an column on/off.
Definition: flowgrind.h:285
Application level one-way delay.
Definition: flowgrind.h:120
char late_connect
Call connect() immediately before sending data (option -L).
Definition: flowgrind.h:248
Application level inter-arrival time.
Definition: flowgrind.h:115
Settings that describe a flow between from a endpoint&#39;s perspective.
Definition: common.h:181
Read / write status.
Definition: flowgrind.h:141