blob: b738b89ddd0a6079f7624056d45c0b5109da1e6b [file] [log] [blame] [edit]
// Copyright 2017 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.
package socket
import (
"net"
"syscall"
"unsafe"
"golang.org/x/sys/windows"
)
func probeProtocolStack() int {
var p uintptr
return int(unsafe.Sizeof(p))
}
const (
sysAF_UNSPEC = windows.AF_UNSPEC
sysAF_INET = windows.AF_INET
sysAF_INET6 = windows.AF_INET6
sysSOCK_RAW = windows.SOCK_RAW
sizeofSockaddrInet4 = 0x10
sizeofSockaddrInet6 = 0x1c
)
func getsockopt(s uintptr, level, name int, b []byte) (int, error) {
l := uint32(len(b))
err := syscall.Getsockopt(syscall.Handle(s), int32(level), int32(name), (*byte)(unsafe.Pointer(&b[0])), (*int32)(unsafe.Pointer(&l)))
return int(l), err
}
func setsockopt(s uintptr, level, name int, b []byte) error {
return syscall.Setsockopt(syscall.Handle(s), int32(level), int32(name), (*byte)(unsafe.Pointer(&b[0])), int32(len(b)))
}
func recvmsg(s uintptr, buffers [][]byte, oob []byte, flags int, network string) (n, oobn int, recvflags int, from net.Addr, err error) {
return 0, 0, 0, nil, errNotImplemented
}
func sendmsg(s uintptr, buffers [][]byte, oob []byte, to net.Addr, flags int) (int, error) {
return 0, errNotImplemented
}
func recvmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) {
return 0, errNotImplemented
}
func sendmmsg(s uintptr, hs []mmsghdr, flags int) (int, error) {
return 0, errNotImplemented
}