1
0
mirror of https://github.com/rcornwell/sims.git synced 2026-01-23 02:47:57 +00:00

SCP: Removed unused file.

This commit is contained in:
Richard Cornwell 2018-06-01 15:07:59 -04:00
parent af1c92aaa7
commit 5fc5881a4b
2 changed files with 0 additions and 37 deletions

View File

@ -1,36 +0,0 @@
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <linux/if.h>
#include <linux/if_tun.h>
int tun_alloc(char *dev)
{
struct ifreq ifr;
int fd, err;
fd = open ("/dev/net/tun", O_RDWR);
if (fd == -1)
return -1;
memset (&ifr, 0, sizeof ifr);
/* Flags: IFF_TUN - TUN device (no Ethernet headers)
* IFF_TAP - TAP device
* IFF_NO_PI - Do not provide packet information
*/
ifr.ifr_flags = IFF_TUN | IFF_NO_PI;
if (dev && *dev)
strncpy (ifr.ifr_name, dev, IFNAMSIZ);
err = ioctl (fd, TUNSETIFF, &ifr);
if (err == -1) {
close (fd);
return err;
}
if (dev)
strcpy (dev, ifr.ifr_name);
return fd;
}

View File

@ -1 +0,0 @@
int tun_alloc(char *dev);