Changeset 398 in ntrip for trunk/ntripserver
- Timestamp:
- Feb 13, 2007, 4:37:58 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ntripserver/NtripLinuxServer.c
r339 r398 2 2 * NtripServerLinux.c 3 3 * 4 * Copyright (c) 2003...200 54 * Copyright (c) 2003...2007 5 5 * German Federal Agency for Cartography and Geodesy (BKG) 6 6 * … … 41 41 */ 42 42 43 /* $Id: NtripLinuxServer.c,v 1.24 2006/11/23 14:39:50 stoecker Exp $43 /* 44 44 * Changes - Version 0.7 45 45 * Sep 22 2003 Steffen Tschirpke <St.Tschirpke@actina.de> … … 78 78 * Changes - Version 0.14 79 79 * May 16 2006 Andrea Stuerze <andrea.stuerze@bkg.bund.de> 80 * - bug fix in base64_encode-function 80 * - bug fixed in base64_encode-function 81 81 * 82 82 * Changes - Version 0.15 … … 94 94 * 95 95 * Changes - Version 0.18 96 * Nov 23 2006 Dirk Stoecker <soft@dstoecker.de> 96 * Oct 30 2006 Andrea Stuerze <andrea.stuerze@bkg.bund.de> 97 * - added possibility to send receiver ID with password 98 * restricted to mode UDPSOCKET and TCPSOCKET. 99 * 100 * Changes - Version 0.19 101 * Nov 30 2006 Andrea Stuerze <andrea.stuerze@bkg.bund.de> 102 * - bug fixed in Mode 2 103 * 104 * Changes - Version 0.20 105 * Feb 13 2007 Dirk Stoecker <soft@dstoecker.de> 97 106 * - default port changed from 80 to 2101 107 * - fixed illegal memory access 108 * - cleanup of no data alarm timer 109 * - fixed zero byte handling in buffers 98 110 * 99 111 */ … … 125 137 CASTER = 6, LAST}; 126 138 127 #define VERSION "NTRIP NtripServerLinux/0. 17"139 #define VERSION "NTRIP NtripServerLinux/0.20" 128 140 #define BUFSZ 1024 129 141 … … 134 146 /* default destination */ 135 147 #define NTRIP_CASTER "www.euref-ip.net" 136 #define NTRIP_PORT 2101 148 #define NTRIP_PORT 2101 137 149 138 150 /* default sisnet source */ … … 203 215 204 216 const char *initfile = NULL; 217 218 const char *recvrid=0; 219 const char *recvrpwd=0; 220 205 221 int bindmode = 0; 206 222 int sock_id; … … 218 234 exit(1); 219 235 } 220 while((c = getopt(argc, argv, "M:i:h:b:p:s:a:m:c:H:P:f:l:u:V:D:U:W:B")) 236 while((c = getopt(argc, argv, "M:i:h:b:p:s:a:m:c:H:P:f:x:y:l:u:V:D:U:W:B")) 221 237 != EOF) 222 238 { … … 283 299 initfile = optarg; 284 300 break; 301 case 'x': 302 recvrid = optarg; 303 break; 304 case 'y': 305 recvrpwd = optarg; 306 break; 285 307 case 'u': 286 308 sisnetuser = optarg; … … 289 311 sisnetpassword = optarg; 290 312 break; 291 case 'c': /* password */313 case 'c': /* DestinationCasterPassword */ 292 314 password = optarg; 293 315 break; 294 case 'H': /* host */316 case 'H': /* SourceCasterHost */ 295 317 inhost = optarg; 296 318 break; 297 case 'P': /* port */319 case 'P': /* SourceCasterPort */ 298 320 inport = atoi(optarg); 299 321 if(inport <= 1 || inport > 65535) … … 584 606 } 585 607 } 608 609 if (recvrid && recvrpwd && ((mode == TCPSOCKET) || (mode == UDPSOCKET))) 610 { 611 if (strlen(recvrid) > (BUFSZ-3)){ 612 fprintf(stderr, "Receiver ID too long\n"); exit(0); 613 }else{ 614 fprintf(stderr, "Sending user ID for receiver...\n"); 615 nBufferBytes = read(gpsfd, szSendBuffer, BUFSZ); 616 strcpy(szSendBuffer, recvrid); 617 strcat(szSendBuffer,"\r\n"); 618 send(gpsfd,szSendBuffer, strlen(szSendBuffer), MSG_DONTWAIT); 619 } 620 621 if (strlen(recvrpwd) > (BUFSZ-3)){ 622 fprintf(stderr, "Receiver password too long\n"); exit(0); 623 }else{ 624 fprintf(stderr, "Sending user password for receiver...\n"); 625 nBufferBytes = read(gpsfd, szSendBuffer, BUFSZ); 626 strcpy(szSendBuffer, recvrpwd); 627 strcat(szSendBuffer,"\r\n"); 628 send(gpsfd, szSendBuffer, strlen(szSendBuffer), MSG_DONTWAIT); 629 } 630 } 586 631 break; 587 632 default: … … 690 735 { 691 736 printf("WARNING: no data received from input\n"); 692 737 sleep(3); 693 738 nodata = 1; 694 739 continue; … … 904 949 SERV_HOST_ADDR); 905 950 fprintf(stderr, " -f initfile send to server\n"); 951 fprintf(stderr, " -x receiver id\n"); 952 fprintf(stderr, " -y receiver password\n"); 906 953 fprintf(stderr, " -B bindmode: bind to incoming UDP stream\n"); 907 954 fprintf(stderr, " Mode = sisnet:\n");
Note:
See TracChangeset
for help on using the changeset viewer.