1 // Copyright 2016 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.
7 // Package lif provides basic functions for the manipulation of
8 // logical network interfaces and interface addresses on Solaris.
10 // The package supports Solaris 11 or above.
15 type endpoint struct {
20 func (ep *endpoint) close() error {
21 return syscall.Close(int(ep.s))
24 func newEndpoints(af int) ([]endpoint, error) {
27 afs := []int{sysAF_INET, sysAF_INET6}
28 if af != sysAF_UNSPEC {
31 for _, af := range afs {
32 s, err := syscall.Socket(af, sysSOCK_DGRAM, 0)
37 eps = append(eps, endpoint{af: af, s: uintptr(s)})