1 Star 0 Fork 0

mirror_golang/net

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
sockopt_ssmreq_unix.go 901 Bytes
一键复制 编辑 原始数据 按行查看 历史
// 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
package ipv4
import (
"net"
"os"
"unsafe"
"golang.org/x/net/internal/iana"
)
func setsockoptGroupReq(fd, name int, ifi *net.Interface, grp net.IP) error {
var gr sysGroupReq
if ifi != nil {
gr.Interface = uint32(ifi.Index)
}
gr.setGroup(grp)
return os.NewSyscallError("setsockopt", setsockopt(fd, iana.ProtocolIP, name, unsafe.Pointer(&gr), sysSizeofGroupReq))
}
func setsockoptGroupSourceReq(fd, name int, ifi *net.Interface, grp, src net.IP) error {
var gsr sysGroupSourceReq
if ifi != nil {
gsr.Interface = uint32(ifi.Index)
}
gsr.setSourceGroup(grp, src)
return os.NewSyscallError("setsockopt", setsockopt(fd, iana.ProtocolIP, name, unsafe.Pointer(&gsr), sysSizeofGroupSourceReq))
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirror_golang/net.git
git@gitee.com:mirror_golang/net.git
mirror_golang
net
net
dfe268fd2bb5

搜索帮助