Documentation ¶
Index ¶
- Constants
- func CreateInterface(fd uintptr, ifName string, flags uint16) (createdIFName string, err error)
- func TunIdRandom(min, max int) int
- type IfReq
- type Interface
- func (inet *Interface) Close()
- func (ifce *Interface) GetFd() int
- func (ifce *Interface) GetFdOS() *os.File
- func (ifce *Interface) GetName() string
- func (ifce *Interface) IsTAP() bool
- func (ifce *Interface) IsTUN() bool
- func (ifce *Interface) Name() string
- func (tap_conn *Interface) Open(mtu uint, tapNum string, ifType string) (err error)
- func (vni *Interface) Open2(mtu uint, ifNum string, ifType string) (err error)
- func (netIf *Interface) OpenTap(mtu uint, tapNum string) (err error)
- func (netIf *Interface) OpenTapInterface(mtu uint, tapNum string) (err error)
- func (netIf *Interface) OpenTun(mtu uint, tapNum string) (err error)
- func (netIf *Interface) OpenTunInterface(mtu uint, tapNum string) (err error)
- func (inet *Interface) Read(b []byte) (n int, err error)
- func (ifce *Interface) SetTap(isTap bool)
- func (inet *Interface) Write(b []byte) (n int, err error)
- type TapConn
Constants ¶
const (
IPv6_HEADER_LENGTH = 40
)
Variables ¶
This section is empty.
Functions ¶
func CreateInterface ¶
func TunIdRandom ¶
Types ¶
type Interface ¶
type Interface struct { io.ReadWriteCloser // contains filtered or unexported fields }
Interface is a TUN/TAP interface.
func NewTAP ¶
Create a new TAP interface whose name is ifName. If ifName is empty, a default name (tap0, tap1, ... ) will be assigned. ifName should not exceed 16 bytes.
func NewTUN ¶
Create a new TUN interface whose name is ifName. If ifName is empty, a default name (tap0, tap1, ... ) will be assigned. ifName should not exceed 16 bytes.
func (*Interface) Open ¶
******************************************************************** ** Tap Device Open/Close/Read/Write ** ******************************************************************** NOTE: legacy tap device create method used with in tap driver only for now
func (*Interface) Open2 ¶
for tun new open for tun device currently code goes into this path for linux tun connection TODO: move it to regular Open()
func (*Interface) OpenTapInterface ¶
new
func (*Interface) OpenTunInterface ¶
new