blob: 774e907e8eadae38978c16d888a325a6dd050407 [file] [log] [blame]
Matteo Scandoloa6a3aee2019-11-26 13:30:14 -07001// 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
11package pcap
12
13import "syscall"
14
15const errorBufferSize = 0x100
16
17const (
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
34type timeval struct {
35 Sec int32
36 Usec int32
37}
38type pcapPkthdr struct {
39 Ts timeval
40 Caplen uint32
41 Len uint32
42}
43type pcapTPtr uintptr
44type pcapBpfInstruction struct {
45 Code uint16
46 Jt uint8
47 Jf uint8
48 K uint32
49}
50type pcapBpfProgram struct {
51 Len uint32
52 Insns *pcapBpfInstruction
53}
54type pcapStats struct {
55 Recv uint32
56 Drop uint32
57 Ifdrop uint32
58}
59type pcapCint int32
60type pcapIf struct {
61 Next *pcapIf
62 Name *int8
63 Description *int8
64 Addresses *pcapAddr
65 Flags uint32
66}
67
68type pcapAddr struct {
69 Next *pcapAddr
70 Addr *syscall.RawSockaddr
71 Netmask *syscall.RawSockaddr
72 Broadaddr *syscall.RawSockaddr
73 Dstaddr *syscall.RawSockaddr
74}