Debian Codegraph @

src/bindings.rs

raw symbols SCIP
1 /* automatically generated by rust-bindgen */
2
3 extern crate libc;
4 #[cfg(windows)] extern crate winapi;
5 pub use libc::FILE;
6 #[cfg(unix)] pub use libc::{sockaddr, timeval};
7 #[cfg(windows)] pub use winapi::shared::ws2def::SOCKADDR as sockaddr;
8 #[cfg(windows)] pub use winapi::um::winsock2::timeval;
9
10 pub const PCAP_VERSION_MAJOR: u32 = 2;
11 pub const PCAP_VERSION_MINOR: u32 = 4;
12 pub const PCAP_ERRBUF_SIZE: u32 = 256;
13 pub const PCAP_IF_LOOPBACK: u32 = 1;
14 pub const PCAP_IF_UP: u32 = 2;
15 pub const PCAP_IF_RUNNING: u32 = 4;
16 pub const PCAP_ERROR: i32 = -1;
17 pub const PCAP_ERROR_BREAK: i32 = -2;
18 pub const PCAP_ERROR_NOT_ACTIVATED: i32 = -3;
19 pub const PCAP_ERROR_ACTIVATED: i32 = -4;
20 pub const PCAP_ERROR_NO_SUCH_DEVICE: i32 = -5;
21 pub const PCAP_ERROR_RFMON_NOTSUP: i32 = -6;
22 pub const PCAP_ERROR_NOT_RFMON: i32 = -7;
23 pub const PCAP_ERROR_PERM_DENIED: i32 = -8;
24 pub const PCAP_ERROR_IFACE_NOT_UP: i32 = -9;
25 pub const PCAP_ERROR_CANTSET_TSTAMP_TYPE: i32 = -10;
26 pub const PCAP_ERROR_PROMISC_PERM_DENIED: i32 = -11;
27 pub const PCAP_ERROR_TSTAMP_PRECISION_NOTSUP: i32 = -12;
28 pub const PCAP_WARNING: u32 = 1;
29 pub const PCAP_WARNING_PROMISC_NOTSUP: u32 = 2;
30 pub const PCAP_WARNING_TSTAMP_TYPE_NOTSUP: u32 = 3;
31 pub const PCAP_NETMASK_UNKNOWN: u32 = 4294967295;
32 pub const PCAP_TSTAMP_HOST: u32 = 0;
33 pub const PCAP_TSTAMP_HOST_LOWPREC: u32 = 1;
34 pub const PCAP_TSTAMP_HOST_HIPREC: u32 = 2;
35 pub const PCAP_TSTAMP_ADAPTER: u32 = 3;
36 pub const PCAP_TSTAMP_ADAPTER_UNSYNCED: u32 = 4;
37 pub const PCAP_TSTAMP_PRECISION_MICRO: u32 = 0;
38 pub const PCAP_TSTAMP_PRECISION_NANO: u32 = 1;
39 pub type u_char = libc::c_uchar;
40 pub type u_short = libc::c_ushort;
41 pub type u_int = libc::c_uint;
42 pub type bpf_int32 = libc::c_int;
43 pub type bpf_u_int32 = u_int;
44 #[repr(C)]
45 #[derive(Debug, Copy, Clone)]
46 pub struct bpf_program {
47 pub bf_len: u_int,
48 pub bf_insns: *mut bpf_insn,
49 }
50 #[repr(C)]
51 #[derive(Debug, Copy, Clone)]
52 pub struct bpf_insn {
53 pub code: u_short,
54 pub jt: u_char,
55 pub jf: u_char,
56 pub k: bpf_u_int32,
57 }
58 #[repr(C)]
59 #[derive(Debug, Copy, Clone)]
60 pub struct pcap {
61 _unused: [u8; 0],
62 }
63 pub type pcap_t = pcap;
64 #[repr(C)]
65 #[derive(Debug, Copy, Clone)]
66 pub struct pcap_dumper {
67 _unused: [u8; 0],
68 }
69 pub type pcap_dumper_t = pcap_dumper;
70 pub type pcap_if_t = pcap_if;
71 pub type pcap_addr_t = pcap_addr;
72 #[repr(C)]
73 #[derive(Debug, Copy, Clone)]
74 pub struct pcap_file_header {
75 pub magic: bpf_u_int32,
76 pub version_major: u_short,
77 pub version_minor: u_short,
78 pub thiszone: bpf_int32,
79 pub sigfigs: bpf_u_int32,
80 pub snaplen: bpf_u_int32,
81 pub linktype: bpf_u_int32,
82 }
83 pub const pcap_direction_t_PCAP_D_INOUT: pcap_direction_t = 0;
84 pub const pcap_direction_t_PCAP_D_IN: pcap_direction_t = 1;
85 pub const pcap_direction_t_PCAP_D_OUT: pcap_direction_t = 2;
86 pub type pcap_direction_t = u32;
87 #[repr(C)]
88 pub struct pcap_pkthdr {
89 pub ts: timeval,
90 pub caplen: bpf_u_int32,
91 pub len: bpf_u_int32,
92 pub comment: [libc::c_char; 256usize],
93 }
94 #[repr(C)]
95 #[derive(Debug, Copy, Clone)]
96 pub struct pcap_stat {
97 pub ps_recv: u_int,
98 pub ps_drop: u_int,
99 pub ps_ifdrop: u_int,
100 }
101 #[repr(C)]
102 #[derive(Debug, Copy, Clone)]
103 pub struct pcap_if {
104 pub next: *mut pcap_if,
105 pub name: *mut libc::c_char,
106 pub description: *mut libc::c_char,
107 pub addresses: *mut pcap_addr,
108 pub flags: bpf_u_int32,
109 }
110 #[repr(C)]
111 #[derive(Debug, Copy, Clone)]
112 pub struct pcap_addr {
113 pub next: *mut pcap_addr,
114 pub addr: *mut sockaddr,
115 pub netmask: *mut sockaddr,
116 pub broadaddr: *mut sockaddr,
117 pub dstaddr: *mut sockaddr,
118 }
119 pub type pcap_handler = ::std::option::Option<
120 unsafe extern "C" fn(arg1: *mut u_char, arg2: *const pcap_pkthdr, arg3: *const u_char),
121 >;
122 extern "C" {
123 pub fn pcap_lookupdev(arg1: *mut libc::c_char) -> *mut libc::c_char;
124 }
125 extern "C" {
126 pub fn pcap_lookupnet(
127 arg1: *const libc::c_char,
128 arg2: *mut bpf_u_int32,
129 arg3: *mut bpf_u_int32,
130 arg4: *mut libc::c_char,
131 ) -> libc::c_int;
132 }
133 extern "C" {
134 pub fn pcap_create(arg1: *const libc::c_char, arg2: *mut libc::c_char) -> *mut pcap_t;
135 }
136 extern "C" {
137 pub fn pcap_set_snaplen(arg1: *mut pcap_t, arg2: libc::c_int) -> libc::c_int;
138 }
139 extern "C" {
140 pub fn pcap_set_promisc(arg1: *mut pcap_t, arg2: libc::c_int) -> libc::c_int;
141 }
142 extern "C" {
143 pub fn pcap_can_set_rfmon(arg1: *mut pcap_t) -> libc::c_int;
144 }
145 extern "C" {
146 pub fn pcap_set_rfmon(arg1: *mut pcap_t, arg2: libc::c_int) -> libc::c_int;
147 }
148 extern "C" {
149 pub fn pcap_set_timeout(arg1: *mut pcap_t, arg2: libc::c_int) -> libc::c_int;
150 }
151 extern "C" {
152 pub fn pcap_set_tstamp_type(arg1: *mut pcap_t, arg2: libc::c_int) -> libc::c_int;
153 }
154 extern "C" {
155 pub fn pcap_set_immediate_mode(arg1: *mut pcap_t, arg2: libc::c_int) -> libc::c_int;
156 }
157 extern "C" {
158 pub fn pcap_set_buffer_size(arg1: *mut pcap_t, arg2: libc::c_int) -> libc::c_int;
159 }
160 extern "C" {
161 pub fn pcap_set_tstamp_precision(arg1: *mut pcap_t, arg2: libc::c_int) -> libc::c_int;
162 }
163 extern "C" {
164 pub fn pcap_get_tstamp_precision(arg1: *mut pcap_t) -> libc::c_int;
165 }
166 extern "C" {
167 pub fn pcap_activate(arg1: *mut pcap_t) -> libc::c_int;
168 }
169 extern "C" {
170 pub fn pcap_apple_set_exthdr(p: *mut pcap_t, arg1: libc::c_int) -> libc::c_int;
171 }
172 extern "C" {
173 pub fn pcap_list_tstamp_types(arg1: *mut pcap_t, arg2: *mut *mut libc::c_int) -> libc::c_int;
174 }
175 extern "C" {
176 pub fn pcap_free_tstamp_types(arg1: *mut libc::c_int);
177 }
178 extern "C" {
179 pub fn pcap_tstamp_type_name_to_val(arg1: *const libc::c_char) -> libc::c_int;
180 }
181 extern "C" {
182 pub fn pcap_tstamp_type_val_to_name(arg1: libc::c_int) -> *const libc::c_char;
183 }
184 extern "C" {
185 pub fn pcap_tstamp_type_val_to_description(arg1: libc::c_int) -> *const libc::c_char;
186 }
187 extern "C" {
188 pub fn pcap_open_live(
189 arg1: *const libc::c_char,
190 arg2: libc::c_int,
191 arg3: libc::c_int,
192 arg4: libc::c_int,
193 arg5: *mut libc::c_char,
194 ) -> *mut pcap_t;
195 }
196 extern "C" {
197 pub fn pcap_open_dead(arg1: libc::c_int, arg2: libc::c_int) -> *mut pcap_t;
198 }
199 extern "C" {
200 pub fn pcap_open_dead_with_tstamp_precision(
201 arg1: libc::c_int,
202 arg2: libc::c_int,
203 arg3: u_int,
204 ) -> *mut pcap_t;
205 }
206 extern "C" {
207 pub fn pcap_open_offline_with_tstamp_precision(
208 arg1: *const libc::c_char,
209 arg2: u_int,
210 arg3: *mut libc::c_char,
211 ) -> *mut pcap_t;
212 }
213 extern "C" {
214 pub fn pcap_open_offline(arg1: *const libc::c_char, arg2: *mut libc::c_char) -> *mut pcap_t;
215 }
216 extern "C" {
217 pub fn pcap_fopen_offline_with_tstamp_precision(
218 arg1: *mut FILE,
219 arg2: u_int,
220 arg3: *mut libc::c_char,
221 ) -> *mut pcap_t;
222 }
223 extern "C" {
224 pub fn pcap_fopen_offline(arg1: *mut FILE, arg2: *mut libc::c_char) -> *mut pcap_t;
225 }
226 extern "C" {
227 pub fn pcap_close(arg1: *mut pcap_t);
228 }
229 extern "C" {
230 pub fn pcap_loop(
231 arg1: *mut pcap_t,
232 arg2: libc::c_int,
233 arg3: pcap_handler,
234 arg4: *mut u_char,
235 ) -> libc::c_int;
236 }
237 extern "C" {
238 pub fn pcap_dispatch(
239 arg1: *mut pcap_t,
240 arg2: libc::c_int,
241 arg3: pcap_handler,
242 arg4: *mut u_char,
243 ) -> libc::c_int;
244 }
245 extern "C" {
246 pub fn pcap_next(arg1: *mut pcap_t, arg2: *mut pcap_pkthdr) -> *const u_char;
247 }
248 extern "C" {
249 pub fn pcap_next_ex(
250 arg1: *mut pcap_t,
251 arg2: *mut *mut pcap_pkthdr,
252 arg3: *mut *const u_char,
253 ) -> libc::c_int;
254 }
255 extern "C" {
256 pub fn pcap_breakloop(arg1: *mut pcap_t);
257 }
258 extern "C" {
259 pub fn pcap_stats(arg1: *mut pcap_t, arg2: *mut pcap_stat) -> libc::c_int;
260 }
261 extern "C" {
262 pub fn pcap_setfilter(arg1: *mut pcap_t, arg2: *mut bpf_program) -> libc::c_int;
263 }
264 extern "C" {
265 pub fn pcap_setdirection(arg1: *mut pcap_t, arg2: pcap_direction_t) -> libc::c_int;
266 }
267 extern "C" {
268 pub fn pcap_getnonblock(arg1: *mut pcap_t, arg2: *mut libc::c_char) -> libc::c_int;
269 }
270 extern "C" {
271 pub fn pcap_setnonblock(
272 arg1: *mut pcap_t,
273 arg2: libc::c_int,
274 arg3: *mut libc::c_char,
275 ) -> libc::c_int;
276 }
277 extern "C" {
278 pub fn pcap_inject(arg1: *mut pcap_t, arg2: *const libc::c_void, arg3: usize) -> libc::c_int;
279 }
280 extern "C" {
281 pub fn pcap_sendpacket(
282 arg1: *mut pcap_t,
283 arg2: *const u_char,
284 arg3: libc::c_int,
285 ) -> libc::c_int;
286 }
287 extern "C" {
288 pub fn pcap_statustostr(arg1: libc::c_int) -> *const libc::c_char;
289 }
290 extern "C" {
291 pub fn pcap_strerror(arg1: libc::c_int) -> *const libc::c_char;
292 }
293 extern "C" {
294 pub fn pcap_geterr(arg1: *mut pcap_t) -> *mut libc::c_char;
295 }
296 extern "C" {
297 pub fn pcap_perror(arg1: *mut pcap_t, arg2: *const libc::c_char);
298 }
299 extern "C" {
300 pub fn pcap_compile(
301 arg1: *mut pcap_t,
302 arg2: *mut bpf_program,
303 arg3: *const libc::c_char,
304 arg4: libc::c_int,
305 arg5: bpf_u_int32,
306 ) -> libc::c_int;
307 }
308 extern "C" {
309 pub fn pcap_compile_nopcap(
310 arg1: libc::c_int,
311 arg2: libc::c_int,
312 arg3: *mut bpf_program,
313 arg4: *const libc::c_char,
314 arg5: libc::c_int,
315 arg6: bpf_u_int32,
316 ) -> libc::c_int;
317 }
318 extern "C" {
319 pub fn pcap_freecode(arg1: *mut bpf_program);
320 }
321 extern "C" {
322 pub fn pcap_offline_filter(
323 arg1: *const bpf_program,
324 arg2: *const pcap_pkthdr,
325 arg3: *const u_char,
326 ) -> libc::c_int;
327 }
328 extern "C" {
329 pub fn pcap_datalink(arg1: *mut pcap_t) -> libc::c_int;
330 }
331 extern "C" {
332 pub fn pcap_datalink_ext(arg1: *mut pcap_t) -> libc::c_int;
333 }
334 extern "C" {
335 pub fn pcap_list_datalinks(arg1: *mut pcap_t, arg2: *mut *mut libc::c_int) -> libc::c_int;
336 }
337 extern "C" {
338 pub fn pcap_set_datalink(arg1: *mut pcap_t, arg2: libc::c_int) -> libc::c_int;
339 }
340 extern "C" {
341 pub fn pcap_free_datalinks(arg1: *mut libc::c_int);
342 }
343 extern "C" {
344 pub fn pcap_datalink_name_to_val(arg1: *const libc::c_char) -> libc::c_int;
345 }
346 extern "C" {
347 pub fn pcap_datalink_val_to_name(arg1: libc::c_int) -> *const libc::c_char;
348 }
349 extern "C" {
350 pub fn pcap_datalink_val_to_description(arg1: libc::c_int) -> *const libc::c_char;
351 }
352 extern "C" {
353 pub fn pcap_snapshot(arg1: *mut pcap_t) -> libc::c_int;
354 }
355 extern "C" {
356 pub fn pcap_is_swapped(arg1: *mut pcap_t) -> libc::c_int;
357 }
358 extern "C" {
359 pub fn pcap_major_version(arg1: *mut pcap_t) -> libc::c_int;
360 }
361 extern "C" {
362 pub fn pcap_minor_version(arg1: *mut pcap_t) -> libc::c_int;
363 }
364 extern "C" {
365 pub fn pcap_file(arg1: *mut pcap_t) -> *mut FILE;
366 }
367 extern "C" {
368 pub fn pcap_fileno(arg1: *mut pcap_t) -> libc::c_int;
369 }
370 extern "C" {
371 pub fn pcap_dump_open(arg1: *mut pcap_t, arg2: *const libc::c_char) -> *mut pcap_dumper_t;
372 }
373 extern "C" {
374 pub fn pcap_dump_fopen(arg1: *mut pcap_t, fp: *mut FILE) -> *mut pcap_dumper_t;
375 }
376 extern "C" {
377 pub fn pcap_dump_open_append(
378 arg1: *mut pcap_t,
379 arg2: *const libc::c_char,
380 ) -> *mut pcap_dumper_t;
381 }
382 extern "C" {
383 pub fn pcap_dump_file(arg1: *mut pcap_dumper_t) -> *mut FILE;
384 }
385 extern "C" {
386 pub fn pcap_dump_ftell(arg1: *mut pcap_dumper_t) -> libc::c_long;
387 }
388 extern "C" {
389 pub fn pcap_dump_flush(arg1: *mut pcap_dumper_t) -> libc::c_int;
390 }
391 extern "C" {
392 pub fn pcap_dump_close(arg1: *mut pcap_dumper_t);
393 }
394 extern "C" {
395 pub fn pcap_dump(arg1: *mut u_char, arg2: *const pcap_pkthdr, arg3: *const u_char);
396 }
397 extern "C" {
398 pub fn pcap_findalldevs(arg1: *mut *mut pcap_if_t, arg2: *mut libc::c_char) -> libc::c_int;
399 }
400 extern "C" {
401 pub fn pcap_freealldevs(arg1: *mut pcap_if_t);
402 }
403 extern "C" {
404 pub fn pcap_lib_version() -> *const libc::c_char;
405 }
406 extern "C" {
407 pub fn pcap_get_selectable_fd(arg1: *mut pcap_t) -> libc::c_int;
408 }
409 extern "C" {
410 pub fn pcap_get_selectable_fd_list(
411 arg1: *mut pcap_t,
412 arg2: *mut *mut libc::c_int,
413 ) -> libc::c_int;
414 }
415 extern "C" {
416 pub fn pcap_free_selectable_fd_list(arg1: *mut libc::c_int);
417 }