Skip to content

Instantly share code, notes, and snippets.

@wxdao
wxdao / open_utun.c
Last active April 13, 2024 18:39 — forked from bringhurst/gist:1693075
How to open utun device in OS X
#include <netinet/in.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/kern_control.h>
#include <net/if_utun.h>
#include <sys/ioctl.h>
#include <sys/kern_event.h>
int open_utun(int num) {
int err;