| // Copyright 2014 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| // +build darwin freebsd linux solaris |
| "golang.org/x/net/internal/iana" |
| func setsockoptGroupReq(s uintptr, name int, ifi *net.Interface, grp net.IP) error { |
| gr.Interface = uint32(ifi.Index) |
| var d [sizeofGroupReq + 4]byte |
| s := (*[sizeofGroupReq]byte)(unsafe.Pointer(&gr)) |
| p = unsafe.Pointer(&d[0]) |
| return os.NewSyscallError("setsockopt", setsockopt(s, iana.ProtocolIP, name, p, l)) |
| func setsockoptGroupSourceReq(s uintptr, name int, ifi *net.Interface, grp, src net.IP) error { |
| gsr.Interface = uint32(ifi.Index) |
| gsr.setSourceGroup(grp, src) |
| var d [sizeofGroupSourceReq + 4]byte |
| s := (*[sizeofGroupSourceReq]byte)(unsafe.Pointer(&gsr)) |
| p = unsafe.Pointer(&d[0]) |
| l = sizeofGroupSourceReq + 4 |
| return os.NewSyscallError("setsockopt", setsockopt(s, iana.ProtocolIP, name, p, l)) |