2020-02-05 22:16:58 +00:00
|
|
|
// Copyright (c) 2020 Tailscale Inc & AUTHORS All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package wgengine
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/tailscale/wireguard-go/device"
|
|
|
|
"github.com/tailscale/wireguard-go/tun"
|
2020-02-15 03:23:16 +00:00
|
|
|
"tailscale.com/types/logger"
|
2020-02-05 22:16:58 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type fakeRouter struct {
|
|
|
|
tunname string
|
|
|
|
logf logger.Logf
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewFakeRouter(logf logger.Logf, tunname string, dev *device.Device, tuntap tun.Device, netChanged func()) Router {
|
2020-02-11 23:21:24 +00:00
|
|
|
return &fakeRouter{
|
2020-02-05 22:16:58 +00:00
|
|
|
logf: logf,
|
|
|
|
tunname: tunname,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *fakeRouter) Up() error {
|
|
|
|
r.logf("Warning: fakeRouter.Up: not implemented.\n")
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *fakeRouter) SetRoutes(rs RouteSettings) error {
|
|
|
|
r.logf("Warning: fakeRouter.SetRoutes: not implemented.\n")
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2020-02-11 23:21:24 +00:00
|
|
|
func (r *fakeRouter) Close() error {
|
2020-02-05 22:16:58 +00:00
|
|
|
r.logf("Warning: fakeRouter.Close: not implemented.\n")
|
2020-02-11 23:21:24 +00:00
|
|
|
return nil
|
2020-02-05 22:16:58 +00:00
|
|
|
}
|