1 // Copyright 2013 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
14 errInvalidConn = errors.New("invalid connection")
15 errMissingAddress = errors.New("missing address")
16 errHeaderTooShort = errors.New("header too short")
17 errInvalidConnType = errors.New("invalid conn type")
18 errNoSuchInterface = errors.New("no such interface")
19 errNotImplemented = errors.New("not implemented on " + runtime.GOOS + "/" + runtime.GOARCH)
22 func boolint(b bool) int {
29 func netAddrToIP16(a net.Addr) net.IP {
30 switch v := a.(type) {
32 if ip := v.IP.To16(); ip != nil && ip.To4() == nil {
36 if ip := v.IP.To16(); ip != nil && ip.To4() == nil {
43 func opAddr(a net.Addr) net.Addr {