diff options
author | runge <runge> | 2005-03-05 01:06:05 +0000 |
---|---|---|
committer | runge <runge> | 2005-03-05 01:06:05 +0000 |
commit | b8b96689bf29ae1b2fca12a59be9196d6a2acb25 (patch) | |
tree | 040b06215c2d5141cf6a9a1bf4fe93524b7fcc43 /libvncserver/cargs.c | |
parent | 3c4522e67652d36162d007dce1dcd798562da5fb (diff) | |
download | libtdevnc-b8b96689bf29ae1b2fca12a59be9196d6a2acb25.tar.gz libtdevnc-b8b96689bf29ae1b2fca12a59be9196d6a2acb25.zip |
add '-listen ipaddr' option
Diffstat (limited to 'libvncserver/cargs.c')
-rw-r--r-- | libvncserver/cargs.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libvncserver/cargs.c b/libvncserver/cargs.c index 254f2ce..fbd3cc9 100644 --- a/libvncserver/cargs.c +++ b/libvncserver/cargs.c @@ -14,6 +14,8 @@ #include <rfb/rfb.h> +extern rfbStringToAddr(char *str, in_addr_t *iface); + void rfbUsage(void) { @@ -36,6 +38,8 @@ rfbUsage(void) fprintf(stderr, "-httpport portnum use portnum for http connection\n"); fprintf(stderr, "-enablehttpproxy enable http proxy support\n"); fprintf(stderr, "-progressive height enable progressive updating for slow links\n"); + fprintf(stderr, "-listen ipaddr listen for connections only on network interface with\n"); + fprintf(stderr, " addr ipaddr. '-listen localhost' and hostname work too.\n"); } /* purges COUNT arguments from ARGV at POSITION and decrements ARGC. @@ -125,6 +129,14 @@ rfbProcessArguments(rfbScreenInfoPtr rfbScreen,int* argc, char *argv[]) return FALSE; } rfbScreen->progressiveSliceHeight = atoi(argv[++i]); + } else if (strcmp(argv[i], "-listen") == 0) { /* -listen ipaddr */ + if (i + 1 >= *argc) { + rfbUsage(); + return FALSE; + } + if (! rfbStringToAddr(argv[++i], &(rfbScreen->listenInterface))) { + return FALSE; + } } else { i++; i1=i; |