Make server ip a commandline option
This commit is contained in:
parent
603132ce04
commit
d02520f6b1
|
@ -23,7 +23,7 @@
|
|||
|
||||
#define BUFSIZE 100
|
||||
#define PORT 2342
|
||||
#define SRV_IP "127.0.0.1"
|
||||
char *SRV_IP="127.0.0.1";
|
||||
|
||||
#define TYPE_UDP
|
||||
#undef TYPE_TCP
|
||||
|
@ -253,7 +253,7 @@ int main(int argc, char ** argv){
|
|||
time(&ot);
|
||||
|
||||
/* The big getopt loop */
|
||||
while ((c = getopt(argc, argv, "d:")) != EOF)
|
||||
while ((c = getopt(argc, argv, "s:d:")) != EOF)
|
||||
switch (c)
|
||||
{
|
||||
case 'd':
|
||||
|
@ -261,6 +261,11 @@ int main(int argc, char ** argv){
|
|||
strcpy(device,optarg);
|
||||
break;
|
||||
|
||||
case 's':
|
||||
SRV_IP=(char *)malloc(strlen(optarg)+2);
|
||||
strcpy(SRV_IP,optarg);
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr, "Usage: %s [options] \n\n\
|
||||
This program reads packets from an USB-Serial R0ket\n\
|
||||
|
|
Loading…
Reference in New Issue