diff --git a/tunnel/intercept/tproxy/tproxy.go b/tunnel/intercept/tproxy/tproxy.go new file mode 100644 index 000000000..7c6f0c7e0 --- /dev/null +++ b/tunnel/intercept/tproxy/tproxy.go @@ -0,0 +1,26 @@ +/* + Copyright NetFoundry Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package tproxy + +import "time" + +type Config struct { + LanIf string + Diverter string + UDPIdleTimeout time.Duration + UDPCheckInterval time.Duration +} diff --git a/tunnel/intercept/tproxy/tproxy_darwin.go b/tunnel/intercept/tproxy/tproxy_darwin.go index b7ec32558..19829ac65 100644 --- a/tunnel/intercept/tproxy/tproxy_darwin.go +++ b/tunnel/intercept/tproxy/tproxy_darwin.go @@ -21,10 +21,6 @@ import ( "github.com/pkg/errors" ) -func New(lanIf string) (intercept.Interceptor, error) { - return nil, errors.New("tproxy not supported on darwin") -} - -func NewWithDiverter(lanIf, diverter string) (intercept.Interceptor, error) { +func New(config Config) (intercept.Interceptor, error) { return nil, errors.New("tproxy not supported on darwin") } diff --git a/tunnel/intercept/tproxy/tproxy_linux.go b/tunnel/intercept/tproxy/tproxy_linux.go index dc6cdacf8..85a878866 100644 --- a/tunnel/intercept/tproxy/tproxy_linux.go +++ b/tunnel/intercept/tproxy/tproxy_linux.go @@ -76,13 +76,6 @@ var listenConfig = net.ListenConfig{ }, } -type Config struct { - LanIf string - Diverter string - UDPIdleTimeout time.Duration - UDPCheckInterval time.Duration -} - func New(config Config) (intercept.Interceptor, error) { log := pfxlog.Logger() diff --git a/tunnel/intercept/tproxy/tproxy_windows.go b/tunnel/intercept/tproxy/tproxy_windows.go index d57254439..2baa8c3bc 100644 --- a/tunnel/intercept/tproxy/tproxy_windows.go +++ b/tunnel/intercept/tproxy/tproxy_windows.go @@ -21,10 +21,6 @@ import ( "github.com/pkg/errors" ) -func New(lanIf string) (intercept.Interceptor, error) { - return nil, errors.New("tproxy not supported on windows") -} - -func NewWithDiverter(lanIf, diverter string) (intercept.Interceptor, error) { +func New(config Config) (intercept.Interceptor, error) { return nil, errors.New("tproxy not supported on windows") }