#include #include #include #include #include #include #include #include #include #define SEARCH_STRING "TUNNELESTABLISHED" #define PIPE_BUFFER_SIZE 512 #define SSH_OPTIONS " -o\"CheckHostIP no\"" \ " -o\"StrictHostKeyChecking no\"" \ " -o\"UserKnownHostsFile /dev/null\"" #define SSH_CMD "ssh -L 5901:localhost:5900 "SSH_OPTIONS" " #define SSH_CMD_APPEND "\"echo "SEARCH_STRING";\nsleep 30\"" char *g_chkbuffer = NULL; int g_szchkbuffer = 0; int ProcessBuffer( char *pIn, int n ) { int i; for (i=0; i\n" "\tOpen a SSH tunnel and spawn a local VNC viewer connected to it\n" "\t are arguments to ssh, one of which must\n" "\tspecify which host to connect to\n", argc>0?argv[0]:"svnc"); return 1; } /* Generate the command line */ cp_cmdline = strdup(SSH_CMD); for (i=1;i