 |
Flowgrind
Advanced TCP traffic generator
|
Routines used to setup a Flowgrind destination for a test.
More...
Go to the source code of this file.
Routines used to setup a Flowgrind destination for a test.
Definition in file destination.h.
◆ accept_data()
int accept_data |
( |
struct flow * |
flow | ) |
|
- Bug:
- : currently we use portable select() API, which is limited by the number of bits in an fd_set
Definition at line 250 of file destination.c.
252 struct sockaddr_storage caddr;
253 socklen_t addrlen =
sizeof(caddr);
254 unsigned real_send_buffer_size;
255 unsigned real_receive_buffer_size;
261 if (errno == EINTR || errno == EAGAIN)
263 logging(LOG_ALERT,
"accept() failed: %s", strerror(errno));
269 if (
flow->
fd >= FD_SETSIZE) {
270 logging(LOG_ALERT,
"too many file descriptors are "
271 "already in use by this daemon (FD number=%u)",
flow->
fd);
273 "file descriptors in use by this daemon");
279 logging(LOG_WARNING,
"close() failed");
282 logging(LOG_NOTICE,
"client %s connected for testing (fd=%u)",
289 real_send_buffer_size =
295 logging(LOG_WARNING,
"failed to set send buffer size of test "
296 "socket to send buffer size size of listen socket "
297 "(listen = %u, test = %u)",
301 real_receive_buffer_size =
307 logging(LOG_WARNING,
"failed to set receive buffer size "
308 "(advertised window) of test socket to receive "
309 "buffer size of listen socket (listen = %u, "
311 real_receive_buffer_size);
316 DEBUG_MSG(LOG_NOTICE,
"data socket accepted");
◆ add_flow_destination()
To set daemon flow as destination endpoint.
To set the flow options and settings as destination endpoint. Listening port created and send back to the controller in the same request structure
- Parameters
-
[in,out] | request | contain the test option and parameter for destination source endpoint |
- Bug:
- : currently we use portable select() API, which is limited by the number of bits in an fd_set
Definition at line 158 of file destination.c.
161 unsigned short server_data_port;
164 logging(LOG_WARNING,
"can not accept another flow, already "
173 logging(LOG_ALERT,
"could not allocate memory for flow");
185 logging(LOG_ALERT,
"could not allocate memory for read/write "
188 "for read/write blocks");
198 (
unsigned char)(byte_idx & 0xff);
206 &server_data_port)) == -1) {
207 logging(LOG_ALERT,
"could not create listen socket for "
217 logging(LOG_ALERT,
"failed to add listen socket: "
220 "file descriptors in use by this daemon");
224 DEBUG_MSG(LOG_WARNING,
"listening on %s port %u for data "
238 request->listen_data_port = (int)server_data_port;
239 request->real_listen_send_buffer_size =
241 request->real_listen_read_buffer_size =
#define DEBUG_MSG(LVL, MSG,...)
Print debug message to standard error.
size_t fg_list_size(struct linked_list *const list)
Returns the number of elements in the list.
void request_error(struct request *request, const char *fmt,...)
int requested_read_buffer_size
Request receiver buffer, advertised window in bytes (option -W).
int set_flow_tcp_options(struct flow *flow)
void logging(int priority, const char *fmt,...)
#define MAX_FLOWS_DAEMON
Maximal number of parallel flows supported by one daemon instance.
int byte_counting
Enumerate bytes in payload instead of sending zeros (option -E).
struct flow_settings settings
void init_flow(struct flow *flow, int is_source)
To initialize all flows to the default value.
int maximum_block_size
Application buffer size in bytes (option -U).
void fg_pcap_go(struct flow *flow)
Start a tcpdump to capture traffic of the provided flow.
int flow_id
Flow ID maintained by controller.
unsigned real_listen_receive_buffer_size
unsigned real_listen_send_buffer_size
void flow_error(struct flow *flow, const char *fmt,...)
int fg_list_push_back(struct linked_list *const list, void *const data)
Inserts a new element at the end of the list.
int set_window_size_directed(int fd, int window, int direction)
unsigned short requested_server_test_port
const char * fg_nameinfo(const struct sockaddr *sa, socklen_t salen)
void uninit_flow(struct flow *flow)
char bind_address[1000]
The interface address for the flow (used by daemon).
static int create_listen_socket(struct flow *flow, char *bind_addr, unsigned short *listen_port)
int requested_send_buffer_size
Request sender buffer in bytes (option -B).