From 145a4a48dc54fdd1aafe3f67fb224cb6adcd88c2 Mon Sep 17 00:00:00 2001 From: Rakesh Kelkar Date: Tue, 14 Nov 2017 14:52:29 -0800 Subject: [PATCH] backend: Get flannel building on windows with stubs --- .appveyor.yml | 21 +++++++++++ .gitignore | 1 + backend/alivpc/alivpc.go | 1 + backend/alivpc/alivpc_windows.go | 23 ++++++++++++ backend/awsvpc/awsvpc.go | 1 + backend/awsvpc/awsvpc_windows.go | 23 ++++++++++++ backend/awsvpc/filter.go | 1 + backend/gce/api.go | 1 + backend/gce/gce.go | 1 + backend/gce/gce_windows.go | 46 ++++++++++++++++++++++++ backend/gce/metadata.go | 1 + backend/hostgw/hostgw.go | 1 + backend/hostgw/hostgw_network.go | 1 + backend/hostgw/hostgw_network_test.go | 1 + backend/hostgw/hostgw_network_windows.go | 46 ++++++++++++++++++++++++ backend/hostgw/hostgw_windows.go | 24 +++++++++++++ backend/udp/cproxy_amd64.go | 1 + backend/udp/proxy_amd64.c | 1 + backend/udp/proxy_amd64.h | 1 + backend/udp/udp.go | 1 + backend/udp/udp_amd64.go | 1 + backend/udp/udp_network.go | 4 +-- backend/udp/udp_network_amd64.go | 1 + backend/udp/udp_windows.go | 23 ++++++++++++ backend/vxlan/device.go | 1 + backend/vxlan/vxlan.go | 1 + backend/vxlan/vxlan_network.go | 1 + backend/vxlan/vxlan_windows.go | 24 +++++++++++++ network/iptables.go | 1 + network/iptables_test.go | 1 + network/iptables_windows.go | 44 +++++++++++++++++++++++ pkg/ip/iface.go | 1 + pkg/ip/iface_windows.go | 36 +++++++++++++++++++ pkg/ip/tun.go | 1 + 34 files changed, 335 insertions(+), 2 deletions(-) create mode 100644 .appveyor.yml create mode 100644 backend/alivpc/alivpc_windows.go create mode 100644 backend/awsvpc/awsvpc_windows.go create mode 100644 backend/gce/gce_windows.go create mode 100644 backend/hostgw/hostgw_network_windows.go create mode 100644 backend/hostgw/hostgw_windows.go create mode 100644 backend/udp/udp_windows.go create mode 100644 backend/vxlan/vxlan_windows.go create mode 100644 network/iptables_windows.go create mode 100644 pkg/ip/iface_windows.go diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 0000000000..c1d3da4be7 --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,21 @@ +clone_folder: c:\gopath\src\github.com\coreos\flannel + +environment: + GOPATH: c:\gopath + +install: + - echo %PATH% + - echo %GOPATH% + - set PATH=%GOPATH%\bin;c:\go\bin;%PATH% + - go version + - go env + + +build: off + +test_script: + - ps: | + go test -v ./... + if ($LastExitCode -ne 0) { + throw "test failed" + } diff --git a/.gitignore b/.gitignore index fa23285768..05b5df84e5 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,6 @@ dist/here.txt cover.out .editorconfig .idea/ +flannel.exe bash_unit dist/qemu-* diff --git a/backend/alivpc/alivpc.go b/backend/alivpc/alivpc.go index 876738f42f..72d6a01dbe 100644 --- a/backend/alivpc/alivpc.go +++ b/backend/alivpc/alivpc.go @@ -11,6 +11,7 @@ // 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. +// +build !windows package alivpc diff --git a/backend/alivpc/alivpc_windows.go b/backend/alivpc/alivpc_windows.go new file mode 100644 index 0000000000..52df2eaf6b --- /dev/null +++ b/backend/alivpc/alivpc_windows.go @@ -0,0 +1,23 @@ +// Copyright 2015 flannel authors +// +// 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 +// +// http://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 alivpc + +import ( + log "github.com/golang/glog" +) + +func init() { + log.Infof("AliVpc is not supported on this platform") +} diff --git a/backend/awsvpc/awsvpc.go b/backend/awsvpc/awsvpc.go index 13bbe4f742..9dff521cfe 100644 --- a/backend/awsvpc/awsvpc.go +++ b/backend/awsvpc/awsvpc.go @@ -11,6 +11,7 @@ // 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. +// +build !windows package awsvpc diff --git a/backend/awsvpc/awsvpc_windows.go b/backend/awsvpc/awsvpc_windows.go new file mode 100644 index 0000000000..aba66c1e56 --- /dev/null +++ b/backend/awsvpc/awsvpc_windows.go @@ -0,0 +1,23 @@ +// Copyright 2015 flannel authors +// +// 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 +// +// http://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 awsvpc + +import ( + log "github.com/golang/glog" +) + +func init() { + log.Infof("AWS VPC is not supported on this platform") +} diff --git a/backend/awsvpc/filter.go b/backend/awsvpc/filter.go index 79ba0abf31..5a835394c2 100644 --- a/backend/awsvpc/filter.go +++ b/backend/awsvpc/filter.go @@ -11,6 +11,7 @@ // 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. +// +build !windows package awsvpc diff --git a/backend/gce/api.go b/backend/gce/api.go index e9389f6475..6f33ba1204 100644 --- a/backend/gce/api.go +++ b/backend/gce/api.go @@ -11,6 +11,7 @@ // 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. +// +build !windows package gce diff --git a/backend/gce/gce.go b/backend/gce/gce.go index 5390110fda..3fb10533e0 100644 --- a/backend/gce/gce.go +++ b/backend/gce/gce.go @@ -34,6 +34,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +// +build !windows package gce diff --git a/backend/gce/gce_windows.go b/backend/gce/gce_windows.go new file mode 100644 index 0000000000..0af3115ff0 --- /dev/null +++ b/backend/gce/gce_windows.go @@ -0,0 +1,46 @@ +// Copyright 2015 flannel authors +// +// 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 +// +// http://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. + +// This work borrows from the https://github.com/kelseyhightower/flannel-route-manager +// project which has the following license agreement. + +// Copyright (c) 2014 Kelsey Hightower + +// Permission is hereby granted, free of charge, to any person obtaining a copy of +// this software and associated documentation files (the "Software"), to deal in +// the Software without restriction, including without limitation the rights to +// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +// of the Software, and to permit persons to whom the Software is furnished to do +// so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +package gce + +import ( + log "github.com/golang/glog" +) + +func init() { + log.Infof("GCE is not supported on this platform") +} diff --git a/backend/gce/metadata.go b/backend/gce/metadata.go index 180337cb51..cbf2b65205 100644 --- a/backend/gce/metadata.go +++ b/backend/gce/metadata.go @@ -11,6 +11,7 @@ // 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. +// +build !windows package gce diff --git a/backend/hostgw/hostgw.go b/backend/hostgw/hostgw.go index 01b6659d1c..3ba5e60cbe 100644 --- a/backend/hostgw/hostgw.go +++ b/backend/hostgw/hostgw.go @@ -11,6 +11,7 @@ // 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. +// +build !windows package hostgw diff --git a/backend/hostgw/hostgw_network.go b/backend/hostgw/hostgw_network.go index df79393be3..3d913a2c81 100644 --- a/backend/hostgw/hostgw_network.go +++ b/backend/hostgw/hostgw_network.go @@ -11,6 +11,7 @@ // 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. +// +build !windows package hostgw diff --git a/backend/hostgw/hostgw_network_test.go b/backend/hostgw/hostgw_network_test.go index 9ba949f454..1fbf5e45b8 100644 --- a/backend/hostgw/hostgw_network_test.go +++ b/backend/hostgw/hostgw_network_test.go @@ -11,6 +11,7 @@ // 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. +// +build !windows package hostgw diff --git a/backend/hostgw/hostgw_network_windows.go b/backend/hostgw/hostgw_network_windows.go new file mode 100644 index 0000000000..5ff3e18535 --- /dev/null +++ b/backend/hostgw/hostgw_network_windows.go @@ -0,0 +1,46 @@ +// Copyright 2015 flannel authors +// +// 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 +// +// http://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. +// +build windows + +package hostgw + +import ( + "golang.org/x/net/context" + + "github.com/coreos/flannel/backend" + "github.com/coreos/flannel/subnet" + + netroute "github.com/rakelkar/gonetsh/netroute" +) + +type network struct { + name string + extIface *backend.ExternalInterface + linkIndex int + rl []netroute.Route + lease *subnet.Lease + sm subnet.Manager +} + +func (n *network) Lease() *subnet.Lease { + return n.lease +} + +func (n *network) MTU() int { + return n.extIface.Iface.MTU +} + +func (n *network) Run(ctx context.Context) { + +} diff --git a/backend/hostgw/hostgw_windows.go b/backend/hostgw/hostgw_windows.go new file mode 100644 index 0000000000..a107eb46bb --- /dev/null +++ b/backend/hostgw/hostgw_windows.go @@ -0,0 +1,24 @@ +// Copyright 2015 flannel authors +// +// 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 +// +// http://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. +// +build windows + +package hostgw + +import ( + log "github.com/golang/glog" +) + +func init() { + log.Infof("hostgw is not supported on this platform") +} diff --git a/backend/udp/cproxy_amd64.go b/backend/udp/cproxy_amd64.go index bc76050fe2..28eeb066e6 100644 --- a/backend/udp/cproxy_amd64.go +++ b/backend/udp/cproxy_amd64.go @@ -11,6 +11,7 @@ // 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. +// +build !windows package udp diff --git a/backend/udp/proxy_amd64.c b/backend/udp/proxy_amd64.c index 8981545a94..dd5817f7f0 100644 --- a/backend/udp/proxy_amd64.c +++ b/backend/udp/proxy_amd64.c @@ -11,6 +11,7 @@ // 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. +// +build !windows #include #include diff --git a/backend/udp/proxy_amd64.h b/backend/udp/proxy_amd64.h index ddf6c3c04b..47f9492976 100644 --- a/backend/udp/proxy_amd64.h +++ b/backend/udp/proxy_amd64.h @@ -11,6 +11,7 @@ // 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. +// +build !windows #ifndef PROXY_H #define PROXY_H diff --git a/backend/udp/udp.go b/backend/udp/udp.go index ae4757426a..ec9f5588ef 100644 --- a/backend/udp/udp.go +++ b/backend/udp/udp.go @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // +build !amd64 +// +build !windows package udp diff --git a/backend/udp/udp_amd64.go b/backend/udp/udp_amd64.go index cca3040b24..0d470911c6 100644 --- a/backend/udp/udp_amd64.go +++ b/backend/udp/udp_amd64.go @@ -11,6 +11,7 @@ // 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. +// +build !windows package udp diff --git a/backend/udp/udp_network.go b/backend/udp/udp_network.go index cb3f2dab54..316c853a90 100644 --- a/backend/udp/udp_network.go +++ b/backend/udp/udp_network.go @@ -11,7 +11,7 @@ // 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. -// +build !amd64 +// +build !amd64,!windows package udp @@ -25,4 +25,4 @@ import ( func newNetwork(sm subnet.Manager, extIface *backend.ExternalInterface, port int, nw ip.IP4Net, l *subnet.Lease) (*backend.SimpleNetwork, error) { return nil, fmt.Errorf("UDP backend is not supported on this architecture") -} \ No newline at end of file +} diff --git a/backend/udp/udp_network_amd64.go b/backend/udp/udp_network_amd64.go index c15dcb929e..d6d50e7144 100644 --- a/backend/udp/udp_network_amd64.go +++ b/backend/udp/udp_network_amd64.go @@ -11,6 +11,7 @@ // 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. +// +build !windows package udp diff --git a/backend/udp/udp_windows.go b/backend/udp/udp_windows.go new file mode 100644 index 0000000000..16c93d55e3 --- /dev/null +++ b/backend/udp/udp_windows.go @@ -0,0 +1,23 @@ +// Copyright 2015 flannel authors +// +// 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 +// +// http://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 udp + +import ( + log "github.com/golang/glog" +) + +func init() { + log.Infof("udp is not supported on this platform") +} diff --git a/backend/vxlan/device.go b/backend/vxlan/device.go index c0a8c3124d..5d1e8138ef 100644 --- a/backend/vxlan/device.go +++ b/backend/vxlan/device.go @@ -11,6 +11,7 @@ // 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. +// +build !windows package vxlan diff --git a/backend/vxlan/vxlan.go b/backend/vxlan/vxlan.go index 6dd1da1c31..c2cd73b67b 100644 --- a/backend/vxlan/vxlan.go +++ b/backend/vxlan/vxlan.go @@ -11,6 +11,7 @@ // 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. +// +build !windows package vxlan diff --git a/backend/vxlan/vxlan_network.go b/backend/vxlan/vxlan_network.go index 4a45c53357..ae7cacb156 100644 --- a/backend/vxlan/vxlan_network.go +++ b/backend/vxlan/vxlan_network.go @@ -11,6 +11,7 @@ // 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. +// +build !windows package vxlan diff --git a/backend/vxlan/vxlan_windows.go b/backend/vxlan/vxlan_windows.go new file mode 100644 index 0000000000..0c8633fbf8 --- /dev/null +++ b/backend/vxlan/vxlan_windows.go @@ -0,0 +1,24 @@ +// Copyright 2015 flannel authors +// +// 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 +// +// http://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. +// +build windows + +package vxlan + +import ( + log "github.com/golang/glog" +) + +func init() { + log.Infof("vxlan is not supported on this platform") +} diff --git a/network/iptables.go b/network/iptables.go index 13d9304b95..d18a7e1295 100644 --- a/network/iptables.go +++ b/network/iptables.go @@ -11,6 +11,7 @@ // 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. +// +build !windows package network diff --git a/network/iptables_test.go b/network/iptables_test.go index 1b67be1509..8dbc986b2b 100644 --- a/network/iptables_test.go +++ b/network/iptables_test.go @@ -11,6 +11,7 @@ // 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. +// +build !windows package network diff --git a/network/iptables_windows.go b/network/iptables_windows.go new file mode 100644 index 0000000000..1a554e4c09 --- /dev/null +++ b/network/iptables_windows.go @@ -0,0 +1,44 @@ +// Copyright 2015 flannel authors +// +// 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 +// +// http://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 network + +import ( + "github.com/coreos/flannel/pkg/ip" + "github.com/coreos/flannel/subnet" +) + +type IPTables interface { + AppendUnique(table string, chain string, rulespec ...string) error + Delete(table string, chain string, rulespec ...string) error + Exists(table string, chain string, rulespec ...string) (bool, error) +} + +type IPTablesRule struct { + table string + chain string + rulespec []string +} + +func MasqRules(ipn ip.IP4Net, lease *subnet.Lease) []IPTablesRule { + return nil +} + +func ForwardRules(flannelNetwork string) []IPTablesRule { + return nil +} + +func SetupAndEnsureIPTables(rules []IPTablesRule) { + +} diff --git a/pkg/ip/iface.go b/pkg/ip/iface.go index a5e2da31f1..eb336048b0 100644 --- a/pkg/ip/iface.go +++ b/pkg/ip/iface.go @@ -11,6 +11,7 @@ // 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. +// +build !windows package ip diff --git a/pkg/ip/iface_windows.go b/pkg/ip/iface_windows.go new file mode 100644 index 0000000000..57501d8caf --- /dev/null +++ b/pkg/ip/iface_windows.go @@ -0,0 +1,36 @@ +// Copyright 2015 flannel authors +// +// 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 +// +// http://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 ip + +import ( + "errors" + "net" +) + +func GetIfaceIP4Addr(iface *net.Interface) (net.IP, error) { + return nil, errors.New("GetIfaceIP4Addr not implemented for this platform") +} + +func GetIfaceIP4AddrMatch(iface *net.Interface, matchAddr net.IP) error { + return errors.New("GetIfaceIP4AddrMatch not implemented for this platform") +} + +func GetDefaultGatewayIface() (*net.Interface, error) { + return nil, errors.New("GetDefaultGatewayIface not implemented for this platform") +} + +func GetInterfaceByIP(ip net.IP) (*net.Interface, error) { + return nil, errors.New("GetInterfaceByIp not implemented for this platform") +} diff --git a/pkg/ip/tun.go b/pkg/ip/tun.go index 82ae54006c..58034544fc 100644 --- a/pkg/ip/tun.go +++ b/pkg/ip/tun.go @@ -11,6 +11,7 @@ // 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. +// +build !windows package ip