Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 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 | |
| 7 | // This file contains necessary structs/constants generated from libpcap headers with cgo -godefs |
| 8 | // generated with: generate_defs.exe |
| 9 | // DO NOT MODIFY |
| 10 | |
| 11 | package pcap |
| 12 | |
| 13 | import "syscall" |
| 14 | |
| 15 | const errorBufferSize = 0x100 |
| 16 | |
| 17 | const ( |
| 18 | pcapErrorNotActivated = -0x3 |
| 19 | pcapErrorActivated = -0x4 |
| 20 | pcapWarningPromisc = 0x2 |
| 21 | pcapErrorNoSuchDevice = -0x5 |
| 22 | pcapErrorDenied = -0x8 |
| 23 | pcapErrorNotUp = -0x9 |
| 24 | pcapError = -0x1 |
| 25 | pcapWarning = 0x1 |
| 26 | pcapDIN = 0x1 |
| 27 | pcapDOUT = 0x2 |
| 28 | pcapDINOUT = 0x0 |
| 29 | pcapNetmaskUnknown = 0xffffffff |
| 30 | pcapTstampPrecisionMicro = 0x0 |
| 31 | pcapTstampPrecisionNano = 0x1 |
| 32 | ) |
| 33 | |
| 34 | type timeval struct { |
| 35 | Sec int32 |
| 36 | Usec int32 |
| 37 | } |
| 38 | type pcapPkthdr struct { |
| 39 | Ts timeval |
| 40 | Caplen uint32 |
| 41 | Len uint32 |
| 42 | } |
| 43 | type pcapTPtr uintptr |
| 44 | type pcapBpfInstruction struct { |
| 45 | Code uint16 |
| 46 | Jt uint8 |
| 47 | Jf uint8 |
| 48 | K uint32 |
| 49 | } |
| 50 | type pcapBpfProgram struct { |
| 51 | Len uint32 |
| 52 | Pad_cgo_0 [4]byte |
| 53 | Insns *pcapBpfInstruction |
| 54 | } |
| 55 | type pcapStats struct { |
| 56 | Recv uint32 |
| 57 | Drop uint32 |
| 58 | Ifdrop uint32 |
| 59 | } |
| 60 | type pcapCint int32 |
| 61 | type pcapIf struct { |
| 62 | Next *pcapIf |
| 63 | Name *int8 |
| 64 | Description *int8 |
| 65 | Addresses *pcapAddr |
| 66 | Flags uint32 |
| 67 | Pad_cgo_0 [4]byte |
| 68 | } |
| 69 | |
| 70 | type pcapAddr struct { |
| 71 | Next *pcapAddr |
| 72 | Addr *syscall.RawSockaddr |
| 73 | Netmask *syscall.RawSockaddr |
| 74 | Broadaddr *syscall.RawSockaddr |
| 75 | Dstaddr *syscall.RawSockaddr |
| 76 | } |