Lines Matching defs:tun
43 * SSH_TUN_LINUX Use the (newer) Linux tun/tap device
44 * SSH_TUN_FREEBSD Use the FreeBSD tun/tap device
58 sys_tun_open(int tun, int mode)
64 if ((fd = open("/dev/net/tun", O_RDWR)) == -1) {
77 name = "tun%d";
81 if (tun != SSH_TUNID_ANY) {
82 if (tun > SSH_TUNID_MAX) {
84 tun, strerror(errno));
87 snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), name, tun);
96 if (tun == SSH_TUNID_ANY)
118 sys_tun_open(int tun, int mode)
123 const char *tunbase = "tun";
135 if (tun <= SSH_TUNID_MAX) {
136 snprintf(name, sizeof(name), "/dev/%s%d", tunbase, tun);
138 } else if (tun == SSH_TUNID_ANY) {
139 for (tun = 100; tun >= 0; tun--) {
141 tunbase, tun);
146 debug("%s: invalid tunnel %u\n", __func__, tun);
170 snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "%s%d", tunbase, tun);