Lines Matching defs:tun
30 * 'nos-tun' program configure tunN interface as a point-to-point
37 * 'nos-tun' can works with itself and CISCO-routers.
38 * (It may also work with Linux 'nos-tun's, but
43 * ( nos-tun sends and accepts packets only to/from this
88 int tun; /* tunnel descriptor */
117 /* Open tun device */
118 tun = open(dev_name, O_RDWR);
119 if (tun < 0) {
190 close(tun);
235 close(tun);
301 openlog("nos-tun", LOG_PID, LOG_DAEMON);
345 if (tun > net)
346 lastfd = tun;
353 FD_SET(tun,&rfds); FD_SET(net,&rfds);
375 /* ... and write to tun-device */
376 write(tun,buf+ipoff,len-ipoff);
380 if(FD_ISSET(tun,&rfds)) {
381 /* Read from tun ... */
382 len = read(tun, buf, sizeof(buf));
395 "usage: nos-tun -t tunnel -s source -d destination -p protocol_number [source] target\n");