1 // Copyright 2012 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.
13 errMissingAddress = errors.New("missing address")
14 errMissingHeader = errors.New("missing header")
15 errHeaderTooShort = errors.New("header too short")
16 errBufferTooShort = errors.New("buffer too short")
17 errInvalidConnType = errors.New("invalid conn type")
18 errOpNoSupport = errors.New("operation not supported")
19 errNoSuchInterface = errors.New("no such interface")
20 errNoSuchMulticastInterface = errors.New("no such multicast interface")
22 // See http://www.freebsd.org/doc/en/books/porters-handbook/freebsd-versions.html.
26 func boolint(b bool) int {
33 func netAddrToIP4(a net.Addr) net.IP {
34 switch v := a.(type) {
36 if ip := v.IP.To4(); ip != nil {
40 if ip := v.IP.To4(); ip != nil {
47 func opAddr(a net.Addr) net.Addr {