]> Cypherpunks.ru repositories - govpn.git/blob - src/cypherpunks.ru/govpn/tap_linux.go
Ability to use TUN-interfaces under GNU/Linux
[govpn.git] / src / cypherpunks.ru / govpn / tap_linux.go
1 // +build linux
2
3 /*
4 GoVPN -- simple secure free software virtual private network daemon
5 Copyright (C) 2014-2016 Sergey Matveev <stargrave@stargrave.org>
6 */
7
8 package govpn
9
10 import (
11         "io"
12         "strings"
13
14         "github.com/bigeagle/water"
15 )
16
17 func newTAPer(ifaceName string) (io.ReadWriter, error) {
18         if strings.HasPrefix(ifaceName, "tap") {
19                 return water.NewTAP(ifaceName)
20         } else {
21                 return water.NewTUN(ifaceName)
22         }
23 }