program to send via WLAN as much as possible (to test physical/theoretical throughput)
More...
Go to the source code of this file.
|
int | main (int argc, char *argv[]) |
|
program to send via WLAN as much as possible (to test physical/theoretical throughput)
- Author
- David Brodski
Definition in file gnunet-transport-wlan-receiver.c.
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 31 of file gnunet-transport-wlan-receiver.c.
34 unsigned long long count;
45 "This program must be started with the interface name as argument.\n");
47 "Usage: %s interface-name\n"
57 fprintf (stderr,
"Failed to create pipe: %s\n", strerror (errno));
62 if ((
pid = fork ()) == -1)
64 fprintf (stderr,
"Failed to fork: %s\n", strerror (errno));
71 if (0 != close (commpipe[1]))
72 fprintf (stderr,
"Failed to close fd: %s\n", strerror (errno));
77 ret = read (commpipe[0], msg_buf,
sizeof(msg_buf));
80 fprintf (stderr,
"read failed: %s\n", strerror (errno));
87 bytes_per_s = count / (akt -
start);
89 printf (
"recv %f kb/s\n", bytes_per_s);
100 dup2 (commpipe[1], 1))
101 fprintf (stderr,
"dup2 failed: %s\n", strerror (errno));
102 (void) close (commpipe[0]);
104 if (execlp (
"gnunet-helper-transport-wlan",
105 "gnunet-helper-transport-wlan",
109 fprintf (stderr,
"Could not start gnunet-helper-transport-wlan!");
static int ret
Return value of the commandline.
static int start
Set if we are to start default services (including ARM).
static struct GNUNET_PeerIdentity pid
Identity of the peer we transmit to / connect to.
References pid, ret, and start.