 |
Flowgrind
Advanced TCP traffic generator
|
Routines used by Flowgrind to setup the source for a test flow.
More...
Go to the source code of this file.
Routines used by Flowgrind to setup the source for a test flow.
Definition in file source.h.
◆ add_flow_source()
To set daemon flow as source endpoint.
To set the flow options and settings as source endpoint. Depending upon the late connection option the data connection is established to connect the destination daemon listening port address with source daemon.
- Parameters
-
[in,out] | request | Contain the test option and parameter for daemon source endpoint |
Definition at line 177 of file source.c.
179 #ifdef HAVE_SO_TCP_CONGESTION
180 socklen_t opt_len = 0;
185 logging(LOG_WARNING,
"can not accept another flow, already "
188 "Can not accept another flow, already "
195 logging(LOG_ALERT,
"could not allocate memory for flow");
209 logging(LOG_ALERT,
"could not allocate memory for read/write "
228 logging(LOG_ALERT,
"could not create data socket: %s",
242 #ifdef HAVE_SO_TCP_CONGESTION
243 opt_len =
sizeof(
request->cc_alg);
244 if (getsockopt(
flow->
fd, IPPROTO_TCP, TCP_CONGESTION,
245 request->cc_alg, &opt_len) == -1) {
◆ do_connect()
int do_connect |
( |
struct flow * |
flow | ) |
|
Establishes a connection of a flow.
Establishes a connection to the destination daemon listening port, and marks the flow as connected.
- Parameters
-
[in,out] | flow | Flow to connect. |
Definition at line 153 of file source.c.
157 if (rc == -1 && errno != EINPROGRESS) {
160 err(
"failed to connect flow %u",
flow->
id);
#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).
char destination_host[256]
static int name2socket(struct flow *flow, char *server_name, unsigned port, struct sockaddr **saptr, socklen_t *lenp, const int read_buffer_size_req, int *read_buffer_size, const int send_buffer_size_req, int *send_buffer_size)
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.
struct flow_source_settings source_settings
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.
#define err(...)
To report an error w/ the corresponding system error message.
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.
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 do_connect(struct flow *flow)
Establishes a connection of a flow.
void uninit_flow(struct flow *flow)
int requested_send_buffer_size
Request sender buffer in bytes (option -B).