1#![allow(dead_code)]
3#![allow(non_camel_case_types)]
4#![allow(non_snake_case)]
5#![allow(non_upper_case_globals)]
6
7pub type __u_char = ::libc::c_uchar;
8pub type __u_short = ::libc::c_ushort;
9pub type __u_int = ::libc::c_uint;
10pub type __u_long = ::libc::c_ulong;
11pub type __int8_t = ::libc::c_char;
12pub type __uint8_t = ::libc::c_uchar;
13pub type __int16_t = ::libc::c_short;
14pub type __uint16_t = ::libc::c_ushort;
15pub type __int32_t = ::libc::c_int;
16pub type __uint32_t = ::libc::c_uint;
17pub type __int64_t = ::libc::c_long;
18pub type __uint64_t = ::libc::c_ulong;
19pub type __quad_t = ::libc::c_long;
20pub type __u_quad_t = ::libc::c_ulong;
21pub type __dev_t = ::libc::c_ulong;
22pub type __uid_t = ::libc::c_uint;
23pub type __gid_t = ::libc::c_uint;
24pub type __ino_t = ::libc::c_ulong;
25pub type __ino64_t = ::libc::c_ulong;
26pub type __mode_t = ::libc::c_uint;
27pub type __nlink_t = ::libc::c_ulong;
28pub type __off_t = ::libc::c_long;
29pub type __off64_t = ::libc::c_long;
30pub type __pid_t = ::libc::c_int;
31#[repr(C)]
32#[derive(Copy, Clone)]
33pub struct Struct_Unnamed1 {
34 pub __val: [::libc::c_int; 2usize],
35}
36impl ::std::default::Default for Struct_Unnamed1 {
37 fn default() -> Struct_Unnamed1 { unsafe { ::std::mem::zeroed() } }
38}
39pub type __fsid_t = Struct_Unnamed1;
40pub type __clock_t = ::libc::c_long;
41pub type __rlim_t = ::libc::c_ulong;
42pub type __rlim64_t = ::libc::c_ulong;
43pub type __id_t = ::libc::c_uint;
44pub type __time_t = ::libc::c_long;
45pub type __useconds_t = ::libc::c_uint;
46pub type __suseconds_t = ::libc::c_long;
47pub type __daddr_t = ::libc::c_int;
48pub type __key_t = ::libc::c_int;
49pub type __clockid_t = ::libc::c_int;
50pub type __timer_t = *mut ::libc::c_void;
51pub type __blksize_t = ::libc::c_long;
52pub type __blkcnt_t = ::libc::c_long;
53pub type __blkcnt64_t = ::libc::c_long;
54pub type __fsblkcnt_t = ::libc::c_ulong;
55pub type __fsblkcnt64_t = ::libc::c_ulong;
56pub type __fsfilcnt_t = ::libc::c_ulong;
57pub type __fsfilcnt64_t = ::libc::c_ulong;
58pub type __fsword_t = ::libc::c_long;
59pub type __ssize_t = ::libc::c_long;
60pub type __syscall_slong_t = ::libc::c_long;
61pub type __syscall_ulong_t = ::libc::c_ulong;
62pub type __loff_t = __off64_t;
63pub type __qaddr_t = *mut __quad_t;
64pub type __caddr_t = *mut ::libc::c_char;
65pub type __intptr_t = ::libc::c_long;
66pub type __socklen_t = ::libc::c_uint;
67pub type u_char = __u_char;
68pub type u_short = __u_short;
69pub type u_int = __u_int;
70pub type u_long = __u_long;
71pub type quad_t = __quad_t;
72pub type u_quad_t = __u_quad_t;
73pub type fsid_t = __fsid_t;
74pub type loff_t = __loff_t;
75pub type ino_t = __ino_t;
76pub type dev_t = __dev_t;
77pub type gid_t = __gid_t;
78pub type mode_t = __mode_t;
79pub type nlink_t = __nlink_t;
80pub type uid_t = __uid_t;
81pub type off_t = __off_t;
82pub type pid_t = __pid_t;
83pub type id_t = __id_t;
84pub type ssize_t = __ssize_t;
85pub type daddr_t = __daddr_t;
86pub type caddr_t = __caddr_t;
87pub type key_t = __key_t;
88pub type clock_t = __clock_t;
89pub type time_t = __time_t;
90pub type clockid_t = __clockid_t;
91pub type timer_t = __timer_t;
92pub type size_t = ::libc::size_t;
93pub type ulong = ::libc::c_ulong;
94pub type ushort = ::libc::c_ushort;
95pub type _uint = ::libc::c_uint;
96pub type int8_t = ::libc::c_char;
97pub type int16_t = ::libc::c_short;
98pub type int32_t = ::libc::c_int;
99pub type int64_t = ::libc::c_long;
100pub type u_int8_t = ::libc::c_uchar;
101pub type u_int16_t = ::libc::c_ushort;
102pub type u_int32_t = ::libc::c_uint;
103pub type u_int64_t = ::libc::c_ulong;
104pub type register_t = ::libc::c_long;
105pub type __sig_atomic_t = ::libc::c_int;
106#[repr(C)]
107#[derive(Copy, Clone)]
108pub struct Struct_Unnamed2 {
109 pub __val: [::libc::c_ulong; 16usize],
110}
111impl ::std::default::Default for Struct_Unnamed2 {
112 fn default() -> Struct_Unnamed2 { unsafe { ::std::mem::zeroed() } }
113}
114pub type __sigset_t = Struct_Unnamed2;
115pub type sigset_t = __sigset_t;
116#[repr(C)]
117#[derive(Copy, Clone)]
118pub struct Struct_timespec {
119 pub tv_sec: __time_t,
120 pub tv_nsec: __syscall_slong_t,
121}
122impl ::std::default::Default for Struct_timespec {
123 fn default() -> Struct_timespec { unsafe { ::std::mem::zeroed() } }
124}
125#[repr(C)]
126#[derive(Copy, Clone)]
127pub struct Struct_timeval {
128 pub tv_sec: __time_t,
129 pub tv_usec: __suseconds_t,
130}
131impl ::std::default::Default for Struct_timeval {
132 fn default() -> Struct_timeval { unsafe { ::std::mem::zeroed() } }
133}
134pub type suseconds_t = __suseconds_t;
135pub type __fd_mask = ::libc::c_long;
136#[repr(C)]
137#[derive(Copy, Clone)]
138pub struct Struct_Unnamed3 {
139 pub __fds_bits: [__fd_mask; 16usize],
140}
141impl ::std::default::Default for Struct_Unnamed3 {
142 fn default() -> Struct_Unnamed3 { unsafe { ::std::mem::zeroed() } }
143}
144pub type fd_set = Struct_Unnamed3;
145pub type fd_mask = __fd_mask;
146pub type blksize_t = __blksize_t;
147pub type blkcnt_t = __blkcnt_t;
148pub type fsblkcnt_t = __fsblkcnt_t;
149pub type fsfilcnt_t = __fsfilcnt_t;
150pub type pthread_t = ::libc::c_ulong;
151#[repr(C)]
152#[derive(Copy, Clone)]
153pub struct Union_pthread_attr_t {
154 pub _bindgen_data_: [u64; 7usize],
155}
156impl Union_pthread_attr_t {
157 pub unsafe fn __size(&mut self) -> *mut [::libc::c_char; 56usize] {
158 ::std::mem::transmute(&self._bindgen_data_)
159 }
160 pub unsafe fn __align(&mut self) -> *mut ::libc::c_long {
161 ::std::mem::transmute(&self._bindgen_data_)
162 }
163}
164impl ::std::default::Default for Union_pthread_attr_t {
165 fn default() -> Union_pthread_attr_t { unsafe { ::std::mem::zeroed() } }
166}
167pub type pthread_attr_t = Union_pthread_attr_t;
168#[repr(C)]
169#[derive(Copy, Clone)]
170pub struct Struct___pthread_internal_list {
171 pub __prev: *mut Struct___pthread_internal_list,
172 pub __next: *mut Struct___pthread_internal_list,
173}
174impl ::std::default::Default for Struct___pthread_internal_list {
175 fn default() -> Struct___pthread_internal_list {
176 unsafe { ::std::mem::zeroed() }
177 }
178}
179pub type __pthread_list_t = Struct___pthread_internal_list;
180#[repr(C)]
181#[derive(Copy, Clone)]
182pub struct Union_Unnamed4 {
183 pub _bindgen_data_: [u64; 5usize],
184}
185impl Union_Unnamed4 {
186 pub unsafe fn __data(&mut self) -> *mut Struct___pthread_mutex_s {
187 ::std::mem::transmute(&self._bindgen_data_)
188 }
189 pub unsafe fn __size(&mut self) -> *mut [::libc::c_char; 40usize] {
190 ::std::mem::transmute(&self._bindgen_data_)
191 }
192 pub unsafe fn __align(&mut self) -> *mut ::libc::c_long {
193 ::std::mem::transmute(&self._bindgen_data_)
194 }
195}
196impl ::std::default::Default for Union_Unnamed4 {
197 fn default() -> Union_Unnamed4 { unsafe { ::std::mem::zeroed() } }
198}
199#[repr(C)]
200#[derive(Copy, Clone)]
201pub struct Struct___pthread_mutex_s {
202 pub __lock: ::libc::c_int,
203 pub __count: ::libc::c_uint,
204 pub __owner: ::libc::c_int,
205 pub __nusers: ::libc::c_uint,
206 pub __kind: ::libc::c_int,
207 pub __spins: ::libc::c_short,
208 pub __elision: ::libc::c_short,
209 pub __list: __pthread_list_t,
210}
211impl ::std::default::Default for Struct___pthread_mutex_s {
212 fn default() -> Struct___pthread_mutex_s {
213 unsafe { ::std::mem::zeroed() }
214 }
215}
216pub type pthread_mutex_t = Union_Unnamed4;
217#[repr(C)]
218#[derive(Copy, Clone)]
219pub struct Union_Unnamed5 {
220 pub _bindgen_data_: [u32; 1usize],
221}
222impl Union_Unnamed5 {
223 pub unsafe fn __size(&mut self) -> *mut [::libc::c_char; 4usize] {
224 ::std::mem::transmute(&self._bindgen_data_)
225 }
226 pub unsafe fn __align(&mut self) -> *mut ::libc::c_int {
227 ::std::mem::transmute(&self._bindgen_data_)
228 }
229}
230impl ::std::default::Default for Union_Unnamed5 {
231 fn default() -> Union_Unnamed5 { unsafe { ::std::mem::zeroed() } }
232}
233pub type pthread_mutexattr_t = Union_Unnamed5;
234#[repr(C)]
235#[derive(Copy, Clone)]
236pub struct Union_Unnamed6 {
237 pub _bindgen_data_: [u64; 6usize],
238}
239impl Union_Unnamed6 {
240 pub unsafe fn __data(&mut self) -> *mut Struct_Unnamed7 {
241 ::std::mem::transmute(&self._bindgen_data_)
242 }
243 pub unsafe fn __size(&mut self) -> *mut [::libc::c_char; 48usize] {
244 ::std::mem::transmute(&self._bindgen_data_)
245 }
246 pub unsafe fn __align(&mut self) -> *mut ::libc::c_longlong {
247 ::std::mem::transmute(&self._bindgen_data_)
248 }
249}
250impl ::std::default::Default for Union_Unnamed6 {
251 fn default() -> Union_Unnamed6 { unsafe { ::std::mem::zeroed() } }
252}
253#[repr(C)]
254#[derive(Copy, Clone)]
255pub struct Struct_Unnamed7 {
256 pub __lock: ::libc::c_int,
257 pub __futex: ::libc::c_uint,
258 pub __total_seq: ::libc::c_ulonglong,
259 pub __wakeup_seq: ::libc::c_ulonglong,
260 pub __woken_seq: ::libc::c_ulonglong,
261 pub __mutex: *mut ::libc::c_void,
262 pub __nwaiters: ::libc::c_uint,
263 pub __broadcast_seq: ::libc::c_uint,
264}
265impl ::std::default::Default for Struct_Unnamed7 {
266 fn default() -> Struct_Unnamed7 { unsafe { ::std::mem::zeroed() } }
267}
268pub type pthread_cond_t = Union_Unnamed6;
269#[repr(C)]
270#[derive(Copy, Clone)]
271pub struct Union_Unnamed8 {
272 pub _bindgen_data_: [u32; 1usize],
273}
274impl Union_Unnamed8 {
275 pub unsafe fn __size(&mut self) -> *mut [::libc::c_char; 4usize] {
276 ::std::mem::transmute(&self._bindgen_data_)
277 }
278 pub unsafe fn __align(&mut self) -> *mut ::libc::c_int {
279 ::std::mem::transmute(&self._bindgen_data_)
280 }
281}
282impl ::std::default::Default for Union_Unnamed8 {
283 fn default() -> Union_Unnamed8 { unsafe { ::std::mem::zeroed() } }
284}
285pub type pthread_condattr_t = Union_Unnamed8;
286pub type pthread_key_t = ::libc::c_uint;
287pub type pthread_once_t = ::libc::c_int;
288#[repr(C)]
289#[derive(Copy, Clone)]
290pub struct Union_Unnamed9 {
291 pub _bindgen_data_: [u64; 7usize],
292}
293impl Union_Unnamed9 {
294 pub unsafe fn __data(&mut self) -> *mut Struct_Unnamed10 {
295 ::std::mem::transmute(&self._bindgen_data_)
296 }
297 pub unsafe fn __size(&mut self) -> *mut [::libc::c_char; 56usize] {
298 ::std::mem::transmute(&self._bindgen_data_)
299 }
300 pub unsafe fn __align(&mut self) -> *mut ::libc::c_long {
301 ::std::mem::transmute(&self._bindgen_data_)
302 }
303}
304impl ::std::default::Default for Union_Unnamed9 {
305 fn default() -> Union_Unnamed9 { unsafe { ::std::mem::zeroed() } }
306}
307#[repr(C)]
308#[derive(Copy, Clone)]
309pub struct Struct_Unnamed10 {
310 pub __lock: ::libc::c_int,
311 pub __nr_readers: ::libc::c_uint,
312 pub __readers_wakeup: ::libc::c_uint,
313 pub __writer_wakeup: ::libc::c_uint,
314 pub __nr_readers_queued: ::libc::c_uint,
315 pub __nr_writers_queued: ::libc::c_uint,
316 pub __writer: ::libc::c_int,
317 pub __shared: ::libc::c_int,
318 pub __pad1: ::libc::c_ulong,
319 pub __pad2: ::libc::c_ulong,
320 pub __flags: ::libc::c_uint,
321}
322impl ::std::default::Default for Struct_Unnamed10 {
323 fn default() -> Struct_Unnamed10 { unsafe { ::std::mem::zeroed() } }
324}
325pub type pthread_rwlock_t = Union_Unnamed9;
326#[repr(C)]
327#[derive(Copy, Clone)]
328pub struct Union_Unnamed11 {
329 pub _bindgen_data_: [u64; 1usize],
330}
331impl Union_Unnamed11 {
332 pub unsafe fn __size(&mut self) -> *mut [::libc::c_char; 8usize] {
333 ::std::mem::transmute(&self._bindgen_data_)
334 }
335 pub unsafe fn __align(&mut self) -> *mut ::libc::c_long {
336 ::std::mem::transmute(&self._bindgen_data_)
337 }
338}
339impl ::std::default::Default for Union_Unnamed11 {
340 fn default() -> Union_Unnamed11 { unsafe { ::std::mem::zeroed() } }
341}
342pub type pthread_rwlockattr_t = Union_Unnamed11;
343pub type pthread_spinlock_t = ::libc::c_int;
344#[repr(C)]
345#[derive(Copy, Clone)]
346pub struct Union_Unnamed12 {
347 pub _bindgen_data_: [u64; 4usize],
348}
349impl Union_Unnamed12 {
350 pub unsafe fn __size(&mut self) -> *mut [::libc::c_char; 32usize] {
351 ::std::mem::transmute(&self._bindgen_data_)
352 }
353 pub unsafe fn __align(&mut self) -> *mut ::libc::c_long {
354 ::std::mem::transmute(&self._bindgen_data_)
355 }
356}
357impl ::std::default::Default for Union_Unnamed12 {
358 fn default() -> Union_Unnamed12 { unsafe { ::std::mem::zeroed() } }
359}
360pub type pthread_barrier_t = Union_Unnamed12;
361#[repr(C)]
362#[derive(Copy, Clone)]
363pub struct Union_Unnamed13 {
364 pub _bindgen_data_: [u32; 1usize],
365}
366impl Union_Unnamed13 {
367 pub unsafe fn __size(&mut self) -> *mut [::libc::c_char; 4usize] {
368 ::std::mem::transmute(&self._bindgen_data_)
369 }
370 pub unsafe fn __align(&mut self) -> *mut ::libc::c_int {
371 ::std::mem::transmute(&self._bindgen_data_)
372 }
373}
374impl ::std::default::Default for Union_Unnamed13 {
375 fn default() -> Union_Unnamed13 { unsafe { ::std::mem::zeroed() } }
376}
377pub type pthread_barrierattr_t = Union_Unnamed13;
378#[repr(C)]
379#[derive(Copy, Clone)]
380pub struct Struct_timezone {
381 pub tz_minuteswest: ::libc::c_int,
382 pub tz_dsttime: ::libc::c_int,
383}
384impl ::std::default::Default for Struct_timezone {
385 fn default() -> Struct_timezone { unsafe { ::std::mem::zeroed() } }
386}
387pub type __timezone_ptr_t = *mut Struct_timezone;
388pub type Enum___itimer_which = ::libc::c_uint;
389pub const ITIMER_REAL: ::libc::c_uint = 0;
390pub const ITIMER_VIRTUAL: ::libc::c_uint = 1;
391pub const ITIMER_PROF: ::libc::c_uint = 2;
392#[repr(C)]
393#[derive(Copy, Clone)]
394pub struct Struct_itimerval {
395 pub it_interval: Struct_timeval,
396 pub it_value: Struct_timeval,
397}
398impl ::std::default::Default for Struct_itimerval {
399 fn default() -> Struct_itimerval { unsafe { ::std::mem::zeroed() } }
400}
401pub type __itimer_which_t = ::libc::c_int;
402pub type bpf_int32 = ::libc::c_int;
403pub type bpf_u_int32 = u_int;
404#[repr(C)]
405#[derive(Copy, Clone)]
406pub struct Struct_bpf_program {
407 pub bf_len: u_int,
408 pub bf_insns: *mut Struct_bpf_insn,
409}
410impl ::std::default::Default for Struct_bpf_program {
411 fn default() -> Struct_bpf_program { unsafe { ::std::mem::zeroed() } }
412}
413#[repr(C)]
414#[derive(Copy, Clone)]
415pub struct Struct_bpf_insn {
416 pub code: u_short,
417 pub jt: u_char,
418 pub jf: u_char,
419 pub k: bpf_u_int32,
420}
421impl ::std::default::Default for Struct_bpf_insn {
422 fn default() -> Struct_bpf_insn { unsafe { ::std::mem::zeroed() } }
423}
424pub type FILE = Struct__IO_FILE;
425pub type __FILE = Struct__IO_FILE;
426#[repr(C)]
427#[derive(Copy, Clone)]
428pub struct Struct_Unnamed14 {
429 pub __count: ::libc::c_int,
430 pub __value: Union_Unnamed15,
431}
432impl ::std::default::Default for Struct_Unnamed14 {
433 fn default() -> Struct_Unnamed14 { unsafe { ::std::mem::zeroed() } }
434}
435#[repr(C)]
436#[derive(Copy, Clone)]
437pub struct Union_Unnamed15 {
438 pub _bindgen_data_: [u32; 1usize],
439}
440impl Union_Unnamed15 {
441 pub unsafe fn __wch(&mut self) -> *mut ::libc::c_uint {
442 ::std::mem::transmute(&self._bindgen_data_)
443 }
444 pub unsafe fn __wchb(&mut self) -> *mut [::libc::c_char; 4usize] {
445 ::std::mem::transmute(&self._bindgen_data_)
446 }
447}
448impl ::std::default::Default for Union_Unnamed15 {
449 fn default() -> Union_Unnamed15 { unsafe { ::std::mem::zeroed() } }
450}
451pub type __mbstate_t = Struct_Unnamed14;
452#[repr(C)]
453#[derive(Copy, Clone)]
454pub struct Struct_Unnamed16 {
455 pub __pos: __off_t,
456 pub __state: __mbstate_t,
457}
458impl ::std::default::Default for Struct_Unnamed16 {
459 fn default() -> Struct_Unnamed16 { unsafe { ::std::mem::zeroed() } }
460}
461pub type _G_fpos_t = Struct_Unnamed16;
462#[repr(C)]
463#[derive(Copy, Clone)]
464pub struct Struct_Unnamed17 {
465 pub __pos: __off64_t,
466 pub __state: __mbstate_t,
467}
468impl ::std::default::Default for Struct_Unnamed17 {
469 fn default() -> Struct_Unnamed17 { unsafe { ::std::mem::zeroed() } }
470}
471pub type _G_fpos64_t = Struct_Unnamed17;
472pub type va_list = __gnuc_va_list;
473pub type __gnuc_va_list = __builtin_va_list;
474pub enum Struct__IO_jump_t { }
475pub type _IO_lock_t = ::libc::c_void;
476#[repr(C)]
477#[derive(Copy, Clone)]
478pub struct Struct__IO_marker {
479 pub _next: *mut Struct__IO_marker,
480 pub _sbuf: *mut Struct__IO_FILE,
481 pub _pos: ::libc::c_int,
482}
483impl ::std::default::Default for Struct__IO_marker {
484 fn default() -> Struct__IO_marker { unsafe { ::std::mem::zeroed() } }
485}
486pub type Enum___codecvt_result = ::libc::c_uint;
487pub const __codecvt_ok: ::libc::c_uint = 0;
488pub const __codecvt_partial: ::libc::c_uint = 1;
489pub const __codecvt_error: ::libc::c_uint = 2;
490pub const __codecvt_noconv: ::libc::c_uint = 3;
491#[repr(C)]
492#[derive(Copy, Clone)]
493pub struct Struct__IO_FILE {
494 pub _flags: ::libc::c_int,
495 pub _IO_read_ptr: *mut ::libc::c_char,
496 pub _IO_read_end: *mut ::libc::c_char,
497 pub _IO_read_base: *mut ::libc::c_char,
498 pub _IO_write_base: *mut ::libc::c_char,
499 pub _IO_write_ptr: *mut ::libc::c_char,
500 pub _IO_write_end: *mut ::libc::c_char,
501 pub _IO_buf_base: *mut ::libc::c_char,
502 pub _IO_buf_end: *mut ::libc::c_char,
503 pub _IO_save_base: *mut ::libc::c_char,
504 pub _IO_backup_base: *mut ::libc::c_char,
505 pub _IO_save_end: *mut ::libc::c_char,
506 pub _markers: *mut Struct__IO_marker,
507 pub _chain: *mut Struct__IO_FILE,
508 pub _fileno: ::libc::c_int,
509 pub _flags2: ::libc::c_int,
510 pub _old_offset: __off_t,
511 pub _cur_column: ::libc::c_ushort,
512 pub _vtable_offset: ::libc::c_char,
513 pub _shortbuf: [::libc::c_char; 1usize],
514 pub _lock: *mut _IO_lock_t,
515 pub _offset: __off64_t,
516 pub __pad1: *mut ::libc::c_void,
517 pub __pad2: *mut ::libc::c_void,
518 pub __pad3: *mut ::libc::c_void,
519 pub __pad4: *mut ::libc::c_void,
520 pub __pad5: size_t,
521 pub _mode: ::libc::c_int,
522 pub _unused2: [::libc::c_char; 20usize],
523}
524impl ::std::default::Default for Struct__IO_FILE {
525 fn default() -> Struct__IO_FILE { unsafe { ::std::mem::zeroed() } }
526}
527pub type _IO_FILE = Struct__IO_FILE;
528pub enum Struct__IO_FILE_plus { }
529pub type __io_read_fn =
530 extern "C" fn
531 (__cookie: *mut ::libc::c_void, __buf: *mut ::libc::c_char,
532 __nbytes: size_t) -> __ssize_t;
533pub type __io_write_fn =
534 extern "C" fn
535 (__cookie: *mut ::libc::c_void, __buf: *const ::libc::c_char,
536 __n: size_t) -> __ssize_t;
537pub type __io_seek_fn =
538 extern "C" fn
539 (__cookie: *mut ::libc::c_void, __pos: *mut __off64_t,
540 __w: ::libc::c_int) -> ::libc::c_int;
541pub type __io_close_fn =
542 extern "C" fn(__cookie: *mut ::libc::c_void) -> ::libc::c_int;
543pub type fpos_t = _G_fpos_t;
544pub enum Struct_pcap { }
545pub type pcap_t = Struct_pcap;
546pub enum Struct_pcap_dumper { }
547pub type pcap_dumper_t = Struct_pcap_dumper;
548pub type pcap_if_t = Struct_pcap_if;
549pub type pcap_addr_t = Struct_pcap_addr;
550#[repr(C)]
551#[derive(Copy, Clone)]
552pub struct Struct_pcap_file_header {
553 pub magic: bpf_u_int32,
554 pub version_major: u_short,
555 pub version_minor: u_short,
556 pub thiszone: bpf_int32,
557 pub sigfigs: bpf_u_int32,
558 pub snaplen: bpf_u_int32,
559 pub linktype: bpf_u_int32,
560}
561impl ::std::default::Default for Struct_pcap_file_header {
562 fn default() -> Struct_pcap_file_header {
563 unsafe { ::std::mem::zeroed() }
564 }
565}
566pub type Enum_Unnamed18 = ::libc::c_uint;
567pub const PCAP_D_INOUT: ::libc::c_uint = 0;
568pub const PCAP_D_IN: ::libc::c_uint = 1;
569pub const PCAP_D_OUT: ::libc::c_uint = 2;
570pub type pcap_direction_t = Enum_Unnamed18;
571#[repr(C)]
572#[derive(Copy, Clone)]
573pub struct Struct_pcap_pkthdr {
574 pub ts: Struct_timeval,
575 pub caplen: bpf_u_int32,
576 pub len: bpf_u_int32,
577}
578impl ::std::default::Default for Struct_pcap_pkthdr {
579 fn default() -> Struct_pcap_pkthdr { unsafe { ::std::mem::zeroed() } }
580}
581
582#[repr(C)]
583#[derive(Copy, Clone)]
584pub struct PacketHeader {
586 pub ts: ::libc::timeval,
587 pub caplen: u32,
588 pub len: u32,
589}
590
591impl ::std::fmt::Debug for PacketHeader {
592 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
593 write!(f, "PacketHeader {{ ts: {}.{:06}, caplen: {}, len: {} }}",
594 self.ts.tv_sec, self.ts.tv_usec, self.caplen, self.len)
595 }
596}
597
598#[test]
599fn packet_hdr_eq() {
600 use std::mem::size_of;
601
602 assert_eq!(size_of::<PacketHeader>(), size_of::<Struct_pcap_pkthdr>())
603}
604
605#[repr(C)]
606#[derive(Copy, Clone)]
607pub struct Struct_pcap_stat {
608 pub ps_recv: u_int,
609 pub ps_drop: u_int,
610 pub ps_ifdrop: u_int,
611}
612impl ::std::default::Default for Struct_pcap_stat {
613 fn default() -> Struct_pcap_stat { unsafe { ::std::mem::zeroed() } }
614}
615#[repr(C)]
616#[derive(Copy, Clone)]
617pub struct Struct_pcap_if {
618 pub next: *mut Struct_pcap_if,
619 pub name: *mut ::libc::c_char,
620 pub description: *mut ::libc::c_char,
621 pub addresses: *mut Struct_pcap_addr,
622 pub flags: bpf_u_int32,
623}
624impl ::std::default::Default for Struct_pcap_if {
625 fn default() -> Struct_pcap_if { unsafe { ::std::mem::zeroed() } }
626}
627pub enum Struct_sockaddr { }
628#[repr(C)]
629#[derive(Copy, Clone)]
630pub struct Struct_pcap_addr {
631 pub next: *mut Struct_pcap_addr,
632 pub addr: *mut Struct_sockaddr,
633 pub netmask: *mut Struct_sockaddr,
634 pub broadaddr: *mut Struct_sockaddr,
635 pub dstaddr: *mut Struct_sockaddr,
636}
637impl ::std::default::Default for Struct_pcap_addr {
638 fn default() -> Struct_pcap_addr { unsafe { ::std::mem::zeroed() } }
639}
640pub type pcap_handler =
641 ::std::option::Option<extern "C" fn
642 (arg1: *mut u_char,
643 arg2: *const Struct_pcap_pkthdr,
644 arg3: *const u_char) -> ()>;
645pub type __builtin_va_list = [__va_list_tag; 1usize];
646pub type __va_list_tag = Struct___va_list_tag;
647#[repr(C)]
648#[derive(Copy, Clone)]
649pub struct Struct___va_list_tag {
650 pub gp_offset: ::libc::c_uint,
651 pub fp_offset: ::libc::c_uint,
652 pub overflow_arg_area: *mut ::libc::c_void,
653 pub reg_save_area: *mut ::libc::c_void,
654}
655impl ::std::default::Default for Struct___va_list_tag {
656 fn default() -> Struct___va_list_tag { unsafe { ::std::mem::zeroed() } }
657}
658
659extern "C" {
660 pub fn pcap_lookupdev(arg1: *mut ::libc::c_char) -> *mut ::libc::c_char;
661 pub fn pcap_create(arg1: *const ::libc::c_char, arg2: *mut ::libc::c_char)
665 -> *mut pcap_t;
666 pub fn pcap_set_snaplen(arg1: *mut pcap_t, arg2: ::libc::c_int)
667 -> ::libc::c_int;
668 pub fn pcap_set_promisc(arg1: *mut pcap_t, arg2: ::libc::c_int)
669 -> ::libc::c_int;
670 pub fn pcap_set_timeout(arg1: *mut pcap_t, arg2: ::libc::c_int)
672 -> ::libc::c_int;
673 #[cfg(not(windows))]
674 pub fn pcap_set_tstamp_type(arg1: *mut pcap_t, arg2: ::libc::c_int)
675 -> ::libc::c_int;
676 pub fn pcap_set_buffer_size(arg1: *mut pcap_t, arg2: ::libc::c_int)
679 -> ::libc::c_int;
680 #[cfg(not(windows))]
681 pub fn pcap_set_tstamp_precision(arg1: *mut pcap_t, arg2: ::libc::c_int)
682 -> ::libc::c_int;
683 pub fn pcap_activate(arg1: *mut pcap_t) -> ::libc::c_int;
685 pub fn pcap_open_dead(arg1: ::libc::c_int, arg2: ::libc::c_int)
699 -> *mut pcap_t;
700 pub fn pcap_open_dead_with_tstamp_precision(arg1: ::libc::c_int,
701 arg2: ::libc::c_int,
702 arg3: u_int) -> *mut pcap_t;
703 pub fn pcap_open_offline_with_tstamp_precision(arg1:
704 *const ::libc::c_char,
705 arg2: u_int,
706 arg3: *mut ::libc::c_char)
707 -> *mut pcap_t;
708 pub fn pcap_open_offline(arg1: *const ::libc::c_char,
709 arg2: *mut ::libc::c_char) -> *mut pcap_t;
710 pub fn pcap_close(arg1: *mut pcap_t) -> ();
717 pub fn pcap_next_ex(arg1: *mut pcap_t, arg2: *mut *mut Struct_pcap_pkthdr,
725 arg3: *mut *const u_char) -> ::libc::c_int;
726 pub fn pcap_stats(arg1: *mut pcap_t, arg2: *mut Struct_pcap_stat)
728 -> ::libc::c_int;
729 pub fn pcap_setfilter(arg1: *mut pcap_t, arg2: *mut Struct_bpf_program)
730 -> ::libc::c_int;
731 pub fn pcap_setdirection(arg1: *mut pcap_t, arg2: pcap_direction_t)
732 -> ::libc::c_int;
733 pub fn pcap_sendpacket(arg1: *mut pcap_t, arg2: *const u_char,
738 arg3: ::libc::c_int) -> ::libc::c_int;
739 pub fn pcap_geterr(arg1: *mut pcap_t) -> *mut ::libc::c_char;
742 pub fn pcap_compile(arg1: *mut pcap_t, arg2: *mut Struct_bpf_program,
744 arg3: *const ::libc::c_char, arg4: ::libc::c_int,
745 arg5: bpf_u_int32) -> ::libc::c_int;
746 pub fn pcap_freecode(arg1: *mut Struct_bpf_program) -> ();
752 pub fn pcap_datalink(arg1: *mut pcap_t) -> ::libc::c_int;
756 pub fn pcap_list_datalinks(arg1: *mut pcap_t,
758 arg2: *mut *mut ::libc::c_int)
759 -> ::libc::c_int;
760 pub fn pcap_set_datalink(arg1: *mut pcap_t, arg2: ::libc::c_int)
761 -> ::libc::c_int;
762 pub fn pcap_free_datalinks(arg1: *mut ::libc::c_int) -> ();
763 pub fn pcap_datalink_val_to_name(arg1: ::libc::c_int)
766 -> *const ::libc::c_char;
767 pub fn pcap_datalink_val_to_description(arg1: ::libc::c_int)
768 -> *const ::libc::c_char;
769 pub fn pcap_fileno(arg1: *mut pcap_t) -> ::libc::c_int;
775 pub fn pcap_dump_open(arg1: *mut pcap_t, arg2: *const ::libc::c_char)
776 -> *mut pcap_dumper_t;
777 pub fn pcap_dump_close(arg1: *mut pcap_dumper_t) -> ();
783 pub fn pcap_dump(arg1: *mut u_char, arg2: *const Struct_pcap_pkthdr,
784 arg3: *const u_char) -> ();
785 pub fn pcap_findalldevs(arg1: *mut *mut pcap_if_t,
786 arg2: *mut ::libc::c_char) -> ::libc::c_int;
787 pub fn pcap_freealldevs(arg1: *mut pcap_if_t) -> ();
788 }
795
796
797
798
799#[cfg(target_os = "windows")]
800#[link(name = "wpcap")]
801extern {}
802
803#[cfg(not(target_os = "windows"))]
804#[link(name = "pcap")]
805extern {
806 pub fn pcap_set_rfmon(arg1: *mut pcap_t, arg2: ::libc::c_int)
810 -> ::libc::c_int;
811}