16 lines
352 B
Go
16 lines
352 B
Go
// New creates and returns a new TUN interface for the application.
|
|
func New(name string, opts ...Option) (*TUN, error) {
|
|
// Setup TUN Config
|
|
cfg := water.Config{
|
|
DeviceType: water.TUN,
|
|
}
|
|
cfg.Name = name
|
|
|
|
// Create Water Interface
|
|
iface, err := water.New(cfg)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
...
|
|
}
|