2023-01-27 13:37:20 -08:00
|
|
|
// Copyright (c) Tailscale Inc & AUTHORS
|
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
2020-02-05 14:16:58 -08:00
|
|
|
|
2020-04-30 13:20:09 -07:00
|
|
|
package router
|
2020-02-05 14:16:58 -08:00
|
|
|
|
|
|
|
import (
|
2020-02-14 19:23:16 -08:00
|
|
|
"tailscale.com/types/logger"
|
2020-02-05 14:16:58 -08:00
|
|
|
)
|
|
|
|
|
2021-03-26 21:47:28 -07:00
|
|
|
// NewFake returns a Router that does nothing when called and always
|
|
|
|
// returns nil errors.
|
|
|
|
func NewFake(logf logger.Logf) Router {
|
|
|
|
return fakeRouter{logf: logf}
|
2020-02-05 14:16:58 -08:00
|
|
|
}
|
|
|
|
|
2020-02-14 15:03:25 -08:00
|
|
|
type fakeRouter struct {
|
|
|
|
logf logger.Logf
|
2020-02-05 14:16:58 -08:00
|
|
|
}
|
|
|
|
|
2020-02-14 15:03:25 -08:00
|
|
|
func (r fakeRouter) Up() error {
|
2020-12-21 10:58:06 -08:00
|
|
|
r.logf("[v1] warning: fakeRouter.Up: not implemented.")
|
2020-02-05 14:16:58 -08:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2020-05-12 07:08:52 +00:00
|
|
|
func (r fakeRouter) Set(cfg *Config) error {
|
2020-12-21 10:58:06 -08:00
|
|
|
r.logf("[v1] warning: fakeRouter.Set: not implemented.")
|
2020-02-05 14:16:58 -08:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2023-12-05 18:12:02 -05:00
|
|
|
func (r fakeRouter) UpdateMagicsockPort(_ uint16, _ string) error {
|
|
|
|
r.logf("[v1] warning: fakeRouter.UpdateMagicsockPort: not implemented.")
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2020-02-14 15:03:25 -08:00
|
|
|
func (r fakeRouter) Close() error {
|
2020-12-21 10:58:06 -08:00
|
|
|
r.logf("[v1] warning: fakeRouter.Close: not implemented.")
|
2020-02-11 15:21:24 -08:00
|
|
|
return nil
|
2020-02-05 14:16:58 -08:00
|
|
|
}
|