sys_windows.go 796 B

12345678910111213141516171819202122232425262728293031
  1. // Copyright 2014 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package ipv4
  5. import "syscall"
  6. const (
  7. // See ws2tcpip.h.
  8. sysSockoptHeaderPrepend = 0x2
  9. sysSockoptTOS = syscall.IP_TOS
  10. sysSockoptTTL = syscall.IP_TTL
  11. sysSockoptMulticastTTL = syscall.IP_MULTICAST_TTL
  12. sysSockoptMulticastInterface = syscall.IP_MULTICAST_IF
  13. sysSockoptMulticastLoopback = syscall.IP_MULTICAST_LOOP
  14. sysSockoptJoinGroup = syscall.IP_ADD_MEMBERSHIP
  15. sysSockoptLeaveGroup = syscall.IP_DROP_MEMBERSHIP
  16. )
  17. const (
  18. // See ws2tcpip.h.
  19. sysSockoptPacketInfo = 0x13
  20. )
  21. const sysSizeofPacketInfo = 0x8
  22. type sysPacketInfo struct {
  23. IP [4]byte
  24. IfIndex int32
  25. }