win32api/ws2_32typedef.go

138 lines
2.4 KiB
Go
Raw Normal View History

package win32api
const (
WSADESCRIPTION_LEN = 256
WSASYS_STATUS_LEN = 128
)
const (
AF_UNSPEC = 0
AF_INET = 2
AF_INET6 = 23
)
const (
SOCK_STREAM = 1
SOCK_DGRAM = 2
)
const (
SOL_SOCKET = 0xffff
)
const (
SO_REUSEADDR = 0x0004
SO_ERROR = 0x1007
)
const (
IPPROTO_IP = 0
IPPROTO_TCP = 6
IPPROTO_UDP = 17
)
const (
AI_PASSIVE = 0x00000001
)
const (
GAA_FLAG_SKIP_UNICAST = 0x00000001
GAA_FLAG_SKIP_ANYCAST = 0x00000002
GAA_FLAG_SKIP_MULTICAST = 0x00000004
GAA_FLAG_SKIP_DNS_SERVER = 0x00000008
GAA_FLAG_INCLUDE_PREFIX = 0x00000010
GAA_FLAG_SKIP_FRIENDLY_NAME = 0x00000020
GAA_FLAG_INCLUDE_WINS_INFO = 0x00000040
GAA_FLAG_INCLUDE_GATEWAYS = 0x00000080
GAA_FLAG_INCLUDE_ALL_INTERFACES = 0x00000100
GAA_FLAG_INCLUDE_ALL_COMPARTMENTS = 0x00000200
GAA_FLAG_INCLUDE_TUNNEL_BINDINGORDER = 0x00000400
)
const (
NI_MAXHOST = 1025
NI_MAXSERV = 32
)
const (
NI_NUMERICHOST = 0x00000002
NI_NUMERICSERV = 0x00000008
)
type SOCKET uintptr
const (
INVALID_SOCKET SOCKET = ^SOCKET(0)
SOCKET_ERROR int32 = -1
)
const (
SD_RECEIVE = 0
SD_SEND = 1
SD_BOTH = 2
)
const (
SOMAXCONN int32 = 0x7fffffff
)
type WSADATA struct {
WVersion WORD
WHighVersion WORD
SzDescription [WSADESCRIPTION_LEN + 1]byte
SzSystemStatus [WSASYS_STATUS_LEN + 1]byte
IMaxSockets WORD
IMaxUdpDg WORD
LPVendorInfo *byte
}
type ADDRESS_FAMILY uint16
type SOCKADDR struct {
Family ADDRESS_FAMILY
Data [14]byte
}
type SOCKADDR_IN struct {
Family ADDRESS_FAMILY
Port uint16
Addr [4]byte
Zero [8]byte
}
type SOCKADDR_IN6 struct {
Family ADDRESS_FAMILY
Port uint16
Flowinfo uint32
Addr [16]byte
ScopeID uint32
}
type ADDRINFOW struct {
Flags int32
Family int32
Socktype int32
Protocol int32
Addrlen uintptr
Canonname *uint16
Addr *SOCKADDR
Next *ADDRINFOW
}
type AdapterAddressInfo struct {
IfIndex uint32
AdapterName string
FriendlyName string
Description string
DNSSuffix string
OperStatus uint32
Mtu uint32
MACAddress string
PhysicalAddressLength uint32
TransmitLinkSpeed uint64
ReceiveLinkSpeed uint64
UnicastIPs []string
DNSServers []string
Gateways []string
}