Flowgrind
Advanced TCP traffic generator
fg_socket.h
Go to the documentation of this file.
1 
6 /*
7  * Copyright (C) 2010-2013 Christian Samsel <christian.samsel@rwth-aachen.de>
8  * Copyright (C) 2009 Tim Kosse <tim.kosse@gmx.de>
9  * Copyright (C) 2007-2008 Daniel Schaffrath <daniel.schaffrath@mac.com>
10  *
11  * This file is part of Flowgrind.
12  *
13  * Flowgrind is free software: you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation, either version 3 of the License, or
16  * (at your option) any later version.
17  *
18  * Flowgrind is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with Flowgrind. If not, see <http://www.gnu.org/licenses/>.
25  *
26  */
27 
28 #ifndef _FG_SOCKET_H_
29 #define _FG_SOCKET_H_
30 
31 #ifdef HAVE_CONFIG_H
32 #include "config.h"
33 #endif /* HAVE_CONFIG_H */
34 
35 #include <netinet/tcp.h>
36 #include <sys/socket.h>
37 
38 int set_congestion_control(int fd, const char *cc_alg);
39 int set_so_debug(int fd);
40 int set_keepalive(int fd, int how);
41 int set_nodelay(int fd);
42 int set_non_blocking (int fd);
43 int set_route_record(int fd);
44 int set_so_dscp(int fd, uint8_t);
45 int set_so_elcn(int fd, int val);
46 int set_so_lcd(int fd);
47 int set_tcp_mtcp(int fd);
48 int set_tcp_nodelay(int fd);
49 int set_dscp(int fd, int dscp);
50 int set_tcp_cork(int fd);
51 int toggle_tcp_cork(int fd);
52 int set_window_size(int, int);
53 int set_window_size_directed(int, int, int);
54 
55 int set_ip_mtu_discover(int fd);
56 int get_pmtu(int fd);
57 int get_imtu(int fd);
58 
59 const char *fg_nameinfo(const struct sockaddr *sa, socklen_t salen);
60 char sockaddr_compare(const struct sockaddr *a, const struct sockaddr *b);
61 
62 int get_port(int fd);
63 
64 #endif /* _FG_SOCKET_H_ */
int set_so_dscp(int fd, uint8_t)
int set_tcp_cork(int fd)
Definition: fg_socket.c:317
int get_pmtu(int fd)
Definition: fg_socket.c:193
int set_congestion_control(int fd, const char *cc_alg)
Definition: fg_socket.c:265
int toggle_tcp_cork(int fd)
Definition: fg_socket.c:331
int set_window_size(int, int)
Definition: fg_socket.c:117
int set_non_blocking(int fd)
Definition: fg_socket.c:172
int set_window_size_directed(int, int, int)
Definition: fg_socket.c:78
int set_nodelay(int fd)
Definition: fg_socket.c:184
int set_ip_mtu_discover(int fd)
Definition: fg_socket.c:300
const char * fg_nameinfo(const struct sockaddr *sa, socklen_t salen)
Definition: fg_socket.c:374
int set_keepalive(int fd, int how)
Definition: fg_socket.c:258
int set_so_lcd(int fd)
Definition: fg_socket.c:288
int set_tcp_nodelay(int fd)
Definition: fg_socket.c:358
int set_so_elcn(int fd, int val)
Definition: fg_socket.c:278
int get_imtu(int fd)
Definition: fg_socket.c:214
int set_dscp(int fd, int dscp)
Definition: fg_socket.c:132
int set_tcp_mtcp(int fd)
Definition: fg_socket.c:347
int set_route_record(int fd)
Definition: fg_socket.c:149
int set_so_debug(int fd)
Definition: fg_socket.c:366
char sockaddr_compare(const struct sockaddr *a, const struct sockaddr *b)
Definition: fg_socket.c:389
int get_port(int fd)
Definition: fg_socket.c:441