Commit 7283168f authored by Cedric Roux's avatar Cedric Roux

-l option renamed -r, it's more "natural"

plus there is a default now
parent 624aba07
...@@ -9,6 +9,9 @@ ...@@ -9,6 +9,9 @@
#include <fcntl.h> #include <fcntl.h>
#include <pthread.h> #include <pthread.h>
#define DEFAULT_REMOTE_IP "127.0.0.1"
#define DEFAULT_REMOTE_PORT 2021
#include "defs.h" #include "defs.h"
#include "../T_defs.h" #include "../T_defs.h"
...@@ -94,7 +97,9 @@ void usage(void) ...@@ -94,7 +97,9 @@ void usage(void)
printf( printf(
"tracer - local side\n" "tracer - local side\n"
"options:\n" "options:\n"
" -l <IP address> <port> local side (forwards packets to remote IP:port)\n" " -r <IP address> <port> forwards packets to remote IP:port\n"
" (default %s:%d)\n",
DEFAULT_REMOTE_IP, DEFAULT_REMOTE_PORT
); );
exit(1); exit(1);
} }
...@@ -103,8 +108,8 @@ int main(int n, char **v) ...@@ -103,8 +108,8 @@ int main(int n, char **v)
{ {
int s; int s;
int i; int i;
char *remote_ip = NULL; char *remote_ip = DEFAULT_REMOTE_IP;
int remote_port = -1; int remote_port = DEFAULT_REMOTE_PORT;
int port = 2020; int port = 2020;
void *f; void *f;
...@@ -116,8 +121,6 @@ int main(int n, char **v) ...@@ -116,8 +121,6 @@ int main(int n, char **v)
usage(); usage();
} }
if (remote_port == -1 || remote_ip == NULL) usage();
f = forwarder(remote_ip, remote_port); f = forwarder(remote_ip, remote_port);
init_shm(); init_shm();
s = get_connection("127.0.0.1", port); s = get_connection("127.0.0.1", port);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment