Commit a14f429b authored by Mikio Hara's avatar Mikio Hara

ipv4: rename internal types and constants generated by cgo

To match up with other packages that work with IP protocol stack.

Change-Id: I2d20e4194617b05b6b46d6fba5df1f6c12ae2793
Reviewed-on: https://go-review.googlesource.com/30574
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
parent 88c1a61b
......@@ -20,9 +20,9 @@ func (c *dgramOpt) SetBPF(filter []bpf.RawInstruction) error {
if err != nil {
return err
}
prog := sysSockFProg{
prog := sockFProg{
Len: uint16(len(filter)),
Filter: (*sysSockFilter)(unsafe.Pointer(&filter[0])),
Filter: (*sockFilter)(unsafe.Pointer(&filter[0])),
}
return os.NewSyscallError("setsockopt", setsockopt(s, sysSOL_SOCKET, sysSO_ATTACH_FILTER, unsafe.Pointer(&prog), uint32(unsafe.Sizeof(prog))))
}
......@@ -17,9 +17,9 @@ func marshalPacketInfo(b []byte, cm *ControlMessage) []byte {
m := (*syscall.Cmsghdr)(unsafe.Pointer(&b[0]))
m.Level = iana.ProtocolIP
m.Type = sysIP_PKTINFO
m.SetLen(syscall.CmsgLen(sysSizeofInetPktinfo))
m.SetLen(syscall.CmsgLen(sizeofInetPktinfo))
if cm != nil {
pi := (*sysInetPktinfo)(unsafe.Pointer(&b[syscall.CmsgLen(0)]))
pi := (*inetPktinfo)(unsafe.Pointer(&b[syscall.CmsgLen(0)]))
if ip := cm.Src.To4(); ip != nil {
copy(pi.Spec_dst[:], ip)
}
......@@ -27,11 +27,11 @@ func marshalPacketInfo(b []byte, cm *ControlMessage) []byte {
pi.setIfindex(cm.IfIndex)
}
}
return b[syscall.CmsgSpace(sysSizeofInetPktinfo):]
return b[syscall.CmsgSpace(sizeofInetPktinfo):]
}
func parsePacketInfo(cm *ControlMessage, b []byte) {
pi := (*sysInetPktinfo)(unsafe.Pointer(&b[0]))
pi := (*inetPktinfo)(unsafe.Pointer(&b[0]))
cm.IfIndex = int(pi.Ifindex)
cm.Dst = pi.Addr[:]
}
......@@ -49,29 +49,29 @@ const (
sysMCAST_BLOCK_SOURCE = C.MCAST_BLOCK_SOURCE
sysMCAST_UNBLOCK_SOURCE = C.MCAST_UNBLOCK_SOURCE
sysSizeofSockaddrStorage = C.sizeof_struct_sockaddr_storage
sysSizeofSockaddrInet = C.sizeof_struct_sockaddr_in
sysSizeofInetPktinfo = C.sizeof_struct_in_pktinfo
sysSizeofIPMreq = C.sizeof_struct_ip_mreq
sysSizeofIPMreqn = C.sizeof_struct_ip_mreqn
sysSizeofIPMreqSource = C.sizeof_struct_ip_mreq_source
sysSizeofGroupReq = C.sizeof_struct_group_req
sysSizeofGroupSourceReq = C.sizeof_struct_group_source_req
sizeofSockaddrStorage = C.sizeof_struct_sockaddr_storage
sizeofSockaddrInet = C.sizeof_struct_sockaddr_in
sizeofInetPktinfo = C.sizeof_struct_in_pktinfo
sizeofIPMreq = C.sizeof_struct_ip_mreq
sizeofIPMreqn = C.sizeof_struct_ip_mreqn
sizeofIPMreqSource = C.sizeof_struct_ip_mreq_source
sizeofGroupReq = C.sizeof_struct_group_req
sizeofGroupSourceReq = C.sizeof_struct_group_source_req
)
type sysSockaddrStorage C.struct_sockaddr_storage
type sockaddrStorage C.struct_sockaddr_storage
type sysSockaddrInet C.struct_sockaddr_in
type sockaddrInet C.struct_sockaddr_in
type sysInetPktinfo C.struct_in_pktinfo
type inetPktinfo C.struct_in_pktinfo
type sysIPMreq C.struct_ip_mreq
type ipMreq C.struct_ip_mreq
type sysIPMreqn C.struct_ip_mreqn
type ipMreqn C.struct_ip_mreqn
type sysIPMreqSource C.struct_ip_mreq_source
type ipMreqSource C.struct_ip_mreq_source
type sysGroupReq C.struct_group_req
type groupReq C.struct_group_req
type sysGroupSourceReq C.struct_group_source_req
type groupSourceReq C.struct_group_source_req
......@@ -32,7 +32,7 @@ const (
sysIP_ADD_MEMBERSHIP = C.IP_ADD_MEMBERSHIP
sysIP_DROP_MEMBERSHIP = C.IP_DROP_MEMBERSHIP
sysSizeofIPMreq = C.sizeof_struct_ip_mreq
sizeofIPMreq = C.sizeof_struct_ip_mreq
)
type sysIPMreq C.struct_ip_mreq
type ipMreq C.struct_ip_mreq
......@@ -50,26 +50,26 @@ const (
sysMCAST_BLOCK_SOURCE = C.MCAST_BLOCK_SOURCE
sysMCAST_UNBLOCK_SOURCE = C.MCAST_UNBLOCK_SOURCE
sysSizeofSockaddrStorage = C.sizeof_struct_sockaddr_storage
sysSizeofSockaddrInet = C.sizeof_struct_sockaddr_in
sysSizeofIPMreq = C.sizeof_struct_ip_mreq
sysSizeofIPMreqn = C.sizeof_struct_ip_mreqn
sysSizeofIPMreqSource = C.sizeof_struct_ip_mreq_source
sysSizeofGroupReq = C.sizeof_struct_group_req
sysSizeofGroupSourceReq = C.sizeof_struct_group_source_req
sizeofSockaddrStorage = C.sizeof_struct_sockaddr_storage
sizeofSockaddrInet = C.sizeof_struct_sockaddr_in
sizeofIPMreq = C.sizeof_struct_ip_mreq
sizeofIPMreqn = C.sizeof_struct_ip_mreqn
sizeofIPMreqSource = C.sizeof_struct_ip_mreq_source
sizeofGroupReq = C.sizeof_struct_group_req
sizeofGroupSourceReq = C.sizeof_struct_group_source_req
)
type sysSockaddrStorage C.struct_sockaddr_storage
type sockaddrStorage C.struct_sockaddr_storage
type sysSockaddrInet C.struct_sockaddr_in
type sockaddrInet C.struct_sockaddr_in
type sysIPMreq C.struct_ip_mreq
type ipMreq C.struct_ip_mreq
type sysIPMreqn C.struct_ip_mreqn
type ipMreqn C.struct_ip_mreqn
type sysIPMreqSource C.struct_ip_mreq_source
type ipMreqSource C.struct_ip_mreq_source
type sysGroupReq C.struct_group_req
type groupReq C.struct_group_req
type sysGroupSourceReq C.struct_group_source_req
type groupSourceReq C.struct_group_source_req
......@@ -81,40 +81,40 @@ const (
sysSOL_SOCKET = C.SOL_SOCKET
sysSO_ATTACH_FILTER = C.SO_ATTACH_FILTER
sysSizeofKernelSockaddrStorage = C.sizeof_struct___kernel_sockaddr_storage
sysSizeofSockaddrInet = C.sizeof_struct_sockaddr_in
sysSizeofInetPktinfo = C.sizeof_struct_in_pktinfo
sysSizeofSockExtendedErr = C.sizeof_struct_sock_extended_err
sysSizeofIPMreq = C.sizeof_struct_ip_mreq
sysSizeofIPMreqn = C.sizeof_struct_ip_mreqn
sysSizeofIPMreqSource = C.sizeof_struct_ip_mreq_source
sysSizeofGroupReq = C.sizeof_struct_group_req
sysSizeofGroupSourceReq = C.sizeof_struct_group_source_req
sysSizeofICMPFilter = C.sizeof_struct_icmp_filter
sizeofKernelSockaddrStorage = C.sizeof_struct___kernel_sockaddr_storage
sizeofSockaddrInet = C.sizeof_struct_sockaddr_in
sizeofInetPktinfo = C.sizeof_struct_in_pktinfo
sizeofSockExtendedErr = C.sizeof_struct_sock_extended_err
sizeofIPMreq = C.sizeof_struct_ip_mreq
sizeofIPMreqn = C.sizeof_struct_ip_mreqn
sizeofIPMreqSource = C.sizeof_struct_ip_mreq_source
sizeofGroupReq = C.sizeof_struct_group_req
sizeofGroupSourceReq = C.sizeof_struct_group_source_req
sizeofICMPFilter = C.sizeof_struct_icmp_filter
)
type sysKernelSockaddrStorage C.struct___kernel_sockaddr_storage
type kernelSockaddrStorage C.struct___kernel_sockaddr_storage
type sysSockaddrInet C.struct_sockaddr_in
type sockaddrInet C.struct_sockaddr_in
type sysInetPktinfo C.struct_in_pktinfo
type inetPktinfo C.struct_in_pktinfo
type sysSockExtendedErr C.struct_sock_extended_err
type sockExtendedErr C.struct_sock_extended_err
type sysIPMreq C.struct_ip_mreq
type ipMreq C.struct_ip_mreq
type sysIPMreqn C.struct_ip_mreqn
type ipMreqn C.struct_ip_mreqn
type sysIPMreqSource C.struct_ip_mreq_source
type ipMreqSource C.struct_ip_mreq_source
type sysGroupReq C.struct_group_req
type groupReq C.struct_group_req
type sysGroupSourceReq C.struct_group_source_req
type groupSourceReq C.struct_group_source_req
type sysICMPFilter C.struct_icmp_filter
type icmpFilter C.struct_icmp_filter
type sysSockFProg C.struct_sock_fprog
type sockFProg C.struct_sock_fprog
type sysSockFilter C.struct_sock_filter
type sockFilter C.struct_sock_filter
......@@ -31,7 +31,7 @@ const (
sysIP_ADD_MEMBERSHIP = C.IP_ADD_MEMBERSHIP
sysIP_DROP_MEMBERSHIP = C.IP_DROP_MEMBERSHIP
sysSizeofIPMreq = C.sizeof_struct_ip_mreq
sizeofIPMreq = C.sizeof_struct_ip_mreq
)
type sysIPMreq C.struct_ip_mreq
type ipMreq C.struct_ip_mreq
......@@ -31,7 +31,7 @@ const (
sysIP_ADD_MEMBERSHIP = C.IP_ADD_MEMBERSHIP
sysIP_DROP_MEMBERSHIP = C.IP_DROP_MEMBERSHIP
sysSizeofIPMreq = C.sizeof_struct_ip_mreq
sizeofIPMreq = C.sizeof_struct_ip_mreq
)
type sysIPMreq C.struct_ip_mreq
type ipMreq C.struct_ip_mreq
......@@ -59,26 +59,26 @@ const (
sysMCAST_JOIN_SOURCE_GROUP = C.MCAST_JOIN_SOURCE_GROUP
sysMCAST_LEAVE_SOURCE_GROUP = C.MCAST_LEAVE_SOURCE_GROUP
sysSizeofSockaddrStorage = C.sizeof_struct_sockaddr_storage
sysSizeofSockaddrInet = C.sizeof_struct_sockaddr_in
sysSizeofInetPktinfo = C.sizeof_struct_in_pktinfo
sysSizeofIPMreq = C.sizeof_struct_ip_mreq
sysSizeofIPMreqSource = C.sizeof_struct_ip_mreq_source
sysSizeofGroupReq = C.sizeof_struct_group_req
sysSizeofGroupSourceReq = C.sizeof_struct_group_source_req
sizeofSockaddrStorage = C.sizeof_struct_sockaddr_storage
sizeofSockaddrInet = C.sizeof_struct_sockaddr_in
sizeofInetPktinfo = C.sizeof_struct_in_pktinfo
sizeofIPMreq = C.sizeof_struct_ip_mreq
sizeofIPMreqSource = C.sizeof_struct_ip_mreq_source
sizeofGroupReq = C.sizeof_struct_group_req
sizeofGroupSourceReq = C.sizeof_struct_group_source_req
)
type sysSockaddrStorage C.struct_sockaddr_storage
type sockaddrStorage C.struct_sockaddr_storage
type sysSockaddrInet C.struct_sockaddr_in
type sockaddrInet C.struct_sockaddr_in
type sysInetPktinfo C.struct_in_pktinfo
type inetPktinfo C.struct_in_pktinfo
type sysIPMreq C.struct_ip_mreq
type ipMreq C.struct_ip_mreq
type sysIPMreqSource C.struct_ip_mreq_source
type ipMreqSource C.struct_ip_mreq_source
type sysGroupReq C.struct_group_req
type groupReq C.struct_group_req
type sysGroupSourceReq C.struct_group_source_req
type groupSourceReq C.struct_group_source_req
......@@ -31,7 +31,7 @@ func (typ ICMPType) Protocol() int {
// A router means a node that forwards IP packets not explicitly
// addressed to itself, and a host means a node that is not a router.
type ICMPFilter struct {
sysICMPFilter
icmpFilter
}
// Accept accepts incoming ICMP packets including the type field value
......
......@@ -4,15 +4,15 @@
package ipv4
func (f *sysICMPFilter) accept(typ ICMPType) {
func (f *icmpFilter) accept(typ ICMPType) {
f.Data &^= 1 << (uint32(typ) & 31)
}
func (f *sysICMPFilter) block(typ ICMPType) {
func (f *icmpFilter) block(typ ICMPType) {
f.Data |= 1 << (uint32(typ) & 31)
}
func (f *sysICMPFilter) setAll(block bool) {
func (f *icmpFilter) setAll(block bool) {
if block {
f.Data = 1<<32 - 1
} else {
......@@ -20,6 +20,6 @@ func (f *sysICMPFilter) setAll(block bool) {
}
}
func (f *sysICMPFilter) willBlock(typ ICMPType) bool {
func (f *icmpFilter) willBlock(typ ICMPType) bool {
return f.Data&(1<<(uint32(typ)&31)) != 0
}
......@@ -6,20 +6,20 @@
package ipv4
const sysSizeofICMPFilter = 0x0
const sizeofICMPFilter = 0x0
type sysICMPFilter struct {
type icmpFilter struct {
}
func (f *sysICMPFilter) accept(typ ICMPType) {
func (f *icmpFilter) accept(typ ICMPType) {
}
func (f *sysICMPFilter) block(typ ICMPType) {
func (f *icmpFilter) block(typ ICMPType) {
}
func (f *sysICMPFilter) setAll(block bool) {
func (f *icmpFilter) setAll(block bool) {
}
func (f *sysICMPFilter) willBlock(typ ICMPType) bool {
func (f *icmpFilter) willBlock(typ ICMPType) bool {
return false
}
......@@ -8,7 +8,7 @@ package ipv4
import "net"
func setIPMreqInterface(mreq *sysIPMreq, ifi *net.Interface) error {
func setIPMreqInterface(mreq *ipMreq, ifi *net.Interface) error {
if ifi == nil {
return nil
}
......
......@@ -15,11 +15,11 @@ import (
)
func setsockoptIPMreq(s uintptr, name int, ifi *net.Interface, grp net.IP) error {
mreq := sysIPMreq{Multiaddr: [4]byte{grp[0], grp[1], grp[2], grp[3]}}
mreq := ipMreq{Multiaddr: [4]byte{grp[0], grp[1], grp[2], grp[3]}}
if err := setIPMreqInterface(&mreq, ifi); err != nil {
return err
}
return os.NewSyscallError("setsockopt", setsockopt(s, iana.ProtocolIP, name, unsafe.Pointer(&mreq), sysSizeofIPMreq))
return os.NewSyscallError("setsockopt", setsockopt(s, iana.ProtocolIP, name, unsafe.Pointer(&mreq), sizeofIPMreq))
}
func getsockoptInterface(s uintptr, name int) (*net.Interface, error) {
......
......@@ -15,8 +15,8 @@ import (
)
func getsockoptIPMreqn(s uintptr, name int) (*net.Interface, error) {
var mreqn sysIPMreqn
l := uint32(sysSizeofIPMreqn)
var mreqn ipMreqn
l := uint32(sizeofIPMreqn)
if err := getsockopt(s, iana.ProtocolIP, name, unsafe.Pointer(&mreqn), &l); err != nil {
return nil, os.NewSyscallError("getsockopt", err)
}
......@@ -31,12 +31,12 @@ func getsockoptIPMreqn(s uintptr, name int) (*net.Interface, error) {
}
func setsockoptIPMreqn(s uintptr, name int, ifi *net.Interface, grp net.IP) error {
var mreqn sysIPMreqn
var mreqn ipMreqn
if ifi != nil {
mreqn.Ifindex = int32(ifi.Index)
}
if grp != nil {
mreqn.Multiaddr = [4]byte{grp[0], grp[1], grp[2], grp[3]}
}
return os.NewSyscallError("setsockopt", setsockopt(s, iana.ProtocolIP, name, unsafe.Pointer(&mreqn), sysSizeofIPMreqn))
return os.NewSyscallError("setsockopt", setsockopt(s, iana.ProtocolIP, name, unsafe.Pointer(&mreqn), sizeofIPMreqn))
}
......@@ -84,8 +84,8 @@ func getICMPFilter(s uintptr, opt *sockOpt) (*ICMPFilter, error) {
return nil, errOpNoSupport
}
var f ICMPFilter
l := uint32(sysSizeofICMPFilter)
if err := getsockopt(s, iana.ProtocolReserved, opt.name, unsafe.Pointer(&f.sysICMPFilter), &l); err != nil {
l := uint32(sizeofICMPFilter)
if err := getsockopt(s, iana.ProtocolReserved, opt.name, unsafe.Pointer(&f.icmpFilter), &l); err != nil {
return nil, os.NewSyscallError("getsockopt", err)
}
return &f, nil
......@@ -95,7 +95,7 @@ func setICMPFilter(s uintptr, opt *sockOpt, f *ICMPFilter) error {
if opt.name < 1 || opt.typ != ssoTypeICMPFilter {
return errOpNoSupport
}
return os.NewSyscallError("setsockopt", setsockopt(s, iana.ProtocolReserved, opt.name, unsafe.Pointer(&f.sysICMPFilter), sysSizeofICMPFilter))
return os.NewSyscallError("setsockopt", setsockopt(s, iana.ProtocolReserved, opt.name, unsafe.Pointer(&f.icmpFilter), sizeofICMPFilter))
}
func setGroup(s uintptr, opt *sockOpt, ifi *net.Interface, grp net.IP) error {
......
......@@ -17,7 +17,7 @@ import (
var freebsd32o64 bool
func setsockoptGroupReq(s uintptr, name int, ifi *net.Interface, grp net.IP) error {
var gr sysGroupReq
var gr groupReq
if ifi != nil {
gr.Interface = uint32(ifi.Index)
}
......@@ -25,21 +25,21 @@ func setsockoptGroupReq(s uintptr, name int, ifi *net.Interface, grp net.IP) err
var p unsafe.Pointer
var l uint32
if freebsd32o64 {
var d [sysSizeofGroupReq + 4]byte
s := (*[sysSizeofGroupReq]byte)(unsafe.Pointer(&gr))
var d [sizeofGroupReq + 4]byte
s := (*[sizeofGroupReq]byte)(unsafe.Pointer(&gr))
copy(d[:4], s[:4])
copy(d[8:], s[4:])
p = unsafe.Pointer(&d[0])
l = sysSizeofGroupReq + 4
l = sizeofGroupReq + 4
} else {
p = unsafe.Pointer(&gr)
l = sysSizeofGroupReq
l = sizeofGroupReq
}
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 {
var gsr sysGroupSourceReq
var gsr groupSourceReq
if ifi != nil {
gsr.Interface = uint32(ifi.Index)
}
......@@ -47,15 +47,15 @@ func setsockoptGroupSourceReq(s uintptr, name int, ifi *net.Interface, grp, src
var p unsafe.Pointer
var l uint32
if freebsd32o64 {
var d [sysSizeofGroupSourceReq + 4]byte
s := (*[sysSizeofGroupSourceReq]byte)(unsafe.Pointer(&gsr))
var d [sizeofGroupSourceReq + 4]byte
s := (*[sizeofGroupSourceReq]byte)(unsafe.Pointer(&gsr))
copy(d[:4], s[:4])
copy(d[8:], s[4:])
p = unsafe.Pointer(&d[0])
l = sysSizeofGroupSourceReq + 4
l = sizeofGroupSourceReq + 4
} else {
p = unsafe.Pointer(&gsr)
l = sysSizeofGroupSourceReq
l = sizeofGroupSourceReq
}
return os.NewSyscallError("setsockopt", setsockopt(s, iana.ProtocolIP, name, p, l))
}
......@@ -52,7 +52,7 @@ func init() {
// See http://support.apple.com/kb/HT1633.
if i > 2 || i == 2 && osver[0] >= '1' && osver[1] >= '2' {
ctlOpts[ctlPacketInfo].name = sysIP_PKTINFO
ctlOpts[ctlPacketInfo].length = sysSizeofInetPktinfo
ctlOpts[ctlPacketInfo].length = sizeofInetPktinfo
ctlOpts[ctlPacketInfo].marshal = marshalPacketInfo
ctlOpts[ctlPacketInfo].parse = parsePacketInfo
sockOpts[ssoPacketInfo].name = sysIP_RECVPKTINFO
......@@ -73,24 +73,24 @@ func init() {
}
}
func (pi *sysInetPktinfo) setIfindex(i int) {
func (pi *inetPktinfo) setIfindex(i int) {
pi.Ifindex = uint32(i)
}
func (gr *sysGroupReq) setGroup(grp net.IP) {
sa := (*sysSockaddrInet)(unsafe.Pointer(uintptr(unsafe.Pointer(gr)) + 4))
sa.Len = sysSizeofSockaddrInet
func (gr *groupReq) setGroup(grp net.IP) {
sa := (*sockaddrInet)(unsafe.Pointer(uintptr(unsafe.Pointer(gr)) + 4))
sa.Len = sizeofSockaddrInet
sa.Family = syscall.AF_INET
copy(sa.Addr[:], grp)
}
func (gsr *sysGroupSourceReq) setSourceGroup(grp, src net.IP) {
sa := (*sysSockaddrInet)(unsafe.Pointer(uintptr(unsafe.Pointer(gsr)) + 4))
sa.Len = sysSizeofSockaddrInet
func (gsr *groupSourceReq) setSourceGroup(grp, src net.IP) {
sa := (*sockaddrInet)(unsafe.Pointer(uintptr(unsafe.Pointer(gsr)) + 4))
sa.Len = sizeofSockaddrInet
sa.Family = syscall.AF_INET
copy(sa.Addr[:], grp)
sa = (*sysSockaddrInet)(unsafe.Pointer(uintptr(unsafe.Pointer(gsr)) + 132))
sa.Len = sysSizeofSockaddrInet
sa = (*sockaddrInet)(unsafe.Pointer(uintptr(unsafe.Pointer(gsr)) + 132))
sa.Len = sizeofSockaddrInet
sa.Family = syscall.AF_INET
copy(sa.Addr[:], src)
}
......@@ -54,20 +54,20 @@ func init() {
}
}
func (gr *sysGroupReq) setGroup(grp net.IP) {
sa := (*sysSockaddrInet)(unsafe.Pointer(&gr.Group))
sa.Len = sysSizeofSockaddrInet
func (gr *groupReq) setGroup(grp net.IP) {
sa := (*sockaddrInet)(unsafe.Pointer(&gr.Group))
sa.Len = sizeofSockaddrInet
sa.Family = syscall.AF_INET
copy(sa.Addr[:], grp)
}
func (gsr *sysGroupSourceReq) setSourceGroup(grp, src net.IP) {
sa := (*sysSockaddrInet)(unsafe.Pointer(&gsr.Group))
sa.Len = sysSizeofSockaddrInet
func (gsr *groupSourceReq) setSourceGroup(grp, src net.IP) {
sa := (*sockaddrInet)(unsafe.Pointer(&gsr.Group))
sa.Len = sizeofSockaddrInet
sa.Family = syscall.AF_INET
copy(sa.Addr[:], grp)
sa = (*sysSockaddrInet)(unsafe.Pointer(&gsr.Source))
sa.Len = sysSizeofSockaddrInet
sa = (*sockaddrInet)(unsafe.Pointer(&gsr.Source))
sa.Len = sizeofSockaddrInet
sa.Family = syscall.AF_INET
copy(sa.Addr[:], src)
}
......@@ -13,7 +13,7 @@ import (
var (
ctlOpts = [ctlMax]ctlOpt{
ctlTTL: {sysIP_TTL, 1, marshalTTL, parseTTL},
ctlPacketInfo: {sysIP_PKTINFO, sysSizeofInetPktinfo, marshalPacketInfo, parsePacketInfo},
ctlPacketInfo: {sysIP_PKTINFO, sizeofInetPktinfo, marshalPacketInfo, parsePacketInfo},
}
sockOpts = [ssoMax]sockOpt{
......@@ -35,21 +35,21 @@ var (
}
)
func (pi *sysInetPktinfo) setIfindex(i int) {
func (pi *inetPktinfo) setIfindex(i int) {
pi.Ifindex = int32(i)
}
func (gr *sysGroupReq) setGroup(grp net.IP) {
sa := (*sysSockaddrInet)(unsafe.Pointer(&gr.Group))
func (gr *groupReq) setGroup(grp net.IP) {
sa := (*sockaddrInet)(unsafe.Pointer(&gr.Group))
sa.Family = syscall.AF_INET
copy(sa.Addr[:], grp)
}
func (gsr *sysGroupSourceReq) setSourceGroup(grp, src net.IP) {
sa := (*sysSockaddrInet)(unsafe.Pointer(&gsr.Group))
func (gsr *groupSourceReq) setSourceGroup(grp, src net.IP) {
sa := (*sockaddrInet)(unsafe.Pointer(&gsr.Group))
sa.Family = syscall.AF_INET
copy(sa.Addr[:], grp)
sa = (*sysSockaddrInet)(unsafe.Pointer(&gsr.Source))
sa = (*sockaddrInet)(unsafe.Pointer(&gsr.Source))
sa.Family = syscall.AF_INET
copy(sa.Addr[:], src)
}
......@@ -13,7 +13,7 @@ import (
var (
ctlOpts = [ctlMax]ctlOpt{
ctlTTL: {sysIP_RECVTTL, 4, marshalTTL, parseTTL},
ctlPacketInfo: {sysIP_PKTINFO, sysSizeofInetPktinfo, marshalPacketInfo, parsePacketInfo},
ctlPacketInfo: {sysIP_PKTINFO, sizeofInetPktinfo, marshalPacketInfo, parsePacketInfo},
}
sockOpts = [ssoMax]sockOpt{
......@@ -34,21 +34,21 @@ var (
}
)
func (pi *sysInetPktinfo) setIfindex(i int) {
func (pi *inetPktinfo) setIfindex(i int) {
pi.Ifindex = uint32(i)
}
func (gr *sysGroupReq) setGroup(grp net.IP) {
sa := (*sysSockaddrInet)(unsafe.Pointer(uintptr(unsafe.Pointer(gr)) + 4))
func (gr *groupReq) setGroup(grp net.IP) {
sa := (*sockaddrInet)(unsafe.Pointer(uintptr(unsafe.Pointer(gr)) + 4))
sa.Family = syscall.AF_INET
copy(sa.Addr[:], grp)
}
func (gsr *sysGroupSourceReq) setSourceGroup(grp, src net.IP) {
sa := (*sysSockaddrInet)(unsafe.Pointer(uintptr(unsafe.Pointer(gsr)) + 4))
func (gsr *groupSourceReq) setSourceGroup(grp, src net.IP) {
sa := (*sockaddrInet)(unsafe.Pointer(uintptr(unsafe.Pointer(gsr)) + 4))
sa.Family = syscall.AF_INET
copy(sa.Addr[:], grp)
sa = (*sysSockaddrInet)(unsafe.Pointer(uintptr(unsafe.Pointer(gsr)) + 260))
sa = (*sockaddrInet)(unsafe.Pointer(uintptr(unsafe.Pointer(gsr)) + 260))
sa.Family = syscall.AF_INET
copy(sa.Addr[:], src)
}
......@@ -20,22 +20,22 @@ const (
sysIP_DROP_SOURCE_MEMBERSHIP = 0x10
sysIP_PKTINFO = 0x13
sysSizeofInetPktinfo = 0x8
sysSizeofIPMreq = 0x8
sysSizeofIPMreqSource = 0xc
sizeofInetPktinfo = 0x8
sizeofIPMreq = 0x8
sizeofIPMreqSource = 0xc
)
type sysInetPktinfo struct {
type inetPktinfo struct {
Addr [4]byte
Ifindex int32
}
type sysIPMreq struct {
type ipMreq struct {
Multiaddr [4]byte
Interface [4]byte
}
type sysIPMreqSource struct {
type ipMreqSource struct {
Multiaddr [4]byte
Sourceaddr [4]byte
Interface [4]byte
......@@ -56,6 +56,6 @@ var (
}
)
func (pi *sysInetPktinfo) setIfindex(i int) {
func (pi *inetPktinfo) setIfindex(i int) {
pi.Ifindex = int32(i)
}
......@@ -37,18 +37,18 @@ const (
sysMCAST_BLOCK_SOURCE = 0x54
sysMCAST_UNBLOCK_SOURCE = 0x55
sysSizeofSockaddrStorage = 0x80
sysSizeofSockaddrInet = 0x10
sysSizeofInetPktinfo = 0xc
sizeofSockaddrStorage = 0x80
sizeofSockaddrInet = 0x10
sizeofInetPktinfo = 0xc
sysSizeofIPMreq = 0x8
sysSizeofIPMreqn = 0xc
sysSizeofIPMreqSource = 0xc
sysSizeofGroupReq = 0x84
sysSizeofGroupSourceReq = 0x104
sizeofIPMreq = 0x8
sizeofIPMreqn = 0xc
sizeofIPMreqSource = 0xc
sizeofGroupReq = 0x84
sizeofGroupSourceReq = 0x104
)
type sysSockaddrStorage struct {
type sockaddrStorage struct {
Len uint8
Family uint8
X__ss_pad1 [6]int8
......@@ -56,7 +56,7 @@ type sysSockaddrStorage struct {
X__ss_pad2 [112]int8
}
type sysSockaddrInet struct {
type sockaddrInet struct {
Len uint8
Family uint8
Port uint16
......@@ -64,35 +64,35 @@ type sysSockaddrInet struct {
Zero [8]int8
}
type sysInetPktinfo struct {
type inetPktinfo struct {
Ifindex uint32
Spec_dst [4]byte /* in_addr */
Addr [4]byte /* in_addr */
}
type sysIPMreq struct {
type ipMreq struct {
Multiaddr [4]byte /* in_addr */
Interface [4]byte /* in_addr */
}
type sysIPMreqn struct {
type ipMreqn struct {
Multiaddr [4]byte /* in_addr */
Address [4]byte /* in_addr */
Ifindex int32
}
type sysIPMreqSource struct {
type ipMreqSource struct {
Multiaddr [4]byte /* in_addr */
Sourceaddr [4]byte /* in_addr */
Interface [4]byte /* in_addr */
}
type sysGroupReq struct {
type groupReq struct {
Interface uint32
Pad_cgo_0 [128]byte
}
type sysGroupSourceReq struct {
type groupSourceReq struct {
Interface uint32
Pad_cgo_0 [128]byte
Pad_cgo_1 [128]byte
......
......@@ -24,10 +24,10 @@ const (
sysIP_ADD_MEMBERSHIP = 0xc
sysIP_DROP_MEMBERSHIP = 0xd
sysSizeofIPMreq = 0x8
sizeofIPMreq = 0x8
)
type sysIPMreq struct {
type ipMreq struct {
Multiaddr [4]byte /* in_addr */
Interface [4]byte /* in_addr */
}
......@@ -38,17 +38,17 @@ const (
sysMCAST_BLOCK_SOURCE = 0x54
sysMCAST_UNBLOCK_SOURCE = 0x55
sysSizeofSockaddrStorage = 0x80
sysSizeofSockaddrInet = 0x10
sizeofSockaddrStorage = 0x80
sizeofSockaddrInet = 0x10
sysSizeofIPMreq = 0x8
sysSizeofIPMreqn = 0xc
sysSizeofIPMreqSource = 0xc
sysSizeofGroupReq = 0x84
sysSizeofGroupSourceReq = 0x104
sizeofIPMreq = 0x8
sizeofIPMreqn = 0xc
sizeofIPMreqSource = 0xc
sizeofGroupReq = 0x84
sizeofGroupSourceReq = 0x104
)
type sysSockaddrStorage struct {
type sockaddrStorage struct {
Len uint8
Family uint8
X__ss_pad1 [6]int8
......@@ -56,7 +56,7 @@ type sysSockaddrStorage struct {
X__ss_pad2 [112]int8
}
type sysSockaddrInet struct {
type sockaddrInet struct {
Len uint8
Family uint8
Port uint16
......@@ -64,30 +64,30 @@ type sysSockaddrInet struct {
Zero [8]int8
}
type sysIPMreq struct {
type ipMreq struct {
Multiaddr [4]byte /* in_addr */
Interface [4]byte /* in_addr */
}
type sysIPMreqn struct {
type ipMreqn struct {
Multiaddr [4]byte /* in_addr */
Address [4]byte /* in_addr */
Ifindex int32
}
type sysIPMreqSource struct {
type ipMreqSource struct {
Multiaddr [4]byte /* in_addr */
Sourceaddr [4]byte /* in_addr */
Interface [4]byte /* in_addr */
}
type sysGroupReq struct {
type groupReq struct {
Interface uint32
Group sysSockaddrStorage
Group sockaddrStorage
}
type sysGroupSourceReq struct {
type groupSourceReq struct {
Interface uint32
Group sysSockaddrStorage
Source sysSockaddrStorage
Group sockaddrStorage
Source sockaddrStorage
}
......@@ -38,17 +38,17 @@ const (
sysMCAST_BLOCK_SOURCE = 0x54
sysMCAST_UNBLOCK_SOURCE = 0x55
sysSizeofSockaddrStorage = 0x80
sysSizeofSockaddrInet = 0x10
sizeofSockaddrStorage = 0x80
sizeofSockaddrInet = 0x10
sysSizeofIPMreq = 0x8
sysSizeofIPMreqn = 0xc
sysSizeofIPMreqSource = 0xc
sysSizeofGroupReq = 0x88
sysSizeofGroupSourceReq = 0x108
sizeofIPMreq = 0x8
sizeofIPMreqn = 0xc
sizeofIPMreqSource = 0xc
sizeofGroupReq = 0x88
sizeofGroupSourceReq = 0x108
)
type sysSockaddrStorage struct {
type sockaddrStorage struct {
Len uint8
Family uint8
X__ss_pad1 [6]int8
......@@ -56,7 +56,7 @@ type sysSockaddrStorage struct {
X__ss_pad2 [112]int8
}
type sysSockaddrInet struct {
type sockaddrInet struct {
Len uint8
Family uint8
Port uint16
......@@ -64,32 +64,32 @@ type sysSockaddrInet struct {
Zero [8]int8
}
type sysIPMreq struct {
type ipMreq struct {
Multiaddr [4]byte /* in_addr */
Interface [4]byte /* in_addr */
}
type sysIPMreqn struct {
type ipMreqn struct {
Multiaddr [4]byte /* in_addr */
Address [4]byte /* in_addr */
Ifindex int32
}
type sysIPMreqSource struct {
type ipMreqSource struct {
Multiaddr [4]byte /* in_addr */
Sourceaddr [4]byte /* in_addr */
Interface [4]byte /* in_addr */
}
type sysGroupReq struct {
type groupReq struct {
Interface uint32
Pad_cgo_0 [4]byte
Group sysSockaddrStorage
Group sockaddrStorage
}
type sysGroupSourceReq struct {
type groupSourceReq struct {
Interface uint32
Pad_cgo_0 [4]byte
Group sysSockaddrStorage
Source sysSockaddrStorage
Group sockaddrStorage
Source sockaddrStorage
}
......@@ -38,17 +38,17 @@ const (
sysMCAST_BLOCK_SOURCE = 0x54
sysMCAST_UNBLOCK_SOURCE = 0x55
sysSizeofSockaddrStorage = 0x80
sysSizeofSockaddrInet = 0x10
sizeofSockaddrStorage = 0x80
sizeofSockaddrInet = 0x10
sysSizeofIPMreq = 0x8
sysSizeofIPMreqn = 0xc
sysSizeofIPMreqSource = 0xc
sysSizeofGroupReq = 0x88
sysSizeofGroupSourceReq = 0x108
sizeofIPMreq = 0x8
sizeofIPMreqn = 0xc
sizeofIPMreqSource = 0xc
sizeofGroupReq = 0x88
sizeofGroupSourceReq = 0x108
)
type sysSockaddrStorage struct {
type sockaddrStorage struct {
Len uint8
Family uint8
X__ss_pad1 [6]int8
......@@ -56,7 +56,7 @@ type sysSockaddrStorage struct {
X__ss_pad2 [112]int8
}
type sysSockaddrInet struct {
type sockaddrInet struct {
Len uint8
Family uint8
Port uint16
......@@ -64,32 +64,32 @@ type sysSockaddrInet struct {
Zero [8]int8
}
type sysIPMreq struct {
type ipMreq struct {
Multiaddr [4]byte /* in_addr */
Interface [4]byte /* in_addr */
}
type sysIPMreqn struct {
type ipMreqn struct {
Multiaddr [4]byte /* in_addr */
Address [4]byte /* in_addr */
Ifindex int32
}
type sysIPMreqSource struct {
type ipMreqSource struct {
Multiaddr [4]byte /* in_addr */
Sourceaddr [4]byte /* in_addr */
Interface [4]byte /* in_addr */
}
type sysGroupReq struct {
type groupReq struct {
Interface uint32
Pad_cgo_0 [4]byte
Group sysSockaddrStorage
Group sockaddrStorage
}
type sysGroupSourceReq struct {
type groupSourceReq struct {
Interface uint32
Pad_cgo_0 [4]byte
Group sysSockaddrStorage
Source sysSockaddrStorage
Group sockaddrStorage
Source sockaddrStorage
}
......@@ -58,39 +58,39 @@ const (
sysSOL_SOCKET = 0x1
sysSO_ATTACH_FILTER = 0x1a
sysSizeofKernelSockaddrStorage = 0x80
sysSizeofSockaddrInet = 0x10
sysSizeofInetPktinfo = 0xc
sysSizeofSockExtendedErr = 0x10
sysSizeofIPMreq = 0x8
sysSizeofIPMreqn = 0xc
sysSizeofIPMreqSource = 0xc
sysSizeofGroupReq = 0x84
sysSizeofGroupSourceReq = 0x104
sysSizeofICMPFilter = 0x4
sizeofKernelSockaddrStorage = 0x80
sizeofSockaddrInet = 0x10
sizeofInetPktinfo = 0xc
sizeofSockExtendedErr = 0x10
sizeofIPMreq = 0x8
sizeofIPMreqn = 0xc
sizeofIPMreqSource = 0xc
sizeofGroupReq = 0x84
sizeofGroupSourceReq = 0x104
sizeofICMPFilter = 0x4
)
type sysKernelSockaddrStorage struct {
type kernelSockaddrStorage struct {
Family uint16
X__data [126]int8
}
type sysSockaddrInet struct {
type sockaddrInet struct {
Family uint16
Port uint16
Addr [4]byte /* in_addr */
X__pad [8]uint8
}
type sysInetPktinfo struct {
type inetPktinfo struct {
Ifindex int32
Spec_dst [4]byte /* in_addr */
Addr [4]byte /* in_addr */
}
type sysSockExtendedErr struct {
type sockExtendedErr struct {
Errno uint32
Origin uint8
Type uint8
......@@ -100,45 +100,45 @@ type sysSockExtendedErr struct {
Data uint32
}
type sysIPMreq struct {
type ipMreq struct {
Multiaddr [4]byte /* in_addr */
Interface [4]byte /* in_addr */
}
type sysIPMreqn struct {
type ipMreqn struct {
Multiaddr [4]byte /* in_addr */
Address [4]byte /* in_addr */
Ifindex int32
}
type sysIPMreqSource struct {
type ipMreqSource struct {
Multiaddr uint32
Interface uint32
Sourceaddr uint32
}
type sysGroupReq struct {
type groupReq struct {
Interface uint32
Group sysKernelSockaddrStorage
Group kernelSockaddrStorage
}
type sysGroupSourceReq struct {
type groupSourceReq struct {
Interface uint32
Group sysKernelSockaddrStorage
Source sysKernelSockaddrStorage
Group kernelSockaddrStorage
Source kernelSockaddrStorage
}
type sysICMPFilter struct {
type icmpFilter struct {
Data uint32
}
type sysSockFProg struct {
type sockFProg struct {
Len uint16
Pad_cgo_0 [2]byte
Filter *sysSockFilter
Filter *sockFilter
}
type sysSockFilter struct {
type sockFilter struct {
Code uint16
Jt uint8
Jf uint8
......
......@@ -58,39 +58,39 @@ const (
sysSOL_SOCKET = 0x1
sysSO_ATTACH_FILTER = 0x1a
sysSizeofKernelSockaddrStorage = 0x80
sysSizeofSockaddrInet = 0x10
sysSizeofInetPktinfo = 0xc
sysSizeofSockExtendedErr = 0x10
sysSizeofIPMreq = 0x8
sysSizeofIPMreqn = 0xc
sysSizeofIPMreqSource = 0xc
sysSizeofGroupReq = 0x88
sysSizeofGroupSourceReq = 0x108
sysSizeofICMPFilter = 0x4
sizeofKernelSockaddrStorage = 0x80
sizeofSockaddrInet = 0x10
sizeofInetPktinfo = 0xc
sizeofSockExtendedErr = 0x10
sizeofIPMreq = 0x8
sizeofIPMreqn = 0xc
sizeofIPMreqSource = 0xc
sizeofGroupReq = 0x88
sizeofGroupSourceReq = 0x108
sizeofICMPFilter = 0x4
)
type sysKernelSockaddrStorage struct {
type kernelSockaddrStorage struct {
Family uint16
X__data [126]int8
}
type sysSockaddrInet struct {
type sockaddrInet struct {
Family uint16
Port uint16
Addr [4]byte /* in_addr */
X__pad [8]uint8
}
type sysInetPktinfo struct {
type inetPktinfo struct {
Ifindex int32
Spec_dst [4]byte /* in_addr */
Addr [4]byte /* in_addr */
}
type sysSockExtendedErr struct {
type sockExtendedErr struct {
Errno uint32
Origin uint8
Type uint8
......@@ -100,47 +100,47 @@ type sysSockExtendedErr struct {
Data uint32
}
type sysIPMreq struct {
type ipMreq struct {
Multiaddr [4]byte /* in_addr */
Interface [4]byte /* in_addr */
}
type sysIPMreqn struct {
type ipMreqn struct {
Multiaddr [4]byte /* in_addr */
Address [4]byte /* in_addr */
Ifindex int32
}
type sysIPMreqSource struct {
type ipMreqSource struct {
Multiaddr uint32
Interface uint32
Sourceaddr uint32
}
type sysGroupReq struct {
type groupReq struct {
Interface uint32
Pad_cgo_0 [4]byte
Group sysKernelSockaddrStorage
Group kernelSockaddrStorage
}
type sysGroupSourceReq struct {
type groupSourceReq struct {
Interface uint32
Pad_cgo_0 [4]byte
Group sysKernelSockaddrStorage
Source sysKernelSockaddrStorage
Group kernelSockaddrStorage
Source kernelSockaddrStorage
}
type sysICMPFilter struct {
type icmpFilter struct {
Data uint32
}
type sysSockFProg struct {
type sockFProg struct {
Len uint16
Pad_cgo_0 [6]byte
Filter *sysSockFilter
Filter *sockFilter
}
type sysSockFilter struct {
type sockFilter struct {
Code uint16
Jt uint8
Jf uint8
......
......@@ -58,39 +58,39 @@ const (
sysSOL_SOCKET = 0x1
sysSO_ATTACH_FILTER = 0x1a
sysSizeofKernelSockaddrStorage = 0x80
sysSizeofSockaddrInet = 0x10
sysSizeofInetPktinfo = 0xc
sysSizeofSockExtendedErr = 0x10
sysSizeofIPMreq = 0x8
sysSizeofIPMreqn = 0xc
sysSizeofIPMreqSource = 0xc
sysSizeofGroupReq = 0x84
sysSizeofGroupSourceReq = 0x104
sysSizeofICMPFilter = 0x4
sizeofKernelSockaddrStorage = 0x80
sizeofSockaddrInet = 0x10
sizeofInetPktinfo = 0xc
sizeofSockExtendedErr = 0x10
sizeofIPMreq = 0x8
sizeofIPMreqn = 0xc
sizeofIPMreqSource = 0xc
sizeofGroupReq = 0x84
sizeofGroupSourceReq = 0x104
sizeofICMPFilter = 0x4
)
type sysKernelSockaddrStorage struct {
type kernelSockaddrStorage struct {
Family uint16
X__data [126]int8
}
type sysSockaddrInet struct {
type sockaddrInet struct {
Family uint16
Port uint16
Addr [4]byte /* in_addr */
X__pad [8]uint8
}
type sysInetPktinfo struct {
type inetPktinfo struct {
Ifindex int32
Spec_dst [4]byte /* in_addr */
Addr [4]byte /* in_addr */
}
type sysSockExtendedErr struct {
type sockExtendedErr struct {
Errno uint32
Origin uint8
Type uint8
......@@ -100,45 +100,45 @@ type sysSockExtendedErr struct {
Data uint32
}
type sysIPMreq struct {
type ipMreq struct {
Multiaddr [4]byte /* in_addr */
Interface [4]byte /* in_addr */
}
type sysIPMreqn struct {
type ipMreqn struct {
Multiaddr [4]byte /* in_addr */
Address [4]byte /* in_addr */
Ifindex int32
}
type sysIPMreqSource struct {
type ipMreqSource struct {
Multiaddr uint32
Interface uint32
Sourceaddr uint32
}
type sysGroupReq struct {
type groupReq struct {
Interface uint32
Group sysKernelSockaddrStorage
Group kernelSockaddrStorage
}
type sysGroupSourceReq struct {
type groupSourceReq struct {
Interface uint32
Group sysKernelSockaddrStorage
Source sysKernelSockaddrStorage
Group kernelSockaddrStorage
Source kernelSockaddrStorage
}
type sysICMPFilter struct {
type icmpFilter struct {
Data uint32
}
type sysSockFProg struct {
type sockFProg struct {
Len uint16
Pad_cgo_0 [2]byte
Filter *sysSockFilter
Filter *sockFilter
}
type sysSockFilter struct {
type sockFilter struct {
Code uint16
Jt uint8
Jf uint8
......
......@@ -60,39 +60,39 @@ const (
sysSOL_SOCKET = 0x1
sysSO_ATTACH_FILTER = 0x1a
sysSizeofKernelSockaddrStorage = 0x80
sysSizeofSockaddrInet = 0x10
sysSizeofInetPktinfo = 0xc
sysSizeofSockExtendedErr = 0x10
sysSizeofIPMreq = 0x8
sysSizeofIPMreqn = 0xc
sysSizeofIPMreqSource = 0xc
sysSizeofGroupReq = 0x88
sysSizeofGroupSourceReq = 0x108
sysSizeofICMPFilter = 0x4
sizeofKernelSockaddrStorage = 0x80
sizeofSockaddrInet = 0x10
sizeofInetPktinfo = 0xc
sizeofSockExtendedErr = 0x10
sizeofIPMreq = 0x8
sizeofIPMreqn = 0xc
sizeofIPMreqSource = 0xc
sizeofGroupReq = 0x88
sizeofGroupSourceReq = 0x108
sizeofICMPFilter = 0x4
)
type sysKernelSockaddrStorage struct {
type kernelSockaddrStorage struct {
Family uint16
X__data [126]int8
}
type sysSockaddrInet struct {
type sockaddrInet struct {
Family uint16
Port uint16
Addr [4]byte /* in_addr */
X__pad [8]uint8
}
type sysInetPktinfo struct {
type inetPktinfo struct {
Ifindex int32
Spec_dst [4]byte /* in_addr */
Addr [4]byte /* in_addr */
}
type sysSockExtendedErr struct {
type sockExtendedErr struct {
Errno uint32
Origin uint8
Type uint8
......@@ -102,47 +102,47 @@ type sysSockExtendedErr struct {
Data uint32
}
type sysIPMreq struct {
type ipMreq struct {
Multiaddr [4]byte /* in_addr */
Interface [4]byte /* in_addr */
}
type sysIPMreqn struct {
type ipMreqn struct {
Multiaddr [4]byte /* in_addr */
Address [4]byte /* in_addr */
Ifindex int32
}
type sysIPMreqSource struct {
type ipMreqSource struct {
Multiaddr uint32
Interface uint32
Sourceaddr uint32
}
type sysGroupReq struct {
type groupReq struct {
Interface uint32
Pad_cgo_0 [4]byte
Group sysKernelSockaddrStorage
Group kernelSockaddrStorage
}
type sysGroupSourceReq struct {
type groupSourceReq struct {
Interface uint32
Pad_cgo_0 [4]byte
Group sysKernelSockaddrStorage
Source sysKernelSockaddrStorage
Group kernelSockaddrStorage
Source kernelSockaddrStorage
}
type sysICMPFilter struct {
type icmpFilter struct {
Data uint32
}
type sysSockFProg struct {
type sockFProg struct {
Len uint16
Pad_cgo_0 [6]byte
Filter *sysSockFilter
Filter *sockFilter
}
type sysSockFilter struct {
type sockFilter struct {
Code uint16
Jt uint8
Jf uint8
......
......@@ -60,39 +60,39 @@ const (
sysSOL_SOCKET = 0x1
sysSO_ATTACH_FILTER = 0x1a
sysSizeofKernelSockaddrStorage = 0x80
sysSizeofSockaddrInet = 0x10
sysSizeofInetPktinfo = 0xc
sysSizeofSockExtendedErr = 0x10
sysSizeofIPMreq = 0x8
sysSizeofIPMreqn = 0xc
sysSizeofIPMreqSource = 0xc
sysSizeofGroupReq = 0x88
sysSizeofGroupSourceReq = 0x108
sysSizeofICMPFilter = 0x4
sizeofKernelSockaddrStorage = 0x80
sizeofSockaddrInet = 0x10
sizeofInetPktinfo = 0xc
sizeofSockExtendedErr = 0x10
sizeofIPMreq = 0x8
sizeofIPMreqn = 0xc
sizeofIPMreqSource = 0xc
sizeofGroupReq = 0x88
sizeofGroupSourceReq = 0x108
sizeofICMPFilter = 0x4
)
type sysKernelSockaddrStorage struct {
type kernelSockaddrStorage struct {
Family uint16
X__data [126]int8
}
type sysSockaddrInet struct {
type sockaddrInet struct {
Family uint16
Port uint16
Addr [4]byte /* in_addr */
X__pad [8]uint8
}
type sysInetPktinfo struct {
type inetPktinfo struct {
Ifindex int32
Spec_dst [4]byte /* in_addr */
Addr [4]byte /* in_addr */
}
type sysSockExtendedErr struct {
type sockExtendedErr struct {
Errno uint32
Origin uint8
Type uint8
......@@ -102,47 +102,47 @@ type sysSockExtendedErr struct {
Data uint32
}
type sysIPMreq struct {
type ipMreq struct {
Multiaddr [4]byte /* in_addr */
Interface [4]byte /* in_addr */
}
type sysIPMreqn struct {
type ipMreqn struct {
Multiaddr [4]byte /* in_addr */
Address [4]byte /* in_addr */
Ifindex int32
}
type sysIPMreqSource struct {
type ipMreqSource struct {
Multiaddr uint32
Interface uint32
Sourceaddr uint32
}
type sysGroupReq struct {
type groupReq struct {
Interface uint32
Pad_cgo_0 [4]byte
Group sysKernelSockaddrStorage
Group kernelSockaddrStorage
}
type sysGroupSourceReq struct {
type groupSourceReq struct {
Interface uint32
Pad_cgo_0 [4]byte
Group sysKernelSockaddrStorage
Source sysKernelSockaddrStorage
Group kernelSockaddrStorage
Source kernelSockaddrStorage
}
type sysICMPFilter struct {
type icmpFilter struct {
Data uint32
}
type sysSockFProg struct {
type sockFProg struct {
Len uint16
Pad_cgo_0 [6]byte
Filter *sysSockFilter
Filter *sockFilter
}
type sysSockFilter struct {
type sockFilter struct {
Code uint16
Jt uint8
Jf uint8
......
......@@ -60,39 +60,39 @@ const (
sysSOL_SOCKET = 0x1
sysSO_ATTACH_FILTER = 0x1a
sysSizeofKernelSockaddrStorage = 0x80
sysSizeofSockaddrInet = 0x10
sysSizeofInetPktinfo = 0xc
sysSizeofSockExtendedErr = 0x10
sysSizeofIPMreq = 0x8
sysSizeofIPMreqn = 0xc
sysSizeofIPMreqSource = 0xc
sysSizeofGroupReq = 0x88
sysSizeofGroupSourceReq = 0x108
sysSizeofICMPFilter = 0x4
sizeofKernelSockaddrStorage = 0x80
sizeofSockaddrInet = 0x10
sizeofInetPktinfo = 0xc
sizeofSockExtendedErr = 0x10
sizeofIPMreq = 0x8
sizeofIPMreqn = 0xc
sizeofIPMreqSource = 0xc
sizeofGroupReq = 0x88
sizeofGroupSourceReq = 0x108
sizeofICMPFilter = 0x4
)
type sysKernelSockaddrStorage struct {
type kernelSockaddrStorage struct {
Family uint16
X__data [126]int8
}
type sysSockaddrInet struct {
type sockaddrInet struct {
Family uint16
Port uint16
Addr [4]byte /* in_addr */
X__pad [8]uint8
}
type sysInetPktinfo struct {
type inetPktinfo struct {
Ifindex int32
Spec_dst [4]byte /* in_addr */
Addr [4]byte /* in_addr */
}
type sysSockExtendedErr struct {
type sockExtendedErr struct {
Errno uint32
Origin uint8
Type uint8
......@@ -102,47 +102,47 @@ type sysSockExtendedErr struct {
Data uint32
}
type sysIPMreq struct {
type ipMreq struct {
Multiaddr [4]byte /* in_addr */
Interface [4]byte /* in_addr */
}
type sysIPMreqn struct {
type ipMreqn struct {
Multiaddr [4]byte /* in_addr */
Address [4]byte /* in_addr */
Ifindex int32
}
type sysIPMreqSource struct {
type ipMreqSource struct {
Multiaddr uint32
Interface uint32
Sourceaddr uint32
}
type sysGroupReq struct {
type groupReq struct {
Interface uint32
Pad_cgo_0 [4]byte
Group sysKernelSockaddrStorage
Group kernelSockaddrStorage
}
type sysGroupSourceReq struct {
type groupSourceReq struct {
Interface uint32
Pad_cgo_0 [4]byte
Group sysKernelSockaddrStorage
Source sysKernelSockaddrStorage
Group kernelSockaddrStorage
Source kernelSockaddrStorage
}
type sysICMPFilter struct {
type icmpFilter struct {
Data uint32
}
type sysSockFProg struct {
type sockFProg struct {
Len uint16
Pad_cgo_0 [6]byte
Filter *sysSockFilter
Filter *sockFilter
}
type sysSockFilter struct {
type sockFilter struct {
Code uint16
Jt uint8
Jf uint8
......
......@@ -60,39 +60,39 @@ const (
sysSOL_SOCKET = 0x1
sysSO_ATTACH_FILTER = 0x1a
sysSizeofKernelSockaddrStorage = 0x80
sysSizeofSockaddrInet = 0x10
sysSizeofInetPktinfo = 0xc
sysSizeofSockExtendedErr = 0x10
sysSizeofIPMreq = 0x8
sysSizeofIPMreqn = 0xc
sysSizeofIPMreqSource = 0xc
sysSizeofGroupReq = 0x84
sysSizeofGroupSourceReq = 0x104
sysSizeofICMPFilter = 0x4
sizeofKernelSockaddrStorage = 0x80
sizeofSockaddrInet = 0x10
sizeofInetPktinfo = 0xc
sizeofSockExtendedErr = 0x10
sizeofIPMreq = 0x8
sizeofIPMreqn = 0xc
sizeofIPMreqSource = 0xc
sizeofGroupReq = 0x84
sizeofGroupSourceReq = 0x104
sizeofICMPFilter = 0x4
)
type sysKernelSockaddrStorage struct {
type kernelSockaddrStorage struct {
Family uint16
X__data [126]uint8
}
type sysSockaddrInet struct {
type sockaddrInet struct {
Family uint16
Port uint16
Addr [4]byte /* in_addr */
X__pad [8]uint8
}
type sysInetPktinfo struct {
type inetPktinfo struct {
Ifindex int32
Spec_dst [4]byte /* in_addr */
Addr [4]byte /* in_addr */
}
type sysSockExtendedErr struct {
type sockExtendedErr struct {
Errno uint32
Origin uint8
Type uint8
......@@ -102,45 +102,45 @@ type sysSockExtendedErr struct {
Data uint32
}
type sysIPMreq struct {
type ipMreq struct {
Multiaddr [4]byte /* in_addr */
Interface [4]byte /* in_addr */
}
type sysIPMreqn struct {
type ipMreqn struct {
Multiaddr [4]byte /* in_addr */
Address [4]byte /* in_addr */
Ifindex int32
}
type sysIPMreqSource struct {
type ipMreqSource struct {
Multiaddr uint32
Interface uint32
Sourceaddr uint32
}
type sysGroupReq struct {
type groupReq struct {
Interface uint32
Group sysKernelSockaddrStorage
Group kernelSockaddrStorage
}
type sysGroupSourceReq struct {
type groupSourceReq struct {
Interface uint32
Group sysKernelSockaddrStorage
Source sysKernelSockaddrStorage
Group kernelSockaddrStorage
Source kernelSockaddrStorage
}
type sysICMPFilter struct {
type icmpFilter struct {
Data uint32
}
type sysSockFProg struct {
type sockFProg struct {
Len uint16
Pad_cgo_0 [2]byte
Filter *sysSockFilter
Filter *sockFilter
}
type sysSockFilter struct {
type sockFilter struct {
Code uint16
Jt uint8
Jf uint8
......
......@@ -60,39 +60,39 @@ const (
sysSOL_SOCKET = 0x1
sysSO_ATTACH_FILTER = 0x1a
sysSizeofKernelSockaddrStorage = 0x80
sysSizeofSockaddrInet = 0x10
sysSizeofInetPktinfo = 0xc
sysSizeofSockExtendedErr = 0x10
sysSizeofIPMreq = 0x8
sysSizeofIPMreqn = 0xc
sysSizeofIPMreqSource = 0xc
sysSizeofGroupReq = 0x88
sysSizeofGroupSourceReq = 0x108
sysSizeofICMPFilter = 0x4
sizeofKernelSockaddrStorage = 0x80
sizeofSockaddrInet = 0x10
sizeofInetPktinfo = 0xc
sizeofSockExtendedErr = 0x10
sizeofIPMreq = 0x8
sizeofIPMreqn = 0xc
sizeofIPMreqSource = 0xc
sizeofGroupReq = 0x88
sizeofGroupSourceReq = 0x108
sizeofICMPFilter = 0x4
)
type sysKernelSockaddrStorage struct {
type kernelSockaddrStorage struct {
Family uint16
X__data [126]int8
}
type sysSockaddrInet struct {
type sockaddrInet struct {
Family uint16
Port uint16
Addr [4]byte /* in_addr */
X__pad [8]uint8
}
type sysInetPktinfo struct {
type inetPktinfo struct {
Ifindex int32
Spec_dst [4]byte /* in_addr */
Addr [4]byte /* in_addr */
}
type sysSockExtendedErr struct {
type sockExtendedErr struct {
Errno uint32
Origin uint8
Type uint8
......@@ -102,47 +102,47 @@ type sysSockExtendedErr struct {
Data uint32
}
type sysIPMreq struct {
type ipMreq struct {
Multiaddr [4]byte /* in_addr */
Interface [4]byte /* in_addr */
}
type sysIPMreqn struct {
type ipMreqn struct {
Multiaddr [4]byte /* in_addr */
Address [4]byte /* in_addr */
Ifindex int32
}
type sysIPMreqSource struct {
type ipMreqSource struct {
Multiaddr uint32
Interface uint32
Sourceaddr uint32
}
type sysGroupReq struct {
type groupReq struct {
Interface uint32
Pad_cgo_0 [4]byte
Group sysKernelSockaddrStorage
Group kernelSockaddrStorage
}
type sysGroupSourceReq struct {
type groupSourceReq struct {
Interface uint32
Pad_cgo_0 [4]byte
Group sysKernelSockaddrStorage
Source sysKernelSockaddrStorage
Group kernelSockaddrStorage
Source kernelSockaddrStorage
}
type sysICMPFilter struct {
type icmpFilter struct {
Data uint32
}
type sysSockFProg struct {
type sockFProg struct {
Len uint16
Pad_cgo_0 [6]byte
Filter *sysSockFilter
Filter *sockFilter
}
type sysSockFilter struct {
type sockFilter struct {
Code uint16
Jt uint8
Jf uint8
......
......@@ -60,39 +60,39 @@ const (
sysSOL_SOCKET = 0x1
sysSO_ATTACH_FILTER = 0x1a
sysSizeofKernelSockaddrStorage = 0x80
sysSizeofSockaddrInet = 0x10
sysSizeofInetPktinfo = 0xc
sysSizeofSockExtendedErr = 0x10
sysSizeofIPMreq = 0x8
sysSizeofIPMreqn = 0xc
sysSizeofIPMreqSource = 0xc
sysSizeofGroupReq = 0x88
sysSizeofGroupSourceReq = 0x108
sysSizeofICMPFilter = 0x4
sizeofKernelSockaddrStorage = 0x80
sizeofSockaddrInet = 0x10
sizeofInetPktinfo = 0xc
sizeofSockExtendedErr = 0x10
sizeofIPMreq = 0x8
sizeofIPMreqn = 0xc
sizeofIPMreqSource = 0xc
sizeofGroupReq = 0x88
sizeofGroupSourceReq = 0x108
sizeofICMPFilter = 0x4
)
type sysKernelSockaddrStorage struct {
type kernelSockaddrStorage struct {
Family uint16
X__data [126]int8
}
type sysSockaddrInet struct {
type sockaddrInet struct {
Family uint16
Port uint16
Addr [4]byte /* in_addr */
X__pad [8]uint8
}
type sysInetPktinfo struct {
type inetPktinfo struct {
Ifindex int32
Spec_dst [4]byte /* in_addr */
Addr [4]byte /* in_addr */
}
type sysSockExtendedErr struct {
type sockExtendedErr struct {
Errno uint32
Origin uint8
Type uint8
......@@ -102,47 +102,47 @@ type sysSockExtendedErr struct {
Data uint32
}
type sysIPMreq struct {
type ipMreq struct {
Multiaddr [4]byte /* in_addr */
Interface [4]byte /* in_addr */
}
type sysIPMreqn struct {
type ipMreqn struct {
Multiaddr [4]byte /* in_addr */
Address [4]byte /* in_addr */
Ifindex int32
}
type sysIPMreqSource struct {
type ipMreqSource struct {
Multiaddr uint32
Interface uint32
Sourceaddr uint32
}
type sysGroupReq struct {
type groupReq struct {
Interface uint32
Pad_cgo_0 [4]byte
Group sysKernelSockaddrStorage
Group kernelSockaddrStorage
}
type sysGroupSourceReq struct {
type groupSourceReq struct {
Interface uint32
Pad_cgo_0 [4]byte
Group sysKernelSockaddrStorage
Source sysKernelSockaddrStorage
Group kernelSockaddrStorage
Source kernelSockaddrStorage
}
type sysICMPFilter struct {
type icmpFilter struct {
Data uint32
}
type sysSockFProg struct {
type sockFProg struct {
Len uint16
Pad_cgo_0 [6]byte
Filter *sysSockFilter
Filter *sockFilter
}
type sysSockFilter struct {
type sockFilter struct {
Code uint16
Jt uint8
Jf uint8
......
......@@ -60,39 +60,39 @@ const (
sysSOL_SOCKET = 0x1
sysSO_ATTACH_FILTER = 0x1a
sysSizeofKernelSockaddrStorage = 0x80
sysSizeofSockaddrInet = 0x10
sysSizeofInetPktinfo = 0xc
sysSizeofSockExtendedErr = 0x10
sysSizeofIPMreq = 0x8
sysSizeofIPMreqn = 0xc
sysSizeofIPMreqSource = 0xc
sysSizeofGroupReq = 0x88
sysSizeofGroupSourceReq = 0x108
sysSizeofICMPFilter = 0x4
sizeofKernelSockaddrStorage = 0x80
sizeofSockaddrInet = 0x10
sizeofInetPktinfo = 0xc
sizeofSockExtendedErr = 0x10
sizeofIPMreq = 0x8
sizeofIPMreqn = 0xc
sizeofIPMreqSource = 0xc
sizeofGroupReq = 0x88
sizeofGroupSourceReq = 0x108
sizeofICMPFilter = 0x4
)
type sysKernelSockaddrStorage struct {
type kernelSockaddrStorage struct {
Family uint16
X__data [126]int8
}
type sysSockaddrInet struct {
type sockaddrInet struct {
Family uint16
Port uint16
Addr [4]byte /* in_addr */
X__pad [8]uint8
}
type sysInetPktinfo struct {
type inetPktinfo struct {
Ifindex int32
Spec_dst [4]byte /* in_addr */
Addr [4]byte /* in_addr */
}
type sysSockExtendedErr struct {
type sockExtendedErr struct {
Errno uint32
Origin uint8
Type uint8
......@@ -102,47 +102,47 @@ type sysSockExtendedErr struct {
Data uint32
}
type sysIPMreq struct {
type ipMreq struct {
Multiaddr [4]byte /* in_addr */
Interface [4]byte /* in_addr */
}
type sysIPMreqn struct {
type ipMreqn struct {
Multiaddr [4]byte /* in_addr */
Address [4]byte /* in_addr */
Ifindex int32
}
type sysIPMreqSource struct {
type ipMreqSource struct {
Multiaddr uint32
Interface uint32
Sourceaddr uint32
}
type sysGroupReq struct {
type groupReq struct {
Interface uint32
Pad_cgo_0 [4]byte
Group sysKernelSockaddrStorage
Group kernelSockaddrStorage
}
type sysGroupSourceReq struct {
type groupSourceReq struct {
Interface uint32
Pad_cgo_0 [4]byte
Group sysKernelSockaddrStorage
Source sysKernelSockaddrStorage
Group kernelSockaddrStorage
Source kernelSockaddrStorage
}
type sysICMPFilter struct {
type icmpFilter struct {
Data uint32
}
type sysSockFProg struct {
type sockFProg struct {
Len uint16
Pad_cgo_0 [6]byte
Filter *sysSockFilter
Filter *sockFilter
}
type sysSockFilter struct {
type sockFilter struct {
Code uint16
Jt uint8
Jf uint8
......
......@@ -21,10 +21,10 @@ const (
sysIP_ADD_MEMBERSHIP = 0xc
sysIP_DROP_MEMBERSHIP = 0xd
sysSizeofIPMreq = 0x8
sizeofIPMreq = 0x8
)
type sysIPMreq struct {
type ipMreq struct {
Multiaddr [4]byte /* in_addr */
Interface [4]byte /* in_addr */
}
......@@ -21,10 +21,10 @@ const (
sysIP_ADD_MEMBERSHIP = 0xc
sysIP_DROP_MEMBERSHIP = 0xd
sysSizeofIPMreq = 0x8
sizeofIPMreq = 0x8
)
type sysIPMreq struct {
type ipMreq struct {
Multiaddr [4]byte /* in_addr */
Interface [4]byte /* in_addr */
}
......@@ -49,53 +49,53 @@ const (
sysMCAST_JOIN_SOURCE_GROUP = 0x2d
sysMCAST_LEAVE_SOURCE_GROUP = 0x2e
sysSizeofSockaddrStorage = 0x100
sysSizeofSockaddrInet = 0x10
sysSizeofInetPktinfo = 0xc
sysSizeofIPMreq = 0x8
sysSizeofIPMreqSource = 0xc
sysSizeofGroupReq = 0x104
sysSizeofGroupSourceReq = 0x204
sizeofSockaddrStorage = 0x100
sizeofSockaddrInet = 0x10
sizeofInetPktinfo = 0xc
sizeofIPMreq = 0x8
sizeofIPMreqSource = 0xc
sizeofGroupReq = 0x104
sizeofGroupSourceReq = 0x204
)
type sysSockaddrStorage struct {
type sockaddrStorage struct {
Family uint16
X_ss_pad1 [6]int8
X_ss_align float64
X_ss_pad2 [240]int8
}
type sysSockaddrInet struct {
type sockaddrInet struct {
Family uint16
Port uint16
Addr [4]byte /* in_addr */
Zero [8]int8
}
type sysInetPktinfo struct {
type inetPktinfo struct {
Ifindex uint32
Spec_dst [4]byte /* in_addr */
Addr [4]byte /* in_addr */
}
type sysIPMreq struct {
type ipMreq struct {
Multiaddr [4]byte /* in_addr */
Interface [4]byte /* in_addr */
}
type sysIPMreqSource struct {
type ipMreqSource struct {
Multiaddr [4]byte /* in_addr */
Sourceaddr [4]byte /* in_addr */
Interface [4]byte /* in_addr */
}
type sysGroupReq struct {
type groupReq struct {
Interface uint32
Pad_cgo_0 [256]byte
}
type sysGroupSourceReq struct {
type groupSourceReq struct {
Interface uint32
Pad_cgo_0 [256]byte
Pad_cgo_1 [256]byte
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment