longcongduoi / go-tuntap

Use Tun/Tap devices with Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tun / Tap Bindings for Go

Install

go get github.com/lab11/go-tuntap/tuntap

Usage

import "github.com/lab11/go-tuntap/tuntap"

func main () {
    var tund *tuntap.Interface
    var erro error
    var inpkt *tuntap.Packet

    tund, err = tuntap.Open("tun0", tuntap.DevTun)
    inpkt = tund.ReadPacket()
}

Thanks

Thank you to @danderson for writing the original version at http://code.google.com/p/tuntap/ .

About

Use Tun/Tap devices with Go


Languages

Language:Go 96.5%Language:Shell 3.5%