-l option renamed -r, it's more "natural"
plus there is a default now
This commit is contained in:
@@ -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)
|
|||||||
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)
|
|||||||
{
|
{
|
||||||
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)
|
|||||||
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);
|
||||||
|
|||||||
Reference in New Issue
Block a user