Documentation ¶
Overview ¶
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. *
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. *
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. *
Author: FTwOoO <booobooob@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. *
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. *
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. *
Author: FTwOoO <booobooob@gmail.com>
+build linux
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details. *
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. *
- Author: FTwOoO <booobooob@gmail.com>
+build linux
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details. *
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. *
- Author: FTwOoO <booobooob@gmail.com>
- Modification Author: 1AD8BE38F271 <1AD8BE38F271@protonmail.com>
Index ¶
- Constants
- type Interface
- func (ifce *Interface) IP() net.IP
- func (ifce *Interface) IsTAP() bool
- func (ifce *Interface) IsTUN() bool
- func (ifce *Interface) Name() string
- func (ifce *Interface) Net() net.IPNet
- func (ifce *Interface) PeerIP() net.IP
- func (ifce *Interface) ServerSetupNatRules() (err error)
- func (ifce *Interface) SetupNetwork(ip net.IP, peer_ip net.IP, subnet net.IPNet, mtu int) (err error)
Constants ¶
const ( DEFAULT_HWADDR_PREFIX = "01:02:03:04:05:" DEFUALT_HWADDR_BRD = "ff:ff:ff:ff:ff:ff" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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.