defs_windows_386.go 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. // Copyright 2019 The GoPacket Authors. All rights reserved.
  2. //
  3. // Use of this source code is governed by a BSD-style license
  4. // that can be found in the LICENSE file in the root of the source
  5. // tree.
  6. // This file contains necessary structs/constants generated from libpcap headers with cgo -godefs
  7. // generated with: generate_defs.exe
  8. // DO NOT MODIFY
  9. package pcap
  10. import "syscall"
  11. const errorBufferSize = 0x100
  12. const (
  13. pcapErrorNotActivated = -0x3
  14. pcapErrorActivated = -0x4
  15. pcapWarningPromisc = 0x2
  16. pcapErrorNoSuchDevice = -0x5
  17. pcapErrorDenied = -0x8
  18. pcapErrorNotUp = -0x9
  19. pcapError = -0x1
  20. pcapWarning = 0x1
  21. pcapDIN = 0x1
  22. pcapDOUT = 0x2
  23. pcapDINOUT = 0x0
  24. pcapNetmaskUnknown = 0xffffffff
  25. pcapTstampPrecisionMicro = 0x0
  26. pcapTstampPrecisionNano = 0x1
  27. )
  28. type timeval struct {
  29. Sec int32
  30. Usec int32
  31. }
  32. type pcapPkthdr struct {
  33. Ts timeval
  34. Caplen uint32
  35. Len uint32
  36. }
  37. type pcapTPtr uintptr
  38. type pcapBpfInstruction struct {
  39. Code uint16
  40. Jt uint8
  41. Jf uint8
  42. K uint32
  43. }
  44. type pcapBpfProgram struct {
  45. Len uint32
  46. Insns *pcapBpfInstruction
  47. }
  48. type pcapStats struct {
  49. Recv uint32
  50. Drop uint32
  51. Ifdrop uint32
  52. }
  53. type pcapCint int32
  54. type pcapIf struct {
  55. Next *pcapIf
  56. Name *int8
  57. Description *int8
  58. Addresses *pcapAddr
  59. Flags uint32
  60. }
  61. type pcapAddr struct {
  62. Next *pcapAddr
  63. Addr *syscall.RawSockaddr
  64. Netmask *syscall.RawSockaddr
  65. Broadaddr *syscall.RawSockaddr
  66. Dstaddr *syscall.RawSockaddr
  67. }