2020-02-11 05:40:00 +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.
|
|
|
|
|
2020-04-30 20:20:09 +00:00
|
|
|
package router
|
2020-02-11 05:40:00 +00:00
|
|
|
|
2020-05-08 01:07:13 +00:00
|
|
|
// SetRoutesFunc applies the given router settings to the OS network
|
2020-05-12 07:08:52 +00:00
|
|
|
// stack. cfg is guaranteed to be non-nil.
|
2020-02-11 05:40:00 +00:00
|
|
|
//
|
|
|
|
// This is logically part of the router_darwin.go implementation, and
|
|
|
|
// should not be used on other platforms.
|
|
|
|
//
|
|
|
|
// The code to reconfigure the network stack on MacOS and iOS is in
|
|
|
|
// the non-open `ipn-go-bridge` package, which bridges between the Go
|
|
|
|
// and Swift pieces of the application. The ipn-go-bridge sets
|
|
|
|
// SetRoutesFunc at startup.
|
|
|
|
//
|
|
|
|
// So why isn't this in router_darwin.go? Because in the non-oss
|
|
|
|
// repository, we build ipn-go-bridge when developing on Linux as well
|
|
|
|
// as MacOS, so that we don't have to wait until the Mac CI to
|
|
|
|
// discover that we broke it. So this one definition needs to exist in
|
|
|
|
// both the darwin and linux builds. Hence this file and build tag.
|
2020-05-12 07:08:52 +00:00
|
|
|
var SetRoutesFunc func(cfg *Config) error
|