Lines Matching refs:tun
32 * 'nos-tun' program configure tunN interface as a point-to-point
39 * 'nos-tun' can works with itself and CISCO-routers.
40 * (It may also work with Linux 'nos-tun's, but
45 * ( nos-tun sends and accepts packets only to/from this
90 int tun; /* tunnel descriptor */
119 /* Open tun device */
120 tun = open(dev_name, O_RDWR);
121 if (tun < 0) {
192 close(tun);
237 close(tun);
303 openlog("nos-tun", LOG_PID, LOG_DAEMON);
347 if (tun > net)
348 lastfd = tun;
355 FD_SET(tun,&rfds); FD_SET(net,&rfds);
377 /* ... and write to tun-device */
378 write(tun,buf+ipoff,len-ipoff);
382 if(FD_ISSET(tun,&rfds)) {
383 /* Read from tun ... */
384 len = read(tun, buf, sizeof(buf));
397 "usage: nos-tun -t tunnel -s source -d destination -p protocol_number [source] target\n");