# 1 "src/tools/tor-fw-helper/tor-fw-helper.c" # 1 "" # 1 "" # 1 "/usr/include/stdc-predef.h" 1 3 4 # 1 "" 2 # 1 "src/tools/tor-fw-helper/tor-fw-helper.c" # 16 "src/tools/tor-fw-helper/tor-fw-helper.c" # 1 "./orconfig.h" 1 # 17 "src/tools/tor-fw-helper/tor-fw-helper.c" 2 # 1 "/usr/include/stdio.h" 1 3 4 # 27 "/usr/include/stdio.h" 3 4 # 1 "/usr/include/features.h" 1 3 4 # 366 "/usr/include/features.h" 3 4 # 1 "/usr/include/sys/cdefs.h" 1 3 4 # 402 "/usr/include/sys/cdefs.h" 3 4 # 1 "/usr/include/bits/wordsize.h" 1 3 4 # 403 "/usr/include/sys/cdefs.h" 2 3 4 # 367 "/usr/include/features.h" 2 3 4 # 390 "/usr/include/features.h" 3 4 # 1 "/usr/include/gnu/stubs.h" 1 3 4 # 10 "/usr/include/gnu/stubs.h" 3 4 # 1 "/usr/include/gnu/stubs-64.h" 1 3 4 # 11 "/usr/include/gnu/stubs.h" 2 3 4 # 391 "/usr/include/features.h" 2 3 4 # 28 "/usr/include/stdio.h" 2 3 4 # 1 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include/stddef.h" 1 3 4 # 212 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include/stddef.h" 3 4 typedef long unsigned int size_t; # 34 "/usr/include/stdio.h" 2 3 4 # 1 "/usr/include/bits/types.h" 1 3 4 # 27 "/usr/include/bits/types.h" 3 4 # 1 "/usr/include/bits/wordsize.h" 1 3 4 # 28 "/usr/include/bits/types.h" 2 3 4 typedef unsigned char __u_char; typedef unsigned short int __u_short; typedef unsigned int __u_int; typedef unsigned long int __u_long; typedef signed char __int8_t; typedef unsigned char __uint8_t; typedef signed short int __int16_t; typedef unsigned short int __uint16_t; typedef signed int __int32_t; typedef unsigned int __uint32_t; typedef signed long int __int64_t; typedef unsigned long int __uint64_t; typedef long int __quad_t; typedef unsigned long int __u_quad_t; # 121 "/usr/include/bits/types.h" 3 4 # 1 "/usr/include/bits/typesizes.h" 1 3 4 # 122 "/usr/include/bits/types.h" 2 3 4 typedef unsigned long int __dev_t; typedef unsigned int __uid_t; typedef unsigned int __gid_t; typedef unsigned long int __ino_t; typedef unsigned long int __ino64_t; typedef unsigned int __mode_t; typedef unsigned long int __nlink_t; typedef long int __off_t; typedef long int __off64_t; typedef int __pid_t; typedef struct { int __val[2]; } __fsid_t; typedef long int __clock_t; typedef unsigned long int __rlim_t; typedef unsigned long int __rlim64_t; typedef unsigned int __id_t; typedef long int __time_t; typedef unsigned int __useconds_t; typedef long int __suseconds_t; typedef int __daddr_t; typedef int __key_t; typedef int __clockid_t; typedef void * __timer_t; typedef long int __blksize_t; typedef long int __blkcnt_t; typedef long int __blkcnt64_t; typedef unsigned long int __fsblkcnt_t; typedef unsigned long int __fsblkcnt64_t; typedef unsigned long int __fsfilcnt_t; typedef unsigned long int __fsfilcnt64_t; typedef long int __fsword_t; typedef long int __ssize_t; typedef long int __syscall_slong_t; typedef unsigned long int __syscall_ulong_t; typedef __off64_t __loff_t; typedef __quad_t *__qaddr_t; typedef char *__caddr_t; typedef long int __intptr_t; typedef unsigned int __socklen_t; # 36 "/usr/include/stdio.h" 2 3 4 # 44 "/usr/include/stdio.h" 3 4 struct _IO_FILE; typedef struct _IO_FILE FILE; # 64 "/usr/include/stdio.h" 3 4 typedef struct _IO_FILE __FILE; # 74 "/usr/include/stdio.h" 3 4 # 1 "/usr/include/libio.h" 1 3 4 # 31 "/usr/include/libio.h" 3 4 # 1 "/usr/include/_G_config.h" 1 3 4 # 15 "/usr/include/_G_config.h" 3 4 # 1 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include/stddef.h" 1 3 4 # 16 "/usr/include/_G_config.h" 2 3 4 # 1 "/usr/include/wchar.h" 1 3 4 # 82 "/usr/include/wchar.h" 3 4 typedef struct { int __count; union { unsigned int __wch; char __wchb[4]; } __value; } __mbstate_t; # 21 "/usr/include/_G_config.h" 2 3 4 typedef struct { __off_t __pos; __mbstate_t __state; } _G_fpos_t; typedef struct { __off64_t __pos; __mbstate_t __state; } _G_fpos64_t; # 32 "/usr/include/libio.h" 2 3 4 # 49 "/usr/include/libio.h" 3 4 # 1 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include/stdarg.h" 1 3 4 # 40 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include/stdarg.h" 3 4 typedef __builtin_va_list __gnuc_va_list; # 50 "/usr/include/libio.h" 2 3 4 # 144 "/usr/include/libio.h" 3 4 struct _IO_jump_t; struct _IO_FILE; # 154 "/usr/include/libio.h" 3 4 typedef void _IO_lock_t; struct _IO_marker { struct _IO_marker *_next; struct _IO_FILE *_sbuf; int _pos; # 177 "/usr/include/libio.h" 3 4 }; enum __codecvt_result { __codecvt_ok, __codecvt_partial, __codecvt_error, __codecvt_noconv }; # 245 "/usr/include/libio.h" 3 4 struct _IO_FILE { int _flags; char* _IO_read_ptr; char* _IO_read_end; char* _IO_read_base; char* _IO_write_base; char* _IO_write_ptr; char* _IO_write_end; char* _IO_buf_base; char* _IO_buf_end; char *_IO_save_base; char *_IO_backup_base; char *_IO_save_end; struct _IO_marker *_markers; struct _IO_FILE *_chain; int _fileno; int _flags2; __off_t _old_offset; unsigned short _cur_column; signed char _vtable_offset; char _shortbuf[1]; _IO_lock_t *_lock; # 293 "/usr/include/libio.h" 3 4 __off64_t _offset; # 302 "/usr/include/libio.h" 3 4 void *__pad1; void *__pad2; void *__pad3; void *__pad4; size_t __pad5; int _mode; char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)]; }; typedef struct _IO_FILE _IO_FILE; struct _IO_FILE_plus; extern struct _IO_FILE_plus _IO_2_1_stdin_; extern struct _IO_FILE_plus _IO_2_1_stdout_; extern struct _IO_FILE_plus _IO_2_1_stderr_; # 338 "/usr/include/libio.h" 3 4 typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes); typedef __ssize_t __io_write_fn (void *__cookie, const char *__buf, size_t __n); typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w); typedef int __io_close_fn (void *__cookie); # 390 "/usr/include/libio.h" 3 4 extern int __underflow (_IO_FILE *); extern int __uflow (_IO_FILE *); extern int __overflow (_IO_FILE *, int); # 434 "/usr/include/libio.h" 3 4 extern int _IO_getc (_IO_FILE *__fp); extern int _IO_putc (int __c, _IO_FILE *__fp); extern int _IO_feof (_IO_FILE *__fp) __attribute__ ((__nothrow__ , __leaf__)); extern int _IO_ferror (_IO_FILE *__fp) __attribute__ ((__nothrow__ , __leaf__)); extern int _IO_peekc_locked (_IO_FILE *__fp); extern void _IO_flockfile (_IO_FILE *) __attribute__ ((__nothrow__ , __leaf__)); extern void _IO_funlockfile (_IO_FILE *) __attribute__ ((__nothrow__ , __leaf__)); extern int _IO_ftrylockfile (_IO_FILE *) __attribute__ ((__nothrow__ , __leaf__)); # 464 "/usr/include/libio.h" 3 4 extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict, __gnuc_va_list, int *__restrict); extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict, __gnuc_va_list); extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t); extern size_t _IO_sgetn (_IO_FILE *, void *, size_t); extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int); extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int); extern void _IO_free_backup_area (_IO_FILE *) __attribute__ ((__nothrow__ , __leaf__)); # 75 "/usr/include/stdio.h" 2 3 4 typedef __gnuc_va_list va_list; # 90 "/usr/include/stdio.h" 3 4 typedef __off_t off_t; # 102 "/usr/include/stdio.h" 3 4 typedef __ssize_t ssize_t; typedef _G_fpos_t fpos_t; # 164 "/usr/include/stdio.h" 3 4 # 1 "/usr/include/bits/stdio_lim.h" 1 3 4 # 165 "/usr/include/stdio.h" 2 3 4 extern struct _IO_FILE *stdin; extern struct _IO_FILE *stdout; extern struct _IO_FILE *stderr; extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__)); extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__)); extern int renameat (int __oldfd, const char *__old, int __newfd, const char *__new) __attribute__ ((__nothrow__ , __leaf__)); extern FILE *tmpfile (void) __attribute__ ((__warn_unused_result__)); # 209 "/usr/include/stdio.h" 3 4 extern char *tmpnam (char *__s) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)); extern char *tmpnam_r (char *__s) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)); # 227 "/usr/include/stdio.h" 3 4 extern char *tempnam (const char *__dir, const char *__pfx) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__)); extern int fclose (FILE *__stream); extern int fflush (FILE *__stream); # 252 "/usr/include/stdio.h" 3 4 extern int fflush_unlocked (FILE *__stream); # 266 "/usr/include/stdio.h" 3 4 extern FILE *fopen (const char *__restrict __filename, const char *__restrict __modes) __attribute__ ((__warn_unused_result__)); extern FILE *freopen (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream) __attribute__ ((__warn_unused_result__)); # 295 "/usr/include/stdio.h" 3 4 # 306 "/usr/include/stdio.h" 3 4 extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)); # 319 "/usr/include/stdio.h" 3 4 extern FILE *fmemopen (void *__s, size_t __len, const char *__modes) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)); extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)); extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)); extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf, int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__)); extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)); extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)); extern int fprintf (FILE *__restrict __stream, const char *__restrict __format, ...); extern int printf (const char *__restrict __format, ...); extern int sprintf (char *__restrict __s, const char *__restrict __format, ...) __attribute__ ((__nothrow__)); extern int vfprintf (FILE *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg); extern int vprintf (const char *__restrict __format, __gnuc_va_list __arg); extern int vsprintf (char *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__nothrow__)); extern int snprintf (char *__restrict __s, size_t __maxlen, const char *__restrict __format, ...) __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4))); extern int vsnprintf (char *__restrict __s, size_t __maxlen, const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0))); # 412 "/usr/include/stdio.h" 3 4 extern int vdprintf (int __fd, const char *__restrict __fmt, __gnuc_va_list __arg) __attribute__ ((__format__ (__printf__, 2, 0))); extern int dprintf (int __fd, const char *__restrict __fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3))); extern int fscanf (FILE *__restrict __stream, const char *__restrict __format, ...) __attribute__ ((__warn_unused_result__)); extern int scanf (const char *__restrict __format, ...) __attribute__ ((__warn_unused_result__)); extern int sscanf (const char *__restrict __s, const char *__restrict __format, ...) __attribute__ ((__nothrow__ , __leaf__)); # 443 "/usr/include/stdio.h" 3 4 extern int fscanf (FILE *__restrict __stream, const char *__restrict __format, ...) __asm__ ("" "__isoc99_fscanf") __attribute__ ((__warn_unused_result__)); extern int scanf (const char *__restrict __format, ...) __asm__ ("" "__isoc99_scanf") __attribute__ ((__warn_unused_result__)); extern int sscanf (const char *__restrict __s, const char *__restrict __format, ...) __asm__ ("" "__isoc99_sscanf") __attribute__ ((__nothrow__ , __leaf__)) ; # 463 "/usr/include/stdio.h" 3 4 extern int vfscanf (FILE *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__format__ (__scanf__, 2, 0))) __attribute__ ((__warn_unused_result__)); extern int vscanf (const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__format__ (__scanf__, 1, 0))) __attribute__ ((__warn_unused_result__)); extern int vsscanf (const char *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0))); # 494 "/usr/include/stdio.h" 3 4 extern int vfscanf (FILE *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vfscanf") __attribute__ ((__format__ (__scanf__, 2, 0))) __attribute__ ((__warn_unused_result__)); extern int vscanf (const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vscanf") __attribute__ ((__format__ (__scanf__, 1, 0))) __attribute__ ((__warn_unused_result__)); extern int vsscanf (const char *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vsscanf") __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0))); # 522 "/usr/include/stdio.h" 3 4 extern int fgetc (FILE *__stream); extern int getc (FILE *__stream); extern int getchar (void); # 550 "/usr/include/stdio.h" 3 4 extern int getc_unlocked (FILE *__stream); extern int getchar_unlocked (void); # 561 "/usr/include/stdio.h" 3 4 extern int fgetc_unlocked (FILE *__stream); extern int fputc (int __c, FILE *__stream); extern int putc (int __c, FILE *__stream); extern int putchar (int __c); # 594 "/usr/include/stdio.h" 3 4 extern int fputc_unlocked (int __c, FILE *__stream); extern int putc_unlocked (int __c, FILE *__stream); extern int putchar_unlocked (int __c); extern int getw (FILE *__stream); extern int putw (int __w, FILE *__stream); extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream) __attribute__ ((__warn_unused_result__)); # 638 "/usr/include/stdio.h" 3 4 extern char *gets (char *__s) __attribute__ ((__warn_unused_result__)) __attribute__ ((__deprecated__)); # 665 "/usr/include/stdio.h" 3 4 extern __ssize_t __getdelim (char **__restrict __lineptr, size_t *__restrict __n, int __delimiter, FILE *__restrict __stream) __attribute__ ((__warn_unused_result__)); extern __ssize_t getdelim (char **__restrict __lineptr, size_t *__restrict __n, int __delimiter, FILE *__restrict __stream) __attribute__ ((__warn_unused_result__)); extern __ssize_t getline (char **__restrict __lineptr, size_t *__restrict __n, FILE *__restrict __stream) __attribute__ ((__warn_unused_result__)); extern int fputs (const char *__restrict __s, FILE *__restrict __stream); extern int puts (const char *__s); extern int ungetc (int __c, FILE *__stream); extern size_t fread (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) __attribute__ ((__warn_unused_result__)); extern size_t fwrite (const void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __s); # 737 "/usr/include/stdio.h" 3 4 extern size_t fread_unlocked (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) __attribute__ ((__warn_unused_result__)); extern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream); extern int fseek (FILE *__stream, long int __off, int __whence); extern long int ftell (FILE *__stream) __attribute__ ((__warn_unused_result__)); extern void rewind (FILE *__stream); # 773 "/usr/include/stdio.h" 3 4 extern int fseeko (FILE *__stream, __off_t __off, int __whence); extern __off_t ftello (FILE *__stream) __attribute__ ((__warn_unused_result__)); # 792 "/usr/include/stdio.h" 3 4 extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos); extern int fsetpos (FILE *__stream, const fpos_t *__pos); # 815 "/usr/include/stdio.h" 3 4 # 824 "/usr/include/stdio.h" 3 4 extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)); extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)); extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)); extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)); extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)); extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)); extern void perror (const char *__s); # 1 "/usr/include/bits/sys_errlist.h" 1 3 4 # 26 "/usr/include/bits/sys_errlist.h" 3 4 extern int sys_nerr; extern const char *const sys_errlist[]; # 854 "/usr/include/stdio.h" 2 3 4 extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)); extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)); # 872 "/usr/include/stdio.h" 3 4 extern FILE *popen (const char *__command, const char *__modes) __attribute__ ((__warn_unused_result__)); extern int pclose (FILE *__stream); extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__)); # 912 "/usr/include/stdio.h" 3 4 extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)); extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)); extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)); # 933 "/usr/include/stdio.h" 3 4 # 1 "/usr/include/bits/stdio.h" 1 3 4 # 43 "/usr/include/bits/stdio.h" 3 4 extern __inline __attribute__ ((__gnu_inline__)) int getchar (void) { return _IO_getc (stdin); } extern __inline __attribute__ ((__gnu_inline__)) int fgetc_unlocked (FILE *__fp) { return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++); } extern __inline __attribute__ ((__gnu_inline__)) int getc_unlocked (FILE *__fp) { return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++); } extern __inline __attribute__ ((__gnu_inline__)) int getchar_unlocked (void) { return (__builtin_expect (((stdin)->_IO_read_ptr >= (stdin)->_IO_read_end), 0) ? __uflow (stdin) : *(unsigned char *) (stdin)->_IO_read_ptr++); } extern __inline __attribute__ ((__gnu_inline__)) int putchar (int __c) { return _IO_putc (__c, stdout); } extern __inline __attribute__ ((__gnu_inline__)) int fputc_unlocked (int __c, FILE *__stream) { return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c))); } extern __inline __attribute__ ((__gnu_inline__)) int putc_unlocked (int __c, FILE *__stream) { return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c))); } extern __inline __attribute__ ((__gnu_inline__)) int putchar_unlocked (int __c) { return (__builtin_expect (((stdout)->_IO_write_ptr >= (stdout)->_IO_write_end), 0) ? __overflow (stdout, (unsigned char) (__c)) : (unsigned char) (*(stdout)->_IO_write_ptr++ = (__c))); } # 124 "/usr/include/bits/stdio.h" 3 4 extern __inline __attribute__ ((__gnu_inline__)) int __attribute__ ((__nothrow__ , __leaf__)) feof_unlocked (FILE *__stream) { return (((__stream)->_flags & 0x10) != 0); } extern __inline __attribute__ ((__gnu_inline__)) int __attribute__ ((__nothrow__ , __leaf__)) ferror_unlocked (FILE *__stream) { return (((__stream)->_flags & 0x20) != 0); } # 934 "/usr/include/stdio.h" 2 3 4 # 1 "/usr/include/bits/stdio2.h" 1 3 4 # 23 "/usr/include/bits/stdio2.h" 3 4 extern int __sprintf_chk (char *__restrict __s, int __flag, size_t __slen, const char *__restrict __format, ...) __attribute__ ((__nothrow__ , __leaf__)); extern int __vsprintf_chk (char *__restrict __s, int __flag, size_t __slen, const char *__restrict __format, __gnuc_va_list __ap) __attribute__ ((__nothrow__ , __leaf__)); extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) int __attribute__ ((__nothrow__ , __leaf__)) sprintf (char *__restrict __s, const char *__restrict __fmt, ...) { return __builtin___sprintf_chk (__s, 2 - 1, __builtin_object_size (__s, 2 > 1), __fmt, __builtin_va_arg_pack ()); } extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) int __attribute__ ((__nothrow__ , __leaf__)) vsprintf (char *__restrict __s, const char *__restrict __fmt, __gnuc_va_list __ap) { return __builtin___vsprintf_chk (__s, 2 - 1, __builtin_object_size (__s, 2 > 1), __fmt, __ap); } extern int __snprintf_chk (char *__restrict __s, size_t __n, int __flag, size_t __slen, const char *__restrict __format, ...) __attribute__ ((__nothrow__ , __leaf__)); extern int __vsnprintf_chk (char *__restrict __s, size_t __n, int __flag, size_t __slen, const char *__restrict __format, __gnuc_va_list __ap) __attribute__ ((__nothrow__ , __leaf__)); extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) int __attribute__ ((__nothrow__ , __leaf__)) snprintf (char *__restrict __s, size_t __n, const char *__restrict __fmt, ...) { return __builtin___snprintf_chk (__s, __n, 2 - 1, __builtin_object_size (__s, 2 > 1), __fmt, __builtin_va_arg_pack ()); } extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) int __attribute__ ((__nothrow__ , __leaf__)) vsnprintf (char *__restrict __s, size_t __n, const char *__restrict __fmt, __gnuc_va_list __ap) { return __builtin___vsnprintf_chk (__s, __n, 2 - 1, __builtin_object_size (__s, 2 > 1), __fmt, __ap); } extern int __fprintf_chk (FILE *__restrict __stream, int __flag, const char *__restrict __format, ...); extern int __printf_chk (int __flag, const char *__restrict __format, ...); extern int __vfprintf_chk (FILE *__restrict __stream, int __flag, const char *__restrict __format, __gnuc_va_list __ap); extern int __vprintf_chk (int __flag, const char *__restrict __format, __gnuc_va_list __ap); extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) int fprintf (FILE *__restrict __stream, const char *__restrict __fmt, ...) { return __fprintf_chk (__stream, 2 - 1, __fmt, __builtin_va_arg_pack ()); } extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) int printf (const char *__restrict __fmt, ...) { return __printf_chk (2 - 1, __fmt, __builtin_va_arg_pack ()); } extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) int vprintf (const char *__restrict __fmt, __gnuc_va_list __ap) { return __vfprintf_chk (stdout, 2 - 1, __fmt, __ap); } extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) int vfprintf (FILE *__restrict __stream, const char *__restrict __fmt, __gnuc_va_list __ap) { return __vfprintf_chk (__stream, 2 - 1, __fmt, __ap); } extern int __dprintf_chk (int __fd, int __flag, const char *__restrict __fmt, ...) __attribute__ ((__format__ (__printf__, 3, 4))); extern int __vdprintf_chk (int __fd, int __flag, const char *__restrict __fmt, __gnuc_va_list __arg) __attribute__ ((__format__ (__printf__, 3, 0))); extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) int dprintf (int __fd, const char *__restrict __fmt, ...) { return __dprintf_chk (__fd, 2 - 1, __fmt, __builtin_va_arg_pack ()); } extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) int vdprintf (int __fd, const char *__restrict __fmt, __gnuc_va_list __ap) { return __vdprintf_chk (__fd, 2 - 1, __fmt, __ap); } # 227 "/usr/include/bits/stdio2.h" 3 4 extern char *__gets_chk (char *__str, size_t) __attribute__ ((__warn_unused_result__)); extern char *__gets_warn (char *__str) __asm__ ("" "gets") __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("please use fgets or getline instead, gets can't " "specify buffer size"))) ; extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) __attribute__ ((__warn_unused_result__)) char * gets (char *__str) { if (__builtin_object_size (__str, 2 > 1) != (size_t) -1) return __gets_chk (__str, __builtin_object_size (__str, 2 > 1)); return __gets_warn (__str); } extern char *__fgets_chk (char *__restrict __s, size_t __size, int __n, FILE *__restrict __stream) __attribute__ ((__warn_unused_result__)); extern char *__fgets_alias (char *__restrict __s, int __n, FILE *__restrict __stream) __asm__ ("" "fgets") __attribute__ ((__warn_unused_result__)); extern char *__fgets_chk_warn (char *__restrict __s, size_t __size, int __n, FILE *__restrict __stream) __asm__ ("" "__fgets_chk") __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("fgets called with bigger size than length " "of destination buffer"))) ; extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) __attribute__ ((__warn_unused_result__)) char * fgets (char *__restrict __s, int __n, FILE *__restrict __stream) { if (__builtin_object_size (__s, 2 > 1) != (size_t) -1) { if (!__builtin_constant_p (__n) || __n <= 0) return __fgets_chk (__s, __builtin_object_size (__s, 2 > 1), __n, __stream); if ((size_t) __n > __builtin_object_size (__s, 2 > 1)) return __fgets_chk_warn (__s, __builtin_object_size (__s, 2 > 1), __n, __stream); } return __fgets_alias (__s, __n, __stream); } extern size_t __fread_chk (void *__restrict __ptr, size_t __ptrlen, size_t __size, size_t __n, FILE *__restrict __stream) __attribute__ ((__warn_unused_result__)); extern size_t __fread_alias (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("" "fread") __attribute__ ((__warn_unused_result__)); extern size_t __fread_chk_warn (void *__restrict __ptr, size_t __ptrlen, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("" "__fread_chk") __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("fread called with bigger size * nmemb than length " "of destination buffer"))) ; extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) __attribute__ ((__warn_unused_result__)) size_t fread (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) { if (__builtin_object_size (__ptr, 0) != (size_t) -1) { if (!__builtin_constant_p (__size) || !__builtin_constant_p (__n) || (__size | __n) >= (((size_t) 1) << (8 * sizeof (size_t) / 2))) return __fread_chk (__ptr, __builtin_object_size (__ptr, 0), __size, __n, __stream); if (__size * __n > __builtin_object_size (__ptr, 0)) return __fread_chk_warn (__ptr, __builtin_object_size (__ptr, 0), __size, __n, __stream); } return __fread_alias (__ptr, __size, __n, __stream); } # 327 "/usr/include/bits/stdio2.h" 3 4 extern size_t __fread_unlocked_chk (void *__restrict __ptr, size_t __ptrlen, size_t __size, size_t __n, FILE *__restrict __stream) __attribute__ ((__warn_unused_result__)); extern size_t __fread_unlocked_alias (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("" "fread_unlocked") __attribute__ ((__warn_unused_result__)); extern size_t __fread_unlocked_chk_warn (void *__restrict __ptr, size_t __ptrlen, size_t __size, size_t __n, FILE *__restrict __stream) __asm__ ("" "__fread_unlocked_chk") __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("fread_unlocked called with bigger size * nmemb than " "length of destination buffer"))) ; extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) __attribute__ ((__warn_unused_result__)) size_t fread_unlocked (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) { if (__builtin_object_size (__ptr, 0) != (size_t) -1) { if (!__builtin_constant_p (__size) || !__builtin_constant_p (__n) || (__size | __n) >= (((size_t) 1) << (8 * sizeof (size_t) / 2))) return __fread_unlocked_chk (__ptr, __builtin_object_size (__ptr, 0), __size, __n, __stream); if (__size * __n > __builtin_object_size (__ptr, 0)) return __fread_unlocked_chk_warn (__ptr, __builtin_object_size (__ptr, 0), __size, __n, __stream); } if (__builtin_constant_p (__size) && __builtin_constant_p (__n) && (__size | __n) < (((size_t) 1) << (8 * sizeof (size_t) / 2)) && __size * __n <= 8) { size_t __cnt = __size * __n; char *__cptr = (char *) __ptr; if (__cnt == 0) return 0; for (; __cnt > 0; --__cnt) { int __c = (__builtin_expect (((__stream)->_IO_read_ptr >= (__stream)->_IO_read_end), 0) ? __uflow (__stream) : *(unsigned char *) (__stream)->_IO_read_ptr++); if (__c == (-1)) break; *__cptr++ = __c; } return (__cptr - (char *) __ptr) / __size; } return __fread_unlocked_alias (__ptr, __size, __n, __stream); } # 937 "/usr/include/stdio.h" 2 3 4 # 18 "src/tools/tor-fw-helper/tor-fw-helper.c" 2 # 1 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include/stdint.h" 1 3 4 # 9 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include/stdint.h" 3 4 # 1 "/usr/include/stdint.h" 1 3 4 # 26 "/usr/include/stdint.h" 3 4 # 1 "/usr/include/bits/wchar.h" 1 3 4 # 27 "/usr/include/stdint.h" 2 3 4 # 1 "/usr/include/bits/wordsize.h" 1 3 4 # 28 "/usr/include/stdint.h" 2 3 4 # 36 "/usr/include/stdint.h" 3 4 typedef signed char int8_t; typedef short int int16_t; typedef int int32_t; typedef long int int64_t; typedef unsigned char uint8_t; typedef unsigned short int uint16_t; typedef unsigned int uint32_t; typedef unsigned long int uint64_t; # 65 "/usr/include/stdint.h" 3 4 typedef signed char int_least8_t; typedef short int int_least16_t; typedef int int_least32_t; typedef long int int_least64_t; typedef unsigned char uint_least8_t; typedef unsigned short int uint_least16_t; typedef unsigned int uint_least32_t; typedef unsigned long int uint_least64_t; # 90 "/usr/include/stdint.h" 3 4 typedef signed char int_fast8_t; typedef long int int_fast16_t; typedef long int int_fast32_t; typedef long int int_fast64_t; # 103 "/usr/include/stdint.h" 3 4 typedef unsigned char uint_fast8_t; typedef unsigned long int uint_fast16_t; typedef unsigned long int uint_fast32_t; typedef unsigned long int uint_fast64_t; # 119 "/usr/include/stdint.h" 3 4 typedef long int intptr_t; typedef unsigned long int uintptr_t; # 134 "/usr/include/stdint.h" 3 4 typedef long int intmax_t; typedef unsigned long int uintmax_t; # 10 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include/stdint.h" 2 3 4 # 19 "src/tools/tor-fw-helper/tor-fw-helper.c" 2 # 1 "/usr/include/stdlib.h" 1 3 4 # 32 "/usr/include/stdlib.h" 3 4 # 1 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include/stddef.h" 1 3 4 # 324 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include/stddef.h" 3 4 typedef int wchar_t; # 33 "/usr/include/stdlib.h" 2 3 4 # 1 "/usr/include/bits/waitflags.h" 1 3 4 # 42 "/usr/include/stdlib.h" 2 3 4 # 1 "/usr/include/bits/waitstatus.h" 1 3 4 # 64 "/usr/include/bits/waitstatus.h" 3 4 # 1 "/usr/include/endian.h" 1 3 4 # 36 "/usr/include/endian.h" 3 4 # 1 "/usr/include/bits/endian.h" 1 3 4 # 37 "/usr/include/endian.h" 2 3 4 # 60 "/usr/include/endian.h" 3 4 # 1 "/usr/include/bits/byteswap.h" 1 3 4 # 28 "/usr/include/bits/byteswap.h" 3 4 # 1 "/usr/include/bits/wordsize.h" 1 3 4 # 29 "/usr/include/bits/byteswap.h" 2 3 4 # 1 "/usr/include/bits/byteswap-16.h" 1 3 4 # 36 "/usr/include/bits/byteswap.h" 2 3 4 # 44 "/usr/include/bits/byteswap.h" 3 4 static __inline unsigned int __bswap_32 (unsigned int __bsx) { return __builtin_bswap32 (__bsx); } # 108 "/usr/include/bits/byteswap.h" 3 4 static __inline __uint64_t __bswap_64 (__uint64_t __bsx) { return __builtin_bswap64 (__bsx); } # 61 "/usr/include/endian.h" 2 3 4 # 65 "/usr/include/bits/waitstatus.h" 2 3 4 union wait { int w_status; struct { unsigned int __w_termsig:7; unsigned int __w_coredump:1; unsigned int __w_retcode:8; unsigned int:16; } __wait_terminated; struct { unsigned int __w_stopval:8; unsigned int __w_stopsig:8; unsigned int:16; } __wait_stopped; }; # 43 "/usr/include/stdlib.h" 2 3 4 # 67 "/usr/include/stdlib.h" 3 4 typedef union { union wait *__uptr; int *__iptr; } __WAIT_STATUS __attribute__ ((__transparent_union__)); # 95 "/usr/include/stdlib.h" 3 4 typedef struct { int quot; int rem; } div_t; typedef struct { long int quot; long int rem; } ldiv_t; __extension__ typedef struct { long long int quot; long long int rem; } lldiv_t; # 139 "/usr/include/stdlib.h" 3 4 extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)); extern double atof (const char *__nptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); extern int atoi (const char *__nptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); extern long int atol (const char *__nptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); __extension__ extern long long int atoll (const char *__nptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); extern double strtod (const char *__restrict __nptr, char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern float strtof (const char *__restrict __nptr, char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern long double strtold (const char *__restrict __nptr, char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern long int strtol (const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern unsigned long int strtoul (const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); __extension__ extern long long int strtoq (const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); __extension__ extern unsigned long long int strtouq (const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); __extension__ extern long long int strtoll (const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); __extension__ extern unsigned long long int strtoull (const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); # 276 "/usr/include/stdlib.h" 3 4 extern __inline __attribute__ ((__gnu_inline__)) int __attribute__ ((__nothrow__ , __leaf__)) atoi (const char *__nptr) { return (int) strtol (__nptr, (char **) ((void *)0), 10); } extern __inline __attribute__ ((__gnu_inline__)) long int __attribute__ ((__nothrow__ , __leaf__)) atol (const char *__nptr) { return strtol (__nptr, (char **) ((void *)0), 10); } __extension__ extern __inline __attribute__ ((__gnu_inline__)) long long int __attribute__ ((__nothrow__ , __leaf__)) atoll (const char *__nptr) { return strtoll (__nptr, (char **) ((void *)0), 10); } # 305 "/usr/include/stdlib.h" 3 4 extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)); extern long int a64l (const char *__s) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); # 1 "/usr/include/sys/types.h" 1 3 4 # 27 "/usr/include/sys/types.h" 3 4 typedef __u_char u_char; typedef __u_short u_short; typedef __u_int u_int; typedef __u_long u_long; typedef __quad_t quad_t; typedef __u_quad_t u_quad_t; typedef __fsid_t fsid_t; typedef __loff_t loff_t; typedef __ino_t ino_t; # 60 "/usr/include/sys/types.h" 3 4 typedef __dev_t dev_t; typedef __gid_t gid_t; typedef __mode_t mode_t; typedef __nlink_t nlink_t; typedef __uid_t uid_t; # 98 "/usr/include/sys/types.h" 3 4 typedef __pid_t pid_t; typedef __id_t id_t; # 115 "/usr/include/sys/types.h" 3 4 typedef __daddr_t daddr_t; typedef __caddr_t caddr_t; typedef __key_t key_t; # 132 "/usr/include/sys/types.h" 3 4 # 1 "/usr/include/time.h" 1 3 4 # 57 "/usr/include/time.h" 3 4 typedef __clock_t clock_t; # 73 "/usr/include/time.h" 3 4 typedef __time_t time_t; # 91 "/usr/include/time.h" 3 4 typedef __clockid_t clockid_t; # 103 "/usr/include/time.h" 3 4 typedef __timer_t timer_t; # 133 "/usr/include/sys/types.h" 2 3 4 # 146 "/usr/include/sys/types.h" 3 4 # 1 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include/stddef.h" 1 3 4 # 147 "/usr/include/sys/types.h" 2 3 4 typedef unsigned long int ulong; typedef unsigned short int ushort; typedef unsigned int uint; # 200 "/usr/include/sys/types.h" 3 4 typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__))); typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__))); typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__))); typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__))); typedef int register_t __attribute__ ((__mode__ (__word__))); # 219 "/usr/include/sys/types.h" 3 4 # 1 "/usr/include/sys/select.h" 1 3 4 # 30 "/usr/include/sys/select.h" 3 4 # 1 "/usr/include/bits/select.h" 1 3 4 # 22 "/usr/include/bits/select.h" 3 4 # 1 "/usr/include/bits/wordsize.h" 1 3 4 # 23 "/usr/include/bits/select.h" 2 3 4 # 31 "/usr/include/sys/select.h" 2 3 4 # 1 "/usr/include/bits/sigset.h" 1 3 4 # 22 "/usr/include/bits/sigset.h" 3 4 typedef int __sig_atomic_t; typedef struct { unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))]; } __sigset_t; # 34 "/usr/include/sys/select.h" 2 3 4 typedef __sigset_t sigset_t; # 1 "/usr/include/time.h" 1 3 4 # 120 "/usr/include/time.h" 3 4 struct timespec { __time_t tv_sec; __syscall_slong_t tv_nsec; }; # 44 "/usr/include/sys/select.h" 2 3 4 # 1 "/usr/include/bits/time.h" 1 3 4 # 30 "/usr/include/bits/time.h" 3 4 struct timeval { __time_t tv_sec; __suseconds_t tv_usec; }; # 46 "/usr/include/sys/select.h" 2 3 4 typedef __suseconds_t suseconds_t; typedef long int __fd_mask; # 64 "/usr/include/sys/select.h" 3 4 typedef struct { __fd_mask __fds_bits[1024 / (8 * (int) sizeof (__fd_mask))]; } fd_set; typedef __fd_mask fd_mask; # 96 "/usr/include/sys/select.h" 3 4 # 106 "/usr/include/sys/select.h" 3 4 extern int select (int __nfds, fd_set *__restrict __readfds, fd_set *__restrict __writefds, fd_set *__restrict __exceptfds, struct timeval *__restrict __timeout); # 118 "/usr/include/sys/select.h" 3 4 extern int pselect (int __nfds, fd_set *__restrict __readfds, fd_set *__restrict __writefds, fd_set *__restrict __exceptfds, const struct timespec *__restrict __timeout, const __sigset_t *__restrict __sigmask); # 1 "/usr/include/bits/select2.h" 1 3 4 # 24 "/usr/include/bits/select2.h" 3 4 extern long int __fdelt_chk (long int __d); extern long int __fdelt_warn (long int __d) __attribute__((__warning__ ("bit outside of fd_set selected"))); # 129 "/usr/include/sys/select.h" 2 3 4 # 220 "/usr/include/sys/types.h" 2 3 4 # 1 "/usr/include/sys/sysmacros.h" 1 3 4 # 24 "/usr/include/sys/sysmacros.h" 3 4 __extension__ extern unsigned int gnu_dev_major (unsigned long long int __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); __extension__ extern unsigned int gnu_dev_minor (unsigned long long int __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); __extension__ extern unsigned long long int gnu_dev_makedev (unsigned int __major, unsigned int __minor) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); __extension__ extern __inline __attribute__ ((__gnu_inline__)) __attribute__ ((__const__)) unsigned int __attribute__ ((__nothrow__ , __leaf__)) gnu_dev_major (unsigned long long int __dev) { return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff); } __extension__ extern __inline __attribute__ ((__gnu_inline__)) __attribute__ ((__const__)) unsigned int __attribute__ ((__nothrow__ , __leaf__)) gnu_dev_minor (unsigned long long int __dev) { return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff); } __extension__ extern __inline __attribute__ ((__gnu_inline__)) __attribute__ ((__const__)) unsigned long long int __attribute__ ((__nothrow__ , __leaf__)) gnu_dev_makedev (unsigned int __major, unsigned int __minor) { return ((__minor & 0xff) | ((__major & 0xfff) << 8) | (((unsigned long long int) (__minor & ~0xff)) << 12) | (((unsigned long long int) (__major & ~0xfff)) << 32)); } # 223 "/usr/include/sys/types.h" 2 3 4 typedef __blksize_t blksize_t; typedef __blkcnt_t blkcnt_t; typedef __fsblkcnt_t fsblkcnt_t; typedef __fsfilcnt_t fsfilcnt_t; # 270 "/usr/include/sys/types.h" 3 4 # 1 "/usr/include/bits/pthreadtypes.h" 1 3 4 # 21 "/usr/include/bits/pthreadtypes.h" 3 4 # 1 "/usr/include/bits/wordsize.h" 1 3 4 # 22 "/usr/include/bits/pthreadtypes.h" 2 3 4 # 60 "/usr/include/bits/pthreadtypes.h" 3 4 typedef unsigned long int pthread_t; union pthread_attr_t { char __size[56]; long int __align; }; typedef union pthread_attr_t pthread_attr_t; typedef struct __pthread_internal_list { struct __pthread_internal_list *__prev; struct __pthread_internal_list *__next; } __pthread_list_t; # 90 "/usr/include/bits/pthreadtypes.h" 3 4 typedef union { struct __pthread_mutex_s { int __lock; unsigned int __count; int __owner; unsigned int __nusers; int __kind; short __spins; short __elision; __pthread_list_t __list; # 125 "/usr/include/bits/pthreadtypes.h" 3 4 } __data; char __size[40]; long int __align; } pthread_mutex_t; typedef union { char __size[4]; int __align; } pthread_mutexattr_t; typedef union { struct { int __lock; unsigned int __futex; __extension__ unsigned long long int __total_seq; __extension__ unsigned long long int __wakeup_seq; __extension__ unsigned long long int __woken_seq; void *__mutex; unsigned int __nwaiters; unsigned int __broadcast_seq; } __data; char __size[48]; __extension__ long long int __align; } pthread_cond_t; typedef union { char __size[4]; int __align; } pthread_condattr_t; typedef unsigned int pthread_key_t; typedef int pthread_once_t; typedef union { struct { int __lock; unsigned int __nr_readers; unsigned int __readers_wakeup; unsigned int __writer_wakeup; unsigned int __nr_readers_queued; unsigned int __nr_writers_queued; int __writer; int __shared; signed char __rwelision; unsigned char __pad1[7]; unsigned long int __pad2; unsigned int __flags; } __data; # 220 "/usr/include/bits/pthreadtypes.h" 3 4 char __size[56]; long int __align; } pthread_rwlock_t; typedef union { char __size[8]; long int __align; } pthread_rwlockattr_t; typedef volatile int pthread_spinlock_t; typedef union { char __size[32]; long int __align; } pthread_barrier_t; typedef union { char __size[4]; int __align; } pthread_barrierattr_t; # 271 "/usr/include/sys/types.h" 2 3 4 # 315 "/usr/include/stdlib.h" 2 3 4 extern long int random (void) __attribute__ ((__nothrow__ , __leaf__)); extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__)); extern char *initstate (unsigned int __seed, char *__statebuf, size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); struct random_data { int32_t *fptr; int32_t *rptr; int32_t *state; int rand_type; int rand_deg; int rand_sep; int32_t *end_ptr; }; extern int random_r (struct random_data *__restrict __buf, int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int srandom_r (unsigned int __seed, struct random_data *__buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); extern int initstate_r (unsigned int __seed, char *__restrict __statebuf, size_t __statelen, struct random_data *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))); extern int setstate_r (char *__restrict __statebuf, struct random_data *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int rand (void) __attribute__ ((__nothrow__ , __leaf__)); extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__)); extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__)); extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__)); extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__)); extern long int nrand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__)); extern long int jrand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__)); extern unsigned short int *seed48 (unsigned short int __seed16v[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); struct drand48_data { unsigned short int __x[3]; unsigned short int __old_x[3]; unsigned short int __c; unsigned short int __init; __extension__ unsigned long long int __a; }; extern int drand48_r (struct drand48_data *__restrict __buffer, double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int erand48_r (unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int lrand48_r (struct drand48_data *__restrict __buffer, long int *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int nrand48_r (unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, long int *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int mrand48_r (struct drand48_data *__restrict __buffer, long int *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int jrand48_r (unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, long int *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int srand48_r (long int __seedval, struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); extern int seed48_r (unsigned short int __seed16v[3], struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int lcong48_r (unsigned short int __param[7], struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__)); extern void *calloc (size_t __nmemb, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__)); extern void *realloc (void *__ptr, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)); extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__)); extern void cfree (void *__ptr) __attribute__ ((__nothrow__ , __leaf__)); # 1 "/usr/include/alloca.h" 1 3 4 # 24 "/usr/include/alloca.h" 3 4 # 1 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include/stddef.h" 1 3 4 # 25 "/usr/include/alloca.h" 2 3 4 extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__)); # 493 "/usr/include/stdlib.h" 2 3 4 extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__)); extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); # 513 "/usr/include/stdlib.h" 3 4 extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__)); extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); # 530 "/usr/include/stdlib.h" 3 4 extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__)); extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__)); extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); # 578 "/usr/include/stdlib.h" 3 4 extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int setenv (const char *__name, const char *__value, int __replace) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__)); # 606 "/usr/include/stdlib.h" 3 4 extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); # 619 "/usr/include/stdlib.h" 3 4 extern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); # 641 "/usr/include/stdlib.h" 3 4 extern int mkstemps (char *__template, int __suffixlen) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); # 662 "/usr/include/stdlib.h" 3 4 extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); # 711 "/usr/include/stdlib.h" 3 4 extern int system (const char *__command) __attribute__ ((__warn_unused_result__)); # 733 "/usr/include/stdlib.h" 3 4 extern char *realpath (const char *__restrict __name, char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)); typedef int (*__compar_fn_t) (const void *, const void *); # 751 "/usr/include/stdlib.h" 3 4 extern void *bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 2, 5))) __attribute__ ((__warn_unused_result__)); # 1 "/usr/include/bits/stdlib-bsearch.h" 1 3 4 # 19 "/usr/include/bits/stdlib-bsearch.h" 3 4 extern __inline __attribute__ ((__gnu_inline__)) void * bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar) { size_t __l, __u, __idx; const void *__p; int __comparison; __l = 0; __u = __nmemb; while (__l < __u) { __idx = (__l + __u) / 2; __p = (void *) (((const char *) __base) + (__idx * __size)); __comparison = (*__compar) (__key, __p); if (__comparison < 0) __u = __idx; else if (__comparison > 0) __l = __idx + 1; else return (void *) __p; } return ((void *)0); } # 760 "/usr/include/stdlib.h" 2 3 4 extern void qsort (void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4))); # 774 "/usr/include/stdlib.h" 3 4 extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__)); extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__)); __extension__ extern long long int llabs (long long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__)); extern div_t div (int __numer, int __denom) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__)); extern ldiv_t ldiv (long int __numer, long int __denom) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__)); __extension__ extern lldiv_t lldiv (long long int __numer, long long int __denom) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) __attribute__ ((__warn_unused_result__)); # 811 "/usr/include/stdlib.h" 3 4 extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) __attribute__ ((__warn_unused_result__)); extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) __attribute__ ((__warn_unused_result__)); extern char *gcvt (double __value, int __ndigit, char *__buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) __attribute__ ((__warn_unused_result__)); extern char *qecvt (long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) __attribute__ ((__warn_unused_result__)); extern char *qfcvt (long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) __attribute__ ((__warn_unused_result__)); extern char *qgcvt (long double __value, int __ndigit, char *__buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) __attribute__ ((__warn_unused_result__)); extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5))); extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5))); extern int qecvt_r (long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5))); extern int qfcvt_r (long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5))); extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)); extern int mbtowc (wchar_t *__restrict __pwc, const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)); extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__)); extern size_t mbstowcs (wchar_t *__restrict __pwcs, const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)); extern size_t wcstombs (char *__restrict __s, const wchar_t *__restrict __pwcs, size_t __n) __attribute__ ((__nothrow__ , __leaf__)); extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); # 898 "/usr/include/stdlib.h" 3 4 extern int getsubopt (char **__restrict __optionp, char *const *__restrict __tokens, char **__restrict __valuep) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__warn_unused_result__)); # 950 "/usr/include/stdlib.h" 3 4 extern int getloadavg (double __loadavg[], int __nelem) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); # 1 "/usr/include/bits/stdlib-float.h" 1 3 4 # 24 "/usr/include/bits/stdlib-float.h" 3 4 extern __inline __attribute__ ((__gnu_inline__)) double __attribute__ ((__nothrow__ , __leaf__)) atof (const char *__nptr) { return strtod (__nptr, (char **) ((void *)0)); } # 955 "/usr/include/stdlib.h" 2 3 4 # 1 "/usr/include/bits/stdlib.h" 1 3 4 # 23 "/usr/include/bits/stdlib.h" 3 4 extern char *__realpath_chk (const char *__restrict __name, char *__restrict __resolved, size_t __resolvedlen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)); extern char *__realpath_alias (const char *__restrict __name, char *__restrict __resolved) __asm__ ("" "realpath") __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)); extern char *__realpath_chk_warn (const char *__restrict __name, char *__restrict __resolved, size_t __resolvedlen) __asm__ ("" "__realpath_chk") __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)) __attribute__((__warning__ ("second argument of realpath must be either NULL or at " "least PATH_MAX bytes long buffer"))) ; extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) __attribute__ ((__warn_unused_result__)) char * __attribute__ ((__nothrow__ , __leaf__)) realpath (const char *__restrict __name, char *__restrict __resolved) { if (__builtin_object_size (__resolved, 2 > 1) != (size_t) -1) { return __realpath_chk (__name, __resolved, __builtin_object_size (__resolved, 2 > 1)); } return __realpath_alias (__name, __resolved); } extern int __ptsname_r_chk (int __fd, char *__buf, size_t __buflen, size_t __nreal) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); extern int __ptsname_r_alias (int __fd, char *__buf, size_t __buflen) __asm__ ("" "ptsname_r") __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); extern int __ptsname_r_chk_warn (int __fd, char *__buf, size_t __buflen, size_t __nreal) __asm__ ("" "__ptsname_r_chk") __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) __attribute__((__warning__ ("ptsname_r called with buflen bigger than " "size of buf"))) ; extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) int __attribute__ ((__nothrow__ , __leaf__)) ptsname_r (int __fd, char *__buf, size_t __buflen) { if (__builtin_object_size (__buf, 2 > 1) != (size_t) -1) { if (!__builtin_constant_p (__buflen)) return __ptsname_r_chk (__fd, __buf, __buflen, __builtin_object_size (__buf, 2 > 1)); if (__buflen > __builtin_object_size (__buf, 2 > 1)) return __ptsname_r_chk_warn (__fd, __buf, __buflen, __builtin_object_size (__buf, 2 > 1)); } return __ptsname_r_alias (__fd, __buf, __buflen); } extern int __wctomb_chk (char *__s, wchar_t __wchar, size_t __buflen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)); extern int __wctomb_alias (char *__s, wchar_t __wchar) __asm__ ("" "wctomb") __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)); extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) __attribute__ ((__warn_unused_result__)) int __attribute__ ((__nothrow__ , __leaf__)) wctomb (char *__s, wchar_t __wchar) { if (__builtin_object_size (__s, 2 > 1) != (size_t) -1 && 16 > __builtin_object_size (__s, 2 > 1)) return __wctomb_chk (__s, __wchar, __builtin_object_size (__s, 2 > 1)); return __wctomb_alias (__s, __wchar); } extern size_t __mbstowcs_chk (wchar_t *__restrict __dst, const char *__restrict __src, size_t __len, size_t __dstlen) __attribute__ ((__nothrow__ , __leaf__)); extern size_t __mbstowcs_alias (wchar_t *__restrict __dst, const char *__restrict __src, size_t __len) __asm__ ("" "mbstowcs") __attribute__ ((__nothrow__ , __leaf__)) ; extern size_t __mbstowcs_chk_warn (wchar_t *__restrict __dst, const char *__restrict __src, size_t __len, size_t __dstlen) __asm__ ("" "__mbstowcs_chk") __attribute__ ((__nothrow__ , __leaf__)) __attribute__((__warning__ ("mbstowcs called with dst buffer smaller than len " "* sizeof (wchar_t)"))) ; extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) size_t __attribute__ ((__nothrow__ , __leaf__)) mbstowcs (wchar_t *__restrict __dst, const char *__restrict __src, size_t __len) { if (__builtin_object_size (__dst, 2 > 1) != (size_t) -1) { if (!__builtin_constant_p (__len)) return __mbstowcs_chk (__dst, __src, __len, __builtin_object_size (__dst, 2 > 1) / sizeof (wchar_t)); if (__len > __builtin_object_size (__dst, 2 > 1) / sizeof (wchar_t)) return __mbstowcs_chk_warn (__dst, __src, __len, __builtin_object_size (__dst, 2 > 1) / sizeof (wchar_t)); } return __mbstowcs_alias (__dst, __src, __len); } extern size_t __wcstombs_chk (char *__restrict __dst, const wchar_t *__restrict __src, size_t __len, size_t __dstlen) __attribute__ ((__nothrow__ , __leaf__)); extern size_t __wcstombs_alias (char *__restrict __dst, const wchar_t *__restrict __src, size_t __len) __asm__ ("" "wcstombs") __attribute__ ((__nothrow__ , __leaf__)) ; extern size_t __wcstombs_chk_warn (char *__restrict __dst, const wchar_t *__restrict __src, size_t __len, size_t __dstlen) __asm__ ("" "__wcstombs_chk") __attribute__ ((__nothrow__ , __leaf__)) __attribute__((__warning__ ("wcstombs called with dst buffer smaller than len"))); extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) size_t __attribute__ ((__nothrow__ , __leaf__)) wcstombs (char *__restrict __dst, const wchar_t *__restrict __src, size_t __len) { if (__builtin_object_size (__dst, 2 > 1) != (size_t) -1) { if (!__builtin_constant_p (__len)) return __wcstombs_chk (__dst, __src, __len, __builtin_object_size (__dst, 2 > 1)); if (__len > __builtin_object_size (__dst, 2 > 1)) return __wcstombs_chk_warn (__dst, __src, __len, __builtin_object_size (__dst, 2 > 1)); } return __wcstombs_alias (__dst, __src, __len); } # 959 "/usr/include/stdlib.h" 2 3 4 # 967 "/usr/include/stdlib.h" 3 4 # 20 "src/tools/tor-fw-helper/tor-fw-helper.c" 2 # 1 "/usr/include/getopt.h" 1 3 4 # 57 "/usr/include/getopt.h" 3 4 extern char *optarg; # 71 "/usr/include/getopt.h" 3 4 extern int optind; extern int opterr; extern int optopt; # 104 "/usr/include/getopt.h" 3 4 struct option { const char *name; int has_arg; int *flag; int val; }; # 150 "/usr/include/getopt.h" 3 4 extern int getopt (int ___argc, char *const *___argv, const char *__shortopts) __attribute__ ((__nothrow__ , __leaf__)); # 173 "/usr/include/getopt.h" 3 4 extern int getopt_long (int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind) __attribute__ ((__nothrow__ , __leaf__)); extern int getopt_long_only (int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind) __attribute__ ((__nothrow__ , __leaf__)); # 21 "src/tools/tor-fw-helper/tor-fw-helper.c" 2 # 1 "/usr/include/time.h" 1 3 4 # 29 "/usr/include/time.h" 3 4 # 1 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include/stddef.h" 1 3 4 # 38 "/usr/include/time.h" 2 3 4 # 1 "/usr/include/bits/time.h" 1 3 4 # 42 "/usr/include/time.h" 2 3 4 # 131 "/usr/include/time.h" 3 4 struct tm { int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; int tm_wday; int tm_yday; int tm_isdst; long int tm_gmtoff; const char *tm_zone; }; struct itimerspec { struct timespec it_interval; struct timespec it_value; }; struct sigevent; # 186 "/usr/include/time.h" 3 4 extern clock_t clock (void) __attribute__ ((__nothrow__ , __leaf__)); extern time_t time (time_t *__timer) __attribute__ ((__nothrow__ , __leaf__)); extern double difftime (time_t __time1, time_t __time0) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern time_t mktime (struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__)); extern size_t strftime (char *__restrict __s, size_t __maxsize, const char *__restrict __format, const struct tm *__restrict __tp) __attribute__ ((__nothrow__ , __leaf__)); # 221 "/usr/include/time.h" 3 4 # 1 "/usr/include/xlocale.h" 1 3 4 # 27 "/usr/include/xlocale.h" 3 4 typedef struct __locale_struct { struct __locale_data *__locales[13]; const unsigned short int *__ctype_b; const int *__ctype_tolower; const int *__ctype_toupper; const char *__names[13]; } *__locale_t; typedef __locale_t locale_t; # 222 "/usr/include/time.h" 2 3 4 extern size_t strftime_l (char *__restrict __s, size_t __maxsize, const char *__restrict __format, const struct tm *__restrict __tp, __locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)); # 236 "/usr/include/time.h" 3 4 extern struct tm *gmtime (const time_t *__timer) __attribute__ ((__nothrow__ , __leaf__)); extern struct tm *localtime (const time_t *__timer) __attribute__ ((__nothrow__ , __leaf__)); extern struct tm *gmtime_r (const time_t *__restrict __timer, struct tm *__restrict __tp) __attribute__ ((__nothrow__ , __leaf__)); extern struct tm *localtime_r (const time_t *__restrict __timer, struct tm *__restrict __tp) __attribute__ ((__nothrow__ , __leaf__)); extern char *asctime (const struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__)); extern char *ctime (const time_t *__timer) __attribute__ ((__nothrow__ , __leaf__)); extern char *asctime_r (const struct tm *__restrict __tp, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)); extern char *ctime_r (const time_t *__restrict __timer, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)); extern char *__tzname[2]; extern int __daylight; extern long int __timezone; extern char *tzname[2]; extern void tzset (void) __attribute__ ((__nothrow__ , __leaf__)); extern int daylight; extern long int timezone; extern int stime (const time_t *__when) __attribute__ ((__nothrow__ , __leaf__)); # 319 "/usr/include/time.h" 3 4 extern time_t timegm (struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__)); extern time_t timelocal (struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__)); extern int dysize (int __year) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); # 334 "/usr/include/time.h" 3 4 extern int nanosleep (const struct timespec *__requested_time, struct timespec *__remaining); extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __attribute__ ((__nothrow__ , __leaf__)); extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __attribute__ ((__nothrow__ , __leaf__)); extern int clock_settime (clockid_t __clock_id, const struct timespec *__tp) __attribute__ ((__nothrow__ , __leaf__)); extern int clock_nanosleep (clockid_t __clock_id, int __flags, const struct timespec *__req, struct timespec *__rem); extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __attribute__ ((__nothrow__ , __leaf__)); extern int timer_create (clockid_t __clock_id, struct sigevent *__restrict __evp, timer_t *__restrict __timerid) __attribute__ ((__nothrow__ , __leaf__)); extern int timer_delete (timer_t __timerid) __attribute__ ((__nothrow__ , __leaf__)); extern int timer_settime (timer_t __timerid, int __flags, const struct itimerspec *__restrict __value, struct itimerspec *__restrict __ovalue) __attribute__ ((__nothrow__ , __leaf__)); extern int timer_gettime (timer_t __timerid, struct itimerspec *__value) __attribute__ ((__nothrow__ , __leaf__)); extern int timer_getoverrun (timer_t __timerid) __attribute__ ((__nothrow__ , __leaf__)); # 430 "/usr/include/time.h" 3 4 # 22 "src/tools/tor-fw-helper/tor-fw-helper.c" 2 # 1 "/usr/include/string.h" 1 3 4 # 27 "/usr/include/string.h" 3 4 # 1 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include/stddef.h" 1 3 4 # 33 "/usr/include/string.h" 2 3 4 # 44 "/usr/include/string.h" 3 4 extern void *memcpy (void *__restrict __dest, const void *__restrict __src, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern void *memmove (void *__dest, const void *__src, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern void *memccpy (void *__restrict __dest, const void *__restrict __src, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int memcmp (const void *__s1, const void *__s2, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); # 96 "/usr/include/string.h" 3 4 extern void *memchr (const void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); # 127 "/usr/include/string.h" 3 4 extern char *strcpy (char *__restrict __dest, const char *__restrict __src) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strncpy (char *__restrict __dest, const char *__restrict __src, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strcat (char *__restrict __dest, const char *__restrict __src) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strncat (char *__restrict __dest, const char *__restrict __src, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int strcmp (const char *__s1, const char *__s2) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strncmp (const char *__s1, const char *__s2, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strcoll (const char *__s1, const char *__s2) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern size_t strxfrm (char *__restrict __dest, const char *__restrict __src, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); # 166 "/usr/include/string.h" 3 4 extern int strcoll_l (const char *__s1, const char *__s2, __locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3))); extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n, __locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))); extern char *strdup (const char *__s) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1))); extern char *strndup (const char *__string, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1))); # 210 "/usr/include/string.h" 3 4 # 235 "/usr/include/string.h" 3 4 extern char *strchr (const char *__s, int __c) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); # 262 "/usr/include/string.h" 3 4 extern char *strrchr (const char *__s, int __c) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); # 281 "/usr/include/string.h" 3 4 extern size_t strcspn (const char *__s, const char *__reject) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern size_t strspn (const char *__s, const char *__accept) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); # 314 "/usr/include/string.h" 3 4 extern char *strpbrk (const char *__s, const char *__accept) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); # 341 "/usr/include/string.h" 3 4 extern char *strstr (const char *__haystack, const char *__needle) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strtok (char *__restrict __s, const char *__restrict __delim) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); extern char *__strtok_r (char *__restrict __s, const char *__restrict __delim, char **__restrict __save_ptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3))); extern char *strtok_r (char *__restrict __s, const char *__restrict __delim, char **__restrict __save_ptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3))); # 396 "/usr/include/string.h" 3 4 extern size_t strlen (const char *__s) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern size_t strnlen (const char *__string, size_t __maxlen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__)); # 426 "/usr/include/string.h" 3 4 extern int strerror_r (int __errnum, char *__buf, size_t __buflen) __asm__ ("" "__xpg_strerror_r") __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); # 444 "/usr/include/string.h" 3 4 extern char *strerror_l (int __errnum, __locale_t __l) __attribute__ ((__nothrow__ , __leaf__)); extern void __bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern void bcopy (const void *__src, void *__dest, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int bcmp (const void *__s1, const void *__s2, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); # 488 "/usr/include/string.h" 3 4 extern char *index (const char *__s, int __c) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); # 516 "/usr/include/string.h" 3 4 extern char *rindex (const char *__s, int __c) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); # 533 "/usr/include/string.h" 3 4 extern int strcasecmp (const char *__s1, const char *__s2) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strncasecmp (const char *__s1, const char *__s2, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); # 556 "/usr/include/string.h" 3 4 extern char *strsep (char **__restrict __stringp, const char *__restrict __delim) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__)); extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern char *stpcpy (char *__restrict __dest, const char *__restrict __src) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern char *__stpncpy (char *__restrict __dest, const char *__restrict __src, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern char *stpncpy (char *__restrict __dest, const char *__restrict __src, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); # 631 "/usr/include/string.h" 3 4 # 1 "/usr/include/bits/string.h" 1 3 4 # 632 "/usr/include/string.h" 2 3 4 # 1 "/usr/include/bits/string2.h" 1 3 4 # 393 "/usr/include/bits/string2.h" 3 4 extern void *__rawmemchr (const void *__s, int __c); # 945 "/usr/include/bits/string2.h" 3 4 extern __inline __attribute__ ((__gnu_inline__)) size_t __strcspn_c1 (const char *__s, int __reject); extern __inline __attribute__ ((__gnu_inline__)) size_t __strcspn_c1 (const char *__s, int __reject) { size_t __result = 0; while (__s[__result] != '\0' && __s[__result] != __reject) ++__result; return __result; } extern __inline __attribute__ ((__gnu_inline__)) size_t __strcspn_c2 (const char *__s, int __reject1, int __reject2); extern __inline __attribute__ ((__gnu_inline__)) size_t __strcspn_c2 (const char *__s, int __reject1, int __reject2) { size_t __result = 0; while (__s[__result] != '\0' && __s[__result] != __reject1 && __s[__result] != __reject2) ++__result; return __result; } extern __inline __attribute__ ((__gnu_inline__)) size_t __strcspn_c3 (const char *__s, int __reject1, int __reject2, int __reject3); extern __inline __attribute__ ((__gnu_inline__)) size_t __strcspn_c3 (const char *__s, int __reject1, int __reject2, int __reject3) { size_t __result = 0; while (__s[__result] != '\0' && __s[__result] != __reject1 && __s[__result] != __reject2 && __s[__result] != __reject3) ++__result; return __result; } # 1021 "/usr/include/bits/string2.h" 3 4 extern __inline __attribute__ ((__gnu_inline__)) size_t __strspn_c1 (const char *__s, int __accept); extern __inline __attribute__ ((__gnu_inline__)) size_t __strspn_c1 (const char *__s, int __accept) { size_t __result = 0; while (__s[__result] == __accept) ++__result; return __result; } extern __inline __attribute__ ((__gnu_inline__)) size_t __strspn_c2 (const char *__s, int __accept1, int __accept2); extern __inline __attribute__ ((__gnu_inline__)) size_t __strspn_c2 (const char *__s, int __accept1, int __accept2) { size_t __result = 0; while (__s[__result] == __accept1 || __s[__result] == __accept2) ++__result; return __result; } extern __inline __attribute__ ((__gnu_inline__)) size_t __strspn_c3 (const char *__s, int __accept1, int __accept2, int __accept3); extern __inline __attribute__ ((__gnu_inline__)) size_t __strspn_c3 (const char *__s, int __accept1, int __accept2, int __accept3) { size_t __result = 0; while (__s[__result] == __accept1 || __s[__result] == __accept2 || __s[__result] == __accept3) ++__result; return __result; } # 1097 "/usr/include/bits/string2.h" 3 4 extern __inline __attribute__ ((__gnu_inline__)) char *__strpbrk_c2 (const char *__s, int __accept1, int __accept2); extern __inline __attribute__ ((__gnu_inline__)) char * __strpbrk_c2 (const char *__s, int __accept1, int __accept2) { while (*__s != '\0' && *__s != __accept1 && *__s != __accept2) ++__s; return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s; } extern __inline __attribute__ ((__gnu_inline__)) char *__strpbrk_c3 (const char *__s, int __accept1, int __accept2, int __accept3); extern __inline __attribute__ ((__gnu_inline__)) char * __strpbrk_c3 (const char *__s, int __accept1, int __accept2, int __accept3) { while (*__s != '\0' && *__s != __accept1 && *__s != __accept2 && *__s != __accept3) ++__s; return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s; } # 1147 "/usr/include/bits/string2.h" 3 4 extern __inline __attribute__ ((__gnu_inline__)) char *__strtok_r_1c (char *__s, char __sep, char **__nextp); extern __inline __attribute__ ((__gnu_inline__)) char * __strtok_r_1c (char *__s, char __sep, char **__nextp) { char *__result; if (__s == ((void *)0)) __s = *__nextp; while (*__s == __sep) ++__s; __result = ((void *)0); if (*__s != '\0') { __result = __s++; while (*__s != '\0') if (*__s++ == __sep) { __s[-1] = '\0'; break; } } *__nextp = __s; return __result; } # 1179 "/usr/include/bits/string2.h" 3 4 extern char *__strsep_g (char **__stringp, const char *__delim); # 1197 "/usr/include/bits/string2.h" 3 4 extern __inline __attribute__ ((__gnu_inline__)) char *__strsep_1c (char **__s, char __reject); extern __inline __attribute__ ((__gnu_inline__)) char * __strsep_1c (char **__s, char __reject) { char *__retval = *__s; if (__retval != ((void *)0) && (*__s = (__extension__ (__builtin_constant_p (__reject) && !__builtin_constant_p (__retval) && (__reject) == '\0' ? (char *) __rawmemchr (__retval, __reject) : __builtin_strchr (__retval, __reject)))) != ((void *)0)) *(*__s)++ = '\0'; return __retval; } extern __inline __attribute__ ((__gnu_inline__)) char *__strsep_2c (char **__s, char __reject1, char __reject2); extern __inline __attribute__ ((__gnu_inline__)) char * __strsep_2c (char **__s, char __reject1, char __reject2) { char *__retval = *__s; if (__retval != ((void *)0)) { char *__cp = __retval; while (1) { if (*__cp == '\0') { __cp = ((void *)0); break; } if (*__cp == __reject1 || *__cp == __reject2) { *__cp++ = '\0'; break; } ++__cp; } *__s = __cp; } return __retval; } extern __inline __attribute__ ((__gnu_inline__)) char *__strsep_3c (char **__s, char __reject1, char __reject2, char __reject3); extern __inline __attribute__ ((__gnu_inline__)) char * __strsep_3c (char **__s, char __reject1, char __reject2, char __reject3) { char *__retval = *__s; if (__retval != ((void *)0)) { char *__cp = __retval; while (1) { if (*__cp == '\0') { __cp = ((void *)0); break; } if (*__cp == __reject1 || *__cp == __reject2 || *__cp == __reject3) { *__cp++ = '\0'; break; } ++__cp; } *__s = __cp; } return __retval; } # 1278 "/usr/include/bits/string2.h" 3 4 extern char *__strdup (const char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)); # 1297 "/usr/include/bits/string2.h" 3 4 extern char *__strndup (const char *__string, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)); # 635 "/usr/include/string.h" 2 3 4 # 1 "/usr/include/bits/string3.h" 1 3 4 # 22 "/usr/include/bits/string3.h" 3 4 extern void __warn_memset_zero_len (void) __attribute__((__warning__ ("memset used with constant zero length parameter; this could be due to transposed parameters"))) ; # 47 "/usr/include/bits/string3.h" 3 4 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) void * __attribute__ ((__nothrow__ , __leaf__)) memcpy (void *__restrict __dest, const void *__restrict __src, size_t __len) { return __builtin___memcpy_chk (__dest, __src, __len, __builtin_object_size (__dest, 0)); } extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) void * __attribute__ ((__nothrow__ , __leaf__)) memmove (void *__dest, const void *__src, size_t __len) { return __builtin___memmove_chk (__dest, __src, __len, __builtin_object_size (__dest, 0)); } # 75 "/usr/include/bits/string3.h" 3 4 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) void * __attribute__ ((__nothrow__ , __leaf__)) memset (void *__dest, int __ch, size_t __len) { if (__builtin_constant_p (__len) && __len == 0 && (!__builtin_constant_p (__ch) || __ch != 0)) { __warn_memset_zero_len (); return __dest; } return __builtin___memset_chk (__dest, __ch, __len, __builtin_object_size (__dest, 0)); } extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) void __attribute__ ((__nothrow__ , __leaf__)) bcopy (const void *__src, void *__dest, size_t __len) { (void) __builtin___memmove_chk (__dest, __src, __len, __builtin_object_size (__dest, 0)); } extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) void __attribute__ ((__nothrow__ , __leaf__)) bzero (void *__dest, size_t __len) { (void) __builtin___memset_chk (__dest, '\0', __len, __builtin_object_size (__dest, 0)); } extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) char * __attribute__ ((__nothrow__ , __leaf__)) strcpy (char *__restrict __dest, const char *__restrict __src) { return __builtin___strcpy_chk (__dest, __src, __builtin_object_size (__dest, 2 > 1)); } # 116 "/usr/include/bits/string3.h" 3 4 extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) char * __attribute__ ((__nothrow__ , __leaf__)) strncpy (char *__restrict __dest, const char *__restrict __src, size_t __len) { return __builtin___strncpy_chk (__dest, __src, __len, __builtin_object_size (__dest, 2 > 1)); } extern char *__stpncpy_chk (char *__dest, const char *__src, size_t __n, size_t __destlen) __attribute__ ((__nothrow__ , __leaf__)); extern char *__stpncpy_alias (char *__dest, const char *__src, size_t __n) __asm__ ("" "stpncpy") __attribute__ ((__nothrow__ , __leaf__)) ; extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) char * __attribute__ ((__nothrow__ , __leaf__)) stpncpy (char *__dest, const char *__src, size_t __n) { if (__builtin_object_size (__dest, 2 > 1) != (size_t) -1 && (!__builtin_constant_p (__n) || __n <= __builtin_object_size (__dest, 2 > 1))) return __stpncpy_chk (__dest, __src, __n, __builtin_object_size (__dest, 2 > 1)); return __stpncpy_alias (__dest, __src, __n); } extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) char * __attribute__ ((__nothrow__ , __leaf__)) strcat (char *__restrict __dest, const char *__restrict __src) { return __builtin___strcat_chk (__dest, __src, __builtin_object_size (__dest, 2 > 1)); } extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) char * __attribute__ ((__nothrow__ , __leaf__)) strncat (char *__restrict __dest, const char *__restrict __src, size_t __len) { return __builtin___strncat_chk (__dest, __src, __len, __builtin_object_size (__dest, 2 > 1)); } # 640 "/usr/include/string.h" 2 3 4 # 23 "src/tools/tor-fw-helper/tor-fw-helper.c" 2 # 1 "/usr/include/assert.h" 1 3 4 # 64 "/usr/include/assert.h" 3 4 extern void __assert_fail (const char *__assertion, const char *__file, unsigned int __line, const char *__function) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__)); extern void __assert_perror_fail (int __errnum, const char *__file, unsigned int __line, const char *__function) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__)); extern void __assert (const char *__assertion, const char *__file, int __line) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__)); # 24 "src/tools/tor-fw-helper/tor-fw-helper.c" 2 # 1 "./src/common/container.h" 1 # 9 "./src/common/container.h" # 1 "./src/common/util.h" 1 # 14 "./src/common/util.h" # 1 "./orconfig.h" 1 # 15 "./src/common/util.h" 2 # 1 "./src/common/torint.h" 1 # 14 "./src/common/torint.h" # 1 "./orconfig.h" 1 # 15 "./src/common/torint.h" 2 # 23 "./src/common/torint.h" # 1 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include-fixed/limits.h" 1 3 4 # 34 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include-fixed/limits.h" 3 4 # 1 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include-fixed/syslimits.h" 1 3 4 # 1 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include-fixed/limits.h" 1 3 4 # 168 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include-fixed/limits.h" 3 4 # 1 "/usr/include/limits.h" 1 3 4 # 143 "/usr/include/limits.h" 3 4 # 1 "/usr/include/bits/posix1_lim.h" 1 3 4 # 160 "/usr/include/bits/posix1_lim.h" 3 4 # 1 "/usr/include/bits/local_lim.h" 1 3 4 # 38 "/usr/include/bits/local_lim.h" 3 4 # 1 "/usr/include/linux/limits.h" 1 3 4 # 39 "/usr/include/bits/local_lim.h" 2 3 4 # 161 "/usr/include/bits/posix1_lim.h" 2 3 4 # 144 "/usr/include/limits.h" 2 3 4 # 1 "/usr/include/bits/posix2_lim.h" 1 3 4 # 148 "/usr/include/limits.h" 2 3 4 # 169 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include-fixed/limits.h" 2 3 4 # 8 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include-fixed/syslimits.h" 2 3 4 # 35 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include-fixed/limits.h" 2 3 4 # 24 "./src/common/torint.h" 2 # 40 "./src/common/torint.h" # 1 "/usr/include/inttypes.h" 1 3 4 # 34 "/usr/include/inttypes.h" 3 4 typedef int __gwchar_t; # 266 "/usr/include/inttypes.h" 3 4 typedef struct { long int quot; long int rem; } imaxdiv_t; # 290 "/usr/include/inttypes.h" 3 4 extern intmax_t imaxabs (intmax_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern imaxdiv_t imaxdiv (intmax_t __numer, intmax_t __denom) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern intmax_t strtoimax (const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__ ((__nothrow__ , __leaf__)); extern uintmax_t strtoumax (const char *__restrict __nptr, char ** __restrict __endptr, int __base) __attribute__ ((__nothrow__ , __leaf__)); extern intmax_t wcstoimax (const __gwchar_t *__restrict __nptr, __gwchar_t **__restrict __endptr, int __base) __attribute__ ((__nothrow__ , __leaf__)); extern uintmax_t wcstoumax (const __gwchar_t *__restrict __nptr, __gwchar_t ** __restrict __endptr, int __base) __attribute__ ((__nothrow__ , __leaf__)); extern long int __strtol_internal (const char *__restrict __nptr, char **__restrict __endptr, int __base, int __group) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); extern __inline __attribute__ ((__gnu_inline__)) intmax_t __attribute__ ((__nothrow__ , __leaf__)) strtoimax (const char *__restrict nptr, char **__restrict endptr, int base) { return __strtol_internal (nptr, endptr, base, 0); } extern unsigned long int __strtoul_internal (const char *__restrict __nptr, char ** __restrict __endptr, int __base, int __group) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); extern __inline __attribute__ ((__gnu_inline__)) uintmax_t __attribute__ ((__nothrow__ , __leaf__)) strtoumax (const char *__restrict nptr, char **__restrict endptr, int base) { return __strtoul_internal (nptr, endptr, base, 0); } extern long int __wcstol_internal (const __gwchar_t * __restrict __nptr, __gwchar_t **__restrict __endptr, int __base, int __group) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); extern __inline __attribute__ ((__gnu_inline__)) intmax_t __attribute__ ((__nothrow__ , __leaf__)) wcstoimax (const __gwchar_t *__restrict nptr, __gwchar_t **__restrict endptr, int base) { return __wcstol_internal (nptr, endptr, base, 0); } extern unsigned long int __wcstoul_internal (const __gwchar_t * __restrict __nptr, __gwchar_t ** __restrict __endptr, int __base, int __group) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__warn_unused_result__)); extern __inline __attribute__ ((__gnu_inline__)) uintmax_t __attribute__ ((__nothrow__ , __leaf__)) wcstoumax (const __gwchar_t *__restrict nptr, __gwchar_t **__restrict endptr, int base) { return __wcstoul_internal (nptr, endptr, base, 0); } # 432 "/usr/include/inttypes.h" 3 4 # 41 "./src/common/torint.h" 2 # 16 "./src/common/util.h" 2 # 1 "./src/common/compat.h" 1 # 9 "./src/common/compat.h" # 1 "./orconfig.h" 1 # 10 "./src/common/compat.h" 2 # 1 "./src/common/testsupport.h" 1 # 12 "./src/common/compat.h" 2 # 25 "./src/common/compat.h" # 1 "/usr/include/sys/param.h" 1 3 4 # 23 "/usr/include/sys/param.h" 3 4 # 1 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include/stddef.h" 1 3 4 # 24 "/usr/include/sys/param.h" 2 3 4 # 1 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include-fixed/limits.h" 1 3 4 # 27 "/usr/include/sys/param.h" 2 3 4 # 1 "/usr/include/signal.h" 1 3 4 # 30 "/usr/include/signal.h" 3 4 # 1 "/usr/include/bits/sigset.h" 1 3 4 # 102 "/usr/include/bits/sigset.h" 3 4 extern int __sigismember (const __sigset_t *, int); extern int __sigaddset (__sigset_t *, int); extern int __sigdelset (__sigset_t *, int); # 116 "/usr/include/bits/sigset.h" 3 4 extern __inline __attribute__ ((__gnu_inline__)) int __sigismember (const __sigset_t *__set, int __sig) { unsigned long int __mask = (((unsigned long int) 1) << (((__sig) - 1) % (8 * sizeof (unsigned long int)))); unsigned long int __word = (((__sig) - 1) / (8 * sizeof (unsigned long int))); return (__set->__val[__word] & __mask) ? 1 : 0; } extern __inline __attribute__ ((__gnu_inline__)) int __sigaddset ( __sigset_t *__set, int __sig) { unsigned long int __mask = (((unsigned long int) 1) << (((__sig) - 1) % (8 * sizeof (unsigned long int)))); unsigned long int __word = (((__sig) - 1) / (8 * sizeof (unsigned long int))); return ((__set->__val[__word] |= __mask), 0); } extern __inline __attribute__ ((__gnu_inline__)) int __sigdelset ( __sigset_t *__set, int __sig) { unsigned long int __mask = (((unsigned long int) 1) << (((__sig) - 1) % (8 * sizeof (unsigned long int)))); unsigned long int __word = (((__sig) - 1) / (8 * sizeof (unsigned long int))); return ((__set->__val[__word] &= ~__mask), 0); } # 33 "/usr/include/signal.h" 2 3 4 typedef __sig_atomic_t sig_atomic_t; # 57 "/usr/include/signal.h" 3 4 # 1 "/usr/include/bits/signum.h" 1 3 4 # 58 "/usr/include/signal.h" 2 3 4 # 80 "/usr/include/signal.h" 3 4 # 1 "/usr/include/bits/siginfo.h" 1 3 4 # 24 "/usr/include/bits/siginfo.h" 3 4 # 1 "/usr/include/bits/wordsize.h" 1 3 4 # 25 "/usr/include/bits/siginfo.h" 2 3 4 typedef union sigval { int sival_int; void *sival_ptr; } sigval_t; # 58 "/usr/include/bits/siginfo.h" 3 4 typedef __clock_t __sigchld_clock_t; typedef struct { int si_signo; int si_errno; int si_code; union { int _pad[((128 / sizeof (int)) - 4)]; struct { __pid_t si_pid; __uid_t si_uid; } _kill; struct { int si_tid; int si_overrun; sigval_t si_sigval; } _timer; struct { __pid_t si_pid; __uid_t si_uid; sigval_t si_sigval; } _rt; struct { __pid_t si_pid; __uid_t si_uid; int si_status; __sigchld_clock_t si_utime; __sigchld_clock_t si_stime; } _sigchld; struct { void *si_addr; short int si_addr_lsb; } _sigfault; struct { long int si_band; int si_fd; } _sigpoll; struct { void *_call_addr; int _syscall; unsigned int _arch; } _sigsys; } _sifields; } siginfo_t ; # 153 "/usr/include/bits/siginfo.h" 3 4 enum { SI_ASYNCNL = -60, SI_TKILL = -6, SI_SIGIO, SI_ASYNCIO, SI_MESGQ, SI_TIMER, SI_QUEUE, SI_USER, SI_KERNEL = 0x80 }; enum { ILL_ILLOPC = 1, ILL_ILLOPN, ILL_ILLADR, ILL_ILLTRP, ILL_PRVOPC, ILL_PRVREG, ILL_COPROC, ILL_BADSTK }; enum { FPE_INTDIV = 1, FPE_INTOVF, FPE_FLTDIV, FPE_FLTOVF, FPE_FLTUND, FPE_FLTRES, FPE_FLTINV, FPE_FLTSUB }; enum { SEGV_MAPERR = 1, SEGV_ACCERR }; enum { BUS_ADRALN = 1, BUS_ADRERR, BUS_OBJERR, BUS_MCEERR_AR, BUS_MCEERR_AO }; # 257 "/usr/include/bits/siginfo.h" 3 4 enum { CLD_EXITED = 1, CLD_KILLED, CLD_DUMPED, CLD_TRAPPED, CLD_STOPPED, CLD_CONTINUED }; enum { POLL_IN = 1, POLL_OUT, POLL_MSG, POLL_ERR, POLL_PRI, POLL_HUP }; # 313 "/usr/include/bits/siginfo.h" 3 4 typedef struct sigevent { sigval_t sigev_value; int sigev_signo; int sigev_notify; union { int _pad[((64 / sizeof (int)) - 4)]; __pid_t _tid; struct { void (*_function) (sigval_t); pthread_attr_t *_attribute; } _sigev_thread; } _sigev_un; } sigevent_t; enum { SIGEV_SIGNAL = 0, SIGEV_NONE, SIGEV_THREAD, SIGEV_THREAD_ID = 4 }; # 81 "/usr/include/signal.h" 2 3 4 typedef void (*__sighandler_t) (int); extern __sighandler_t __sysv_signal (int __sig, __sighandler_t __handler) __attribute__ ((__nothrow__ , __leaf__)); # 100 "/usr/include/signal.h" 3 4 extern __sighandler_t signal (int __sig, __sighandler_t __handler) __attribute__ ((__nothrow__ , __leaf__)); # 114 "/usr/include/signal.h" 3 4 # 127 "/usr/include/signal.h" 3 4 extern int kill (__pid_t __pid, int __sig) __attribute__ ((__nothrow__ , __leaf__)); extern int killpg (__pid_t __pgrp, int __sig) __attribute__ ((__nothrow__ , __leaf__)); extern int raise (int __sig) __attribute__ ((__nothrow__ , __leaf__)); extern __sighandler_t ssignal (int __sig, __sighandler_t __handler) __attribute__ ((__nothrow__ , __leaf__)); extern int gsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__)); extern void psignal (int __sig, const char *__s); extern void psiginfo (const siginfo_t *__pinfo, const char *__s); # 167 "/usr/include/signal.h" 3 4 extern int __sigpause (int __sig_or_mask, int __is_sig); # 189 "/usr/include/signal.h" 3 4 extern int sigblock (int __mask) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__deprecated__)); extern int sigsetmask (int __mask) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__deprecated__)); extern int siggetmask (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__deprecated__)); # 209 "/usr/include/signal.h" 3 4 typedef __sighandler_t sig_t; extern int sigemptyset (sigset_t *__set) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int sigfillset (sigset_t *__set) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int sigaddset (sigset_t *__set, int __signo) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int sigdelset (sigset_t *__set, int __signo) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int sigismember (const sigset_t *__set, int __signo) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); # 245 "/usr/include/signal.h" 3 4 # 1 "/usr/include/bits/sigaction.h" 1 3 4 # 24 "/usr/include/bits/sigaction.h" 3 4 struct sigaction { union { __sighandler_t sa_handler; void (*sa_sigaction) (int, siginfo_t *, void *); } __sigaction_handler; __sigset_t sa_mask; int sa_flags; void (*sa_restorer) (void); }; # 246 "/usr/include/signal.h" 2 3 4 extern int sigprocmask (int __how, const sigset_t *__restrict __set, sigset_t *__restrict __oset) __attribute__ ((__nothrow__ , __leaf__)); extern int sigsuspend (const sigset_t *__set) __attribute__ ((__nonnull__ (1))); extern int sigaction (int __sig, const struct sigaction *__restrict __act, struct sigaction *__restrict __oact) __attribute__ ((__nothrow__ , __leaf__)); extern int sigpending (sigset_t *__set) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int sigwait (const sigset_t *__restrict __set, int *__restrict __sig) __attribute__ ((__nonnull__ (1, 2))); extern int sigwaitinfo (const sigset_t *__restrict __set, siginfo_t *__restrict __info) __attribute__ ((__nonnull__ (1))); extern int sigtimedwait (const sigset_t *__restrict __set, siginfo_t *__restrict __info, const struct timespec *__restrict __timeout) __attribute__ ((__nonnull__ (1))); extern int sigqueue (__pid_t __pid, int __sig, const union sigval __val) __attribute__ ((__nothrow__ , __leaf__)); # 303 "/usr/include/signal.h" 3 4 extern const char *const _sys_siglist[65]; extern const char *const sys_siglist[65]; struct sigvec { __sighandler_t sv_handler; int sv_mask; int sv_flags; }; # 327 "/usr/include/signal.h" 3 4 extern int sigvec (int __sig, const struct sigvec *__vec, struct sigvec *__ovec) __attribute__ ((__nothrow__ , __leaf__)); # 1 "/usr/include/bits/sigcontext.h" 1 3 4 # 29 "/usr/include/bits/sigcontext.h" 3 4 struct _fpx_sw_bytes { __uint32_t magic1; __uint32_t extended_size; __uint64_t xstate_bv; __uint32_t xstate_size; __uint32_t padding[7]; }; struct _fpreg { unsigned short significand[4]; unsigned short exponent; }; struct _fpxreg { unsigned short significand[4]; unsigned short exponent; unsigned short padding[3]; }; struct _xmmreg { __uint32_t element[4]; }; # 121 "/usr/include/bits/sigcontext.h" 3 4 struct _fpstate { __uint16_t cwd; __uint16_t swd; __uint16_t ftw; __uint16_t fop; __uint64_t rip; __uint64_t rdp; __uint32_t mxcsr; __uint32_t mxcr_mask; struct _fpxreg _st[8]; struct _xmmreg _xmm[16]; __uint32_t padding[24]; }; struct sigcontext { __uint64_t r8; __uint64_t r9; __uint64_t r10; __uint64_t r11; __uint64_t r12; __uint64_t r13; __uint64_t r14; __uint64_t r15; __uint64_t rdi; __uint64_t rsi; __uint64_t rbp; __uint64_t rbx; __uint64_t rdx; __uint64_t rax; __uint64_t rcx; __uint64_t rsp; __uint64_t rip; __uint64_t eflags; unsigned short cs; unsigned short gs; unsigned short fs; unsigned short __pad0; __uint64_t err; __uint64_t trapno; __uint64_t oldmask; __uint64_t cr2; __extension__ union { struct _fpstate * fpstate; __uint64_t __fpstate_word; }; __uint64_t __reserved1 [8]; }; struct _xsave_hdr { __uint64_t xstate_bv; __uint64_t reserved1[2]; __uint64_t reserved2[5]; }; struct _ymmh_state { __uint32_t ymmh_space[64]; }; struct _xstate { struct _fpstate fpstate; struct _xsave_hdr xstate_hdr; struct _ymmh_state ymmh; }; # 333 "/usr/include/signal.h" 2 3 4 extern int sigreturn (struct sigcontext *__scp) __attribute__ ((__nothrow__ , __leaf__)); # 1 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include/stddef.h" 1 3 4 # 343 "/usr/include/signal.h" 2 3 4 extern int siginterrupt (int __sig, int __interrupt) __attribute__ ((__nothrow__ , __leaf__)); # 1 "/usr/include/bits/sigstack.h" 1 3 4 # 25 "/usr/include/bits/sigstack.h" 3 4 struct sigstack { void *ss_sp; int ss_onstack; }; enum { SS_ONSTACK = 1, SS_DISABLE }; # 49 "/usr/include/bits/sigstack.h" 3 4 typedef struct sigaltstack { void *ss_sp; int ss_flags; size_t ss_size; } stack_t; # 350 "/usr/include/signal.h" 2 3 4 # 1 "/usr/include/sys/ucontext.h" 1 3 4 # 22 "/usr/include/sys/ucontext.h" 3 4 # 1 "/usr/include/signal.h" 1 3 4 # 23 "/usr/include/sys/ucontext.h" 2 3 4 # 31 "/usr/include/sys/ucontext.h" 3 4 __extension__ typedef long long int greg_t; typedef greg_t gregset_t[23]; # 92 "/usr/include/sys/ucontext.h" 3 4 struct _libc_fpxreg { unsigned short int significand[4]; unsigned short int exponent; unsigned short int padding[3]; }; struct _libc_xmmreg { __uint32_t element[4]; }; struct _libc_fpstate { __uint16_t cwd; __uint16_t swd; __uint16_t ftw; __uint16_t fop; __uint64_t rip; __uint64_t rdp; __uint32_t mxcsr; __uint32_t mxcr_mask; struct _libc_fpxreg _st[8]; struct _libc_xmmreg _xmm[16]; __uint32_t padding[24]; }; typedef struct _libc_fpstate *fpregset_t; typedef struct { gregset_t gregs; fpregset_t fpregs; __extension__ unsigned long long __reserved1 [8]; } mcontext_t; typedef struct ucontext { unsigned long int uc_flags; struct ucontext *uc_link; stack_t uc_stack; mcontext_t uc_mcontext; __sigset_t uc_sigmask; struct _libc_fpstate __fpregs_mem; } ucontext_t; # 353 "/usr/include/signal.h" 2 3 4 extern int sigstack (struct sigstack *__ss, struct sigstack *__oss) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__deprecated__)); extern int sigaltstack (const struct sigaltstack *__restrict __ss, struct sigaltstack *__restrict __oss) __attribute__ ((__nothrow__ , __leaf__)); # 388 "/usr/include/signal.h" 3 4 # 1 "/usr/include/bits/sigthread.h" 1 3 4 # 30 "/usr/include/bits/sigthread.h" 3 4 extern int pthread_sigmask (int __how, const __sigset_t *__restrict __newmask, __sigset_t *__restrict __oldmask)__attribute__ ((__nothrow__ , __leaf__)); extern int pthread_kill (pthread_t __threadid, int __signo) __attribute__ ((__nothrow__ , __leaf__)); # 389 "/usr/include/signal.h" 2 3 4 extern int __libc_current_sigrtmin (void) __attribute__ ((__nothrow__ , __leaf__)); extern int __libc_current_sigrtmax (void) __attribute__ ((__nothrow__ , __leaf__)); # 29 "/usr/include/sys/param.h" 2 3 4 # 1 "/usr/include/bits/param.h" 1 3 4 # 28 "/usr/include/bits/param.h" 3 4 # 1 "/usr/include/linux/param.h" 1 3 4 # 1 "/usr/include/asm/param.h" 1 3 4 # 1 "/usr/include/asm-generic/param.h" 1 3 4 # 1 "/usr/include/asm/param.h" 2 3 4 # 5 "/usr/include/linux/param.h" 2 3 4 # 29 "/usr/include/bits/param.h" 2 3 4 # 32 "/usr/include/sys/param.h" 2 3 4 # 26 "./src/common/compat.h" 2 # 1 "/usr/include/sys/time.h" 1 3 4 # 27 "/usr/include/sys/time.h" 3 4 # 1 "/usr/include/bits/time.h" 1 3 4 # 28 "/usr/include/sys/time.h" 2 3 4 # 37 "/usr/include/sys/time.h" 3 4 # 55 "/usr/include/sys/time.h" 3 4 struct timezone { int tz_minuteswest; int tz_dsttime; }; typedef struct timezone *__restrict __timezone_ptr_t; # 71 "/usr/include/sys/time.h" 3 4 extern int gettimeofday (struct timeval *__restrict __tv, __timezone_ptr_t __tz) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int settimeofday (const struct timeval *__tv, const struct timezone *__tz) __attribute__ ((__nothrow__ , __leaf__)); extern int adjtime (const struct timeval *__delta, struct timeval *__olddelta) __attribute__ ((__nothrow__ , __leaf__)); enum __itimer_which { ITIMER_REAL = 0, ITIMER_VIRTUAL = 1, ITIMER_PROF = 2 }; struct itimerval { struct timeval it_interval; struct timeval it_value; }; typedef int __itimer_which_t; extern int getitimer (__itimer_which_t __which, struct itimerval *__value) __attribute__ ((__nothrow__ , __leaf__)); extern int setitimer (__itimer_which_t __which, const struct itimerval *__restrict __new, struct itimerval *__restrict __old) __attribute__ ((__nothrow__ , __leaf__)); extern int utimes (const char *__file, const struct timeval __tvp[2]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int lutimes (const char *__file, const struct timeval __tvp[2]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int futimes (int __fd, const struct timeval __tvp[2]) __attribute__ ((__nothrow__ , __leaf__)); # 189 "/usr/include/sys/time.h" 3 4 # 32 "./src/common/compat.h" 2 # 1 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include/stdarg.h" 1 3 4 # 40 "./src/common/compat.h" 2 # 1 "/usr/include/sys/resource.h" 1 3 4 # 24 "/usr/include/sys/resource.h" 3 4 # 1 "/usr/include/bits/resource.h" 1 3 4 # 31 "/usr/include/bits/resource.h" 3 4 enum __rlimit_resource { RLIMIT_CPU = 0, RLIMIT_FSIZE = 1, RLIMIT_DATA = 2, RLIMIT_STACK = 3, RLIMIT_CORE = 4, __RLIMIT_RSS = 5, RLIMIT_NOFILE = 7, __RLIMIT_OFILE = RLIMIT_NOFILE, RLIMIT_AS = 9, __RLIMIT_NPROC = 6, __RLIMIT_MEMLOCK = 8, __RLIMIT_LOCKS = 10, __RLIMIT_SIGPENDING = 11, __RLIMIT_MSGQUEUE = 12, __RLIMIT_NICE = 13, __RLIMIT_RTPRIO = 14, __RLIMIT_RTTIME = 15, __RLIMIT_NLIMITS = 16, __RLIM_NLIMITS = __RLIMIT_NLIMITS }; # 131 "/usr/include/bits/resource.h" 3 4 typedef __rlim_t rlim_t; struct rlimit { rlim_t rlim_cur; rlim_t rlim_max; }; # 158 "/usr/include/bits/resource.h" 3 4 enum __rusage_who { RUSAGE_SELF = 0, RUSAGE_CHILDREN = -1 # 176 "/usr/include/bits/resource.h" 3 4 }; # 1 "/usr/include/bits/time.h" 1 3 4 # 180 "/usr/include/bits/resource.h" 2 3 4 struct rusage { struct timeval ru_utime; struct timeval ru_stime; __extension__ union { long int ru_maxrss; __syscall_slong_t __ru_maxrss_word; }; __extension__ union { long int ru_ixrss; __syscall_slong_t __ru_ixrss_word; }; __extension__ union { long int ru_idrss; __syscall_slong_t __ru_idrss_word; }; __extension__ union { long int ru_isrss; __syscall_slong_t __ru_isrss_word; }; __extension__ union { long int ru_minflt; __syscall_slong_t __ru_minflt_word; }; __extension__ union { long int ru_majflt; __syscall_slong_t __ru_majflt_word; }; __extension__ union { long int ru_nswap; __syscall_slong_t __ru_nswap_word; }; __extension__ union { long int ru_inblock; __syscall_slong_t __ru_inblock_word; }; __extension__ union { long int ru_oublock; __syscall_slong_t __ru_oublock_word; }; __extension__ union { long int ru_msgsnd; __syscall_slong_t __ru_msgsnd_word; }; __extension__ union { long int ru_msgrcv; __syscall_slong_t __ru_msgrcv_word; }; __extension__ union { long int ru_nsignals; __syscall_slong_t __ru_nsignals_word; }; __extension__ union { long int ru_nvcsw; __syscall_slong_t __ru_nvcsw_word; }; __extension__ union { long int ru_nivcsw; __syscall_slong_t __ru_nivcsw_word; }; }; enum __priority_which { PRIO_PROCESS = 0, PRIO_PGRP = 1, PRIO_USER = 2 }; # 328 "/usr/include/bits/resource.h" 3 4 # 25 "/usr/include/sys/resource.h" 2 3 4 # 42 "/usr/include/sys/resource.h" 3 4 typedef int __rlimit_resource_t; typedef int __rusage_who_t; typedef int __priority_which_t; extern int getrlimit (__rlimit_resource_t __resource, struct rlimit *__rlimits) __attribute__ ((__nothrow__ , __leaf__)); # 69 "/usr/include/sys/resource.h" 3 4 extern int setrlimit (__rlimit_resource_t __resource, const struct rlimit *__rlimits) __attribute__ ((__nothrow__ , __leaf__)); # 87 "/usr/include/sys/resource.h" 3 4 extern int getrusage (__rusage_who_t __who, struct rusage *__usage) __attribute__ ((__nothrow__ , __leaf__)); extern int getpriority (__priority_which_t __which, id_t __who) __attribute__ ((__nothrow__ , __leaf__)); extern int setpriority (__priority_which_t __which, id_t __who, int __prio) __attribute__ ((__nothrow__ , __leaf__)); # 42 "./src/common/compat.h" 2 # 1 "/usr/include/sys/socket.h" 1 3 4 # 24 "/usr/include/sys/socket.h" 3 4 # 1 "/usr/include/sys/uio.h" 1 3 4 # 25 "/usr/include/sys/uio.h" 3 4 # 1 "/usr/include/bits/uio.h" 1 3 4 # 43 "/usr/include/bits/uio.h" 3 4 struct iovec { void *iov_base; size_t iov_len; }; # 29 "/usr/include/sys/uio.h" 2 3 4 # 39 "/usr/include/sys/uio.h" 3 4 extern ssize_t readv (int __fd, const struct iovec *__iovec, int __count) __attribute__ ((__warn_unused_result__)); # 50 "/usr/include/sys/uio.h" 3 4 extern ssize_t writev (int __fd, const struct iovec *__iovec, int __count) __attribute__ ((__warn_unused_result__)); # 65 "/usr/include/sys/uio.h" 3 4 extern ssize_t preadv (int __fd, const struct iovec *__iovec, int __count, __off_t __offset) __attribute__ ((__warn_unused_result__)); # 77 "/usr/include/sys/uio.h" 3 4 extern ssize_t pwritev (int __fd, const struct iovec *__iovec, int __count, __off_t __offset) __attribute__ ((__warn_unused_result__)); # 120 "/usr/include/sys/uio.h" 3 4 # 27 "/usr/include/sys/socket.h" 2 3 4 # 1 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include/stddef.h" 1 3 4 # 29 "/usr/include/sys/socket.h" 2 3 4 # 38 "/usr/include/sys/socket.h" 3 4 # 1 "/usr/include/bits/socket.h" 1 3 4 # 27 "/usr/include/bits/socket.h" 3 4 # 1 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include/stddef.h" 1 3 4 # 28 "/usr/include/bits/socket.h" 2 3 4 typedef __socklen_t socklen_t; # 1 "/usr/include/bits/socket_type.h" 1 3 4 # 24 "/usr/include/bits/socket_type.h" 3 4 enum __socket_type { SOCK_STREAM = 1, SOCK_DGRAM = 2, SOCK_RAW = 3, SOCK_RDM = 4, SOCK_SEQPACKET = 5, SOCK_DCCP = 6, SOCK_PACKET = 10, SOCK_CLOEXEC = 02000000, SOCK_NONBLOCK = 00004000 }; # 39 "/usr/include/bits/socket.h" 2 3 4 # 146 "/usr/include/bits/socket.h" 3 4 # 1 "/usr/include/bits/sockaddr.h" 1 3 4 # 28 "/usr/include/bits/sockaddr.h" 3 4 typedef unsigned short int sa_family_t; # 147 "/usr/include/bits/socket.h" 2 3 4 struct sockaddr { sa_family_t sa_family; char sa_data[14]; }; # 162 "/usr/include/bits/socket.h" 3 4 struct sockaddr_storage { sa_family_t ss_family; unsigned long int __ss_align; char __ss_padding[(128 - (2 * sizeof (unsigned long int)))]; }; enum { MSG_OOB = 0x01, MSG_PEEK = 0x02, MSG_DONTROUTE = 0x04, MSG_CTRUNC = 0x08, MSG_PROXY = 0x10, MSG_TRUNC = 0x20, MSG_DONTWAIT = 0x40, MSG_EOR = 0x80, MSG_WAITALL = 0x100, MSG_FIN = 0x200, MSG_SYN = 0x400, MSG_CONFIRM = 0x800, MSG_RST = 0x1000, MSG_ERRQUEUE = 0x2000, MSG_NOSIGNAL = 0x4000, MSG_MORE = 0x8000, MSG_WAITFORONE = 0x10000, MSG_FASTOPEN = 0x20000000, MSG_CMSG_CLOEXEC = 0x40000000 }; struct msghdr { void *msg_name; socklen_t msg_namelen; struct iovec *msg_iov; size_t msg_iovlen; void *msg_control; size_t msg_controllen; int msg_flags; }; struct cmsghdr { size_t cmsg_len; int cmsg_level; int cmsg_type; __extension__ unsigned char __cmsg_data []; }; # 272 "/usr/include/bits/socket.h" 3 4 extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg) __attribute__ ((__nothrow__ , __leaf__)); extern __inline __attribute__ ((__gnu_inline__)) struct cmsghdr * __attribute__ ((__nothrow__ , __leaf__)) __cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg) { if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr)) return (struct cmsghdr *) 0; __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg + (((__cmsg->cmsg_len) + sizeof (size_t) - 1) & (size_t) ~(sizeof (size_t) - 1))); if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen) || ((unsigned char *) __cmsg + (((__cmsg->cmsg_len) + sizeof (size_t) - 1) & (size_t) ~(sizeof (size_t) - 1)) > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen))) return (struct cmsghdr *) 0; return __cmsg; } enum { SCM_RIGHTS = 0x01 }; # 345 "/usr/include/bits/socket.h" 3 4 # 1 "/usr/include/asm/socket.h" 1 3 4 # 1 "/usr/include/asm-generic/socket.h" 1 3 4 # 1 "/usr/include/asm/sockios.h" 1 3 4 # 1 "/usr/include/asm-generic/sockios.h" 1 3 4 # 1 "/usr/include/asm/sockios.h" 2 3 4 # 5 "/usr/include/asm-generic/socket.h" 2 3 4 # 1 "/usr/include/asm/socket.h" 2 3 4 # 346 "/usr/include/bits/socket.h" 2 3 4 # 379 "/usr/include/bits/socket.h" 3 4 struct linger { int l_onoff; int l_linger; }; # 39 "/usr/include/sys/socket.h" 2 3 4 struct osockaddr { unsigned short int sa_family; unsigned char sa_data[14]; }; enum { SHUT_RD = 0, SHUT_WR, SHUT_RDWR }; # 113 "/usr/include/sys/socket.h" 3 4 extern int socket (int __domain, int __type, int __protocol) __attribute__ ((__nothrow__ , __leaf__)); extern int socketpair (int __domain, int __type, int __protocol, int __fds[2]) __attribute__ ((__nothrow__ , __leaf__)); extern int bind (int __fd, const struct sockaddr * __addr, socklen_t __len) __attribute__ ((__nothrow__ , __leaf__)); extern int getsockname (int __fd, struct sockaddr *__restrict __addr, socklen_t *__restrict __len) __attribute__ ((__nothrow__ , __leaf__)); # 137 "/usr/include/sys/socket.h" 3 4 extern int connect (int __fd, const struct sockaddr * __addr, socklen_t __len); extern int getpeername (int __fd, struct sockaddr *__restrict __addr, socklen_t *__restrict __len) __attribute__ ((__nothrow__ , __leaf__)); extern ssize_t send (int __fd, const void *__buf, size_t __n, int __flags); extern ssize_t recv (int __fd, void *__buf, size_t __n, int __flags); extern ssize_t sendto (int __fd, const void *__buf, size_t __n, int __flags, const struct sockaddr * __addr, socklen_t __addr_len); # 174 "/usr/include/sys/socket.h" 3 4 extern ssize_t recvfrom (int __fd, void *__restrict __buf, size_t __n, int __flags, struct sockaddr *__restrict __addr, socklen_t *__restrict __addr_len); extern ssize_t sendmsg (int __fd, const struct msghdr *__message, int __flags); # 202 "/usr/include/sys/socket.h" 3 4 extern ssize_t recvmsg (int __fd, struct msghdr *__message, int __flags); # 219 "/usr/include/sys/socket.h" 3 4 extern int getsockopt (int __fd, int __level, int __optname, void *__restrict __optval, socklen_t *__restrict __optlen) __attribute__ ((__nothrow__ , __leaf__)); extern int setsockopt (int __fd, int __level, int __optname, const void *__optval, socklen_t __optlen) __attribute__ ((__nothrow__ , __leaf__)); extern int listen (int __fd, int __n) __attribute__ ((__nothrow__ , __leaf__)); # 243 "/usr/include/sys/socket.h" 3 4 extern int accept (int __fd, struct sockaddr *__restrict __addr, socklen_t *__restrict __addr_len); # 261 "/usr/include/sys/socket.h" 3 4 extern int shutdown (int __fd, int __how) __attribute__ ((__nothrow__ , __leaf__)); extern int sockatmark (int __fd) __attribute__ ((__nothrow__ , __leaf__)); extern int isfdtype (int __fd, int __fdtype) __attribute__ ((__nothrow__ , __leaf__)); # 1 "/usr/include/bits/socket2.h" 1 3 4 # 23 "/usr/include/bits/socket2.h" 3 4 extern ssize_t __recv_chk (int __fd, void *__buf, size_t __n, size_t __buflen, int __flags); extern ssize_t __recv_alias (int __fd, void *__buf, size_t __n, int __flags) __asm__ ("" "recv") ; extern ssize_t __recv_chk_warn (int __fd, void *__buf, size_t __n, size_t __buflen, int __flags) __asm__ ("" "__recv_chk") __attribute__((__warning__ ("recv called with bigger length than size of destination " "buffer"))) ; extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) ssize_t recv (int __fd, void *__buf, size_t __n, int __flags) { if (__builtin_object_size (__buf, 0) != (size_t) -1) { if (!__builtin_constant_p (__n)) return __recv_chk (__fd, __buf, __n, __builtin_object_size (__buf, 0), __flags); if (__n > __builtin_object_size (__buf, 0)) return __recv_chk_warn (__fd, __buf, __n, __builtin_object_size (__buf, 0), __flags); } return __recv_alias (__fd, __buf, __n, __flags); } extern ssize_t __recvfrom_chk (int __fd, void *__restrict __buf, size_t __n, size_t __buflen, int __flags, struct sockaddr *__restrict __addr, socklen_t *__restrict __addr_len); extern ssize_t __recvfrom_alias (int __fd, void *__restrict __buf, size_t __n, int __flags, struct sockaddr *__restrict __addr, socklen_t *__restrict __addr_len) __asm__ ("" "recvfrom") ; extern ssize_t __recvfrom_chk_warn (int __fd, void *__restrict __buf, size_t __n, size_t __buflen, int __flags, struct sockaddr *__restrict __addr, socklen_t *__restrict __addr_len) __asm__ ("" "__recvfrom_chk") __attribute__((__warning__ ("recvfrom called with bigger length than size of " "destination buffer"))) ; extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) __attribute__ ((__artificial__)) ssize_t recvfrom (int __fd, void *__restrict __buf, size_t __n, int __flags, struct sockaddr *__restrict __addr, socklen_t *__restrict __addr_len) { if (__builtin_object_size (__buf, 0) != (size_t) -1) { if (!__builtin_constant_p (__n)) return __recvfrom_chk (__fd, __buf, __n, __builtin_object_size (__buf, 0), __flags, __addr, __addr_len); if (__n > __builtin_object_size (__buf, 0)) return __recvfrom_chk_warn (__fd, __buf, __n, __builtin_object_size (__buf, 0), __flags, __addr, __addr_len); } return __recvfrom_alias (__fd, __buf, __n, __flags, __addr, __addr_len); } # 281 "/usr/include/sys/socket.h" 2 3 4 # 45 "./src/common/compat.h" 2 # 1 "/usr/include/netinet/in.h" 1 3 4 # 27 "/usr/include/netinet/in.h" 3 4 typedef uint32_t in_addr_t; struct in_addr { in_addr_t s_addr; }; # 1 "/usr/include/bits/in.h" 1 3 4 # 138 "/usr/include/bits/in.h" 3 4 struct ip_opts { struct in_addr ip_dst; char ip_opts[40]; }; struct ip_mreqn { struct in_addr imr_multiaddr; struct in_addr imr_address; int imr_ifindex; }; struct in_pktinfo { int ipi_ifindex; struct in_addr ipi_spec_dst; struct in_addr ipi_addr; }; # 38 "/usr/include/netinet/in.h" 2 3 4 enum { IPPROTO_IP = 0, IPPROTO_ICMP = 1, IPPROTO_IGMP = 2, IPPROTO_IPIP = 4, IPPROTO_TCP = 6, IPPROTO_EGP = 8, IPPROTO_PUP = 12, IPPROTO_UDP = 17, IPPROTO_IDP = 22, IPPROTO_TP = 29, IPPROTO_DCCP = 33, IPPROTO_IPV6 = 41, IPPROTO_RSVP = 46, IPPROTO_GRE = 47, IPPROTO_ESP = 50, IPPROTO_AH = 51, IPPROTO_MTP = 92, IPPROTO_BEETPH = 94, IPPROTO_ENCAP = 98, IPPROTO_PIM = 103, IPPROTO_COMP = 108, IPPROTO_SCTP = 132, IPPROTO_UDPLITE = 136, IPPROTO_RAW = 255, IPPROTO_MAX }; enum { IPPROTO_HOPOPTS = 0, IPPROTO_ROUTING = 43, IPPROTO_FRAGMENT = 44, IPPROTO_ICMPV6 = 58, IPPROTO_NONE = 59, IPPROTO_DSTOPTS = 60, IPPROTO_MH = 135 }; typedef uint16_t in_port_t; enum { IPPORT_ECHO = 7, IPPORT_DISCARD = 9, IPPORT_SYSTAT = 11, IPPORT_DAYTIME = 13, IPPORT_NETSTAT = 15, IPPORT_FTP = 21, IPPORT_TELNET = 23, IPPORT_SMTP = 25, IPPORT_TIMESERVER = 37, IPPORT_NAMESERVER = 42, IPPORT_WHOIS = 43, IPPORT_MTP = 57, IPPORT_TFTP = 69, IPPORT_RJE = 77, IPPORT_FINGER = 79, IPPORT_TTYLINK = 87, IPPORT_SUPDUP = 95, IPPORT_EXECSERVER = 512, IPPORT_LOGINSERVER = 513, IPPORT_CMDSERVER = 514, IPPORT_EFSSERVER = 520, IPPORT_BIFFUDP = 512, IPPORT_WHOSERVER = 513, IPPORT_ROUTESERVER = 520, IPPORT_RESERVED = 1024, IPPORT_USERRESERVED = 5000 }; # 209 "/usr/include/netinet/in.h" 3 4 struct in6_addr { union { uint8_t __u6_addr8[16]; uint16_t __u6_addr16[8]; uint32_t __u6_addr32[4]; } __in6_u; }; extern const struct in6_addr in6addr_any; extern const struct in6_addr in6addr_loopback; # 237 "/usr/include/netinet/in.h" 3 4 struct sockaddr_in { sa_family_t sin_family; in_port_t sin_port; struct in_addr sin_addr; unsigned char sin_zero[sizeof (struct sockaddr) - (sizeof (unsigned short int)) - sizeof (in_port_t) - sizeof (struct in_addr)]; }; struct sockaddr_in6 { sa_family_t sin6_family; in_port_t sin6_port; uint32_t sin6_flowinfo; struct in6_addr sin6_addr; uint32_t sin6_scope_id; }; struct ip_mreq { struct in_addr imr_multiaddr; struct in_addr imr_interface; }; struct ip_mreq_source { struct in_addr imr_multiaddr; struct in_addr imr_interface; struct in_addr imr_sourceaddr; }; struct ipv6_mreq { struct in6_addr ipv6mr_multiaddr; unsigned int ipv6mr_interface; }; struct group_req { uint32_t gr_interface; struct sockaddr_storage gr_group; }; struct group_source_req { uint32_t gsr_interface; struct sockaddr_storage gsr_group; struct sockaddr_storage gsr_source; }; struct ip_msfilter { struct in_addr imsf_multiaddr; struct in_addr imsf_interface; uint32_t imsf_fmode; uint32_t imsf_numsrc; struct in_addr imsf_slist[1]; }; struct group_filter { uint32_t gf_interface; struct sockaddr_storage gf_group; uint32_t gf_fmode; uint32_t gf_numsrc; struct sockaddr_storage gf_slist[1]; }; # 374 "/usr/include/netinet/in.h" 3 4 extern uint32_t ntohl (uint32_t __netlong) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern uint16_t ntohs (uint16_t __netshort) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern uint32_t htonl (uint32_t __hostlong) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern uint16_t htons (uint16_t __hostshort) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); # 1 "/usr/include/bits/byteswap.h" 1 3 4 # 386 "/usr/include/netinet/in.h" 2 3 4 # 501 "/usr/include/netinet/in.h" 3 4 extern int bindresvport (int __sockfd, struct sockaddr_in *__sock_in) __attribute__ ((__nothrow__ , __leaf__)); extern int bindresvport6 (int __sockfd, struct sockaddr_in6 *__sock_in) __attribute__ ((__nothrow__ , __leaf__)); # 628 "/usr/include/netinet/in.h" 3 4 # 48 "./src/common/compat.h" 2 # 1 "/usr/include/errno.h" 1 3 4 # 31 "/usr/include/errno.h" 3 4 # 1 "/usr/include/bits/errno.h" 1 3 4 # 24 "/usr/include/bits/errno.h" 3 4 # 1 "/usr/include/linux/errno.h" 1 3 4 # 1 "/usr/include/asm/errno.h" 1 3 4 # 1 "/usr/include/asm-generic/errno.h" 1 3 4 # 1 "/usr/include/asm-generic/errno-base.h" 1 3 4 # 5 "/usr/include/asm-generic/errno.h" 2 3 4 # 1 "/usr/include/asm/errno.h" 2 3 4 # 1 "/usr/include/linux/errno.h" 2 3 4 # 25 "/usr/include/bits/errno.h" 2 3 4 # 50 "/usr/include/bits/errno.h" 3 4 extern int *__errno_location (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); # 36 "/usr/include/errno.h" 2 3 4 # 58 "/usr/include/errno.h" 3 4 # 55 "./src/common/compat.h" 2 # 231 "./src/common/compat.h" size_t strlcat(char *dst, const char *src, size_t siz) ; size_t strlcpy(char *dst, const char *src, size_t siz) ; # 283 "./src/common/compat.h" typedef struct tor_mmap_t { const char *data; size_t size; size_t mapping_size; } tor_mmap_t; tor_mmap_t *tor_mmap_file(const char *filename) ; int tor_munmap_file(tor_mmap_t *handle) ; int tor_snprintf(char *str, size_t size, const char *format, ...) __attribute__ ((format(printf, 3, 4))) ; int tor_vsnprintf(char *str, size_t size, const char *format, va_list args) __attribute__ ((format(printf, 3, 0))) ; int tor_asprintf(char **strp, const char *fmt, ...) __attribute__ ((format(printf, 2, 3))); int tor_vasprintf(char **strp, const char *fmt, va_list args) __attribute__ ((format(printf, 2, 0))); const void *tor_memmem(const void *haystack, size_t hlen, const void *needle, size_t nlen) ; static const void *tor_memstr(const void *haystack, size_t hlen, const char *needle) ; static inline const void * tor_memstr(const void *haystack, size_t hlen, const char *needle) { return tor_memmem(haystack, hlen, needle, strlen(needle)); } # 329 "./src/common/compat.h" static int TOR_ISALPHA(char c); extern const uint32_t TOR_ISALPHA_TABLE[]; static inline int TOR_ISALPHA(char c) { uint8_t u = c; return !!(TOR_ISALPHA_TABLE[(u >> 5) & 7] & (1u << (u & 31))); } static int TOR_ISALNUM(char c); extern const uint32_t TOR_ISALNUM_TABLE[]; static inline int TOR_ISALNUM(char c) { uint8_t u = c; return !!(TOR_ISALNUM_TABLE[(u >> 5) & 7] & (1u << (u & 31))); } static int TOR_ISSPACE(char c); extern const uint32_t TOR_ISSPACE_TABLE[]; static inline int TOR_ISSPACE(char c) { uint8_t u = c; return !!(TOR_ISSPACE_TABLE[(u >> 5) & 7] & (1u << (u & 31))); } static int TOR_ISDIGIT(char c); extern const uint32_t TOR_ISDIGIT_TABLE[]; static inline int TOR_ISDIGIT(char c) { uint8_t u = c; return !!(TOR_ISDIGIT_TABLE[(u >> 5) & 7] & (1u << (u & 31))); } static int TOR_ISXDIGIT(char c); extern const uint32_t TOR_ISXDIGIT_TABLE[]; static inline int TOR_ISXDIGIT(char c) { uint8_t u = c; return !!(TOR_ISXDIGIT_TABLE[(u >> 5) & 7] & (1u << (u & 31))); } static int TOR_ISPRINT(char c); extern const uint32_t TOR_ISPRINT_TABLE[]; static inline int TOR_ISPRINT(char c) { uint8_t u = c; return !!(TOR_ISPRINT_TABLE[(u >> 5) & 7] & (1u << (u & 31))); } static int TOR_ISLOWER(char c); extern const uint32_t TOR_ISLOWER_TABLE[]; static inline int TOR_ISLOWER(char c) { uint8_t u = c; return !!(TOR_ISLOWER_TABLE[(u >> 5) & 7] & (1u << (u & 31))); } static int TOR_ISUPPER(char c); extern const uint32_t TOR_ISUPPER_TABLE[]; static inline int TOR_ISUPPER(char c) { uint8_t u = c; return !!(TOR_ISUPPER_TABLE[(u >> 5) & 7] & (1u << (u & 31))); } extern const char TOR_TOUPPER_TABLE[]; extern const char TOR_TOLOWER_TABLE[]; char *tor_strtok_r_impl(char *str, const char *sep, char **lasts); # 366 "./src/common/compat.h" void tor_gettimeofday(struct timeval *timeval); struct tm *tor_localtime_r(const time_t *timep, struct tm *result); struct tm *tor_gmtime_r(const time_t *timep, struct tm *result); # 414 "./src/common/compat.h" int tor_open_cloexec(const char *path, int flags, unsigned mode); FILE *tor_fopen_cloexec(const char *path, const char *mode); int tor_rename(const char *path_old, const char *path_new); int replace_file(const char *from, const char *to); int touch_file(const char *fname); typedef struct tor_lockfile_t tor_lockfile_t; tor_lockfile_t *tor_lockfile_lock(const char *filename, int blocking, int *locked_out); void tor_lockfile_unlock(tor_lockfile_t *lockfile); off_t tor_fd_getpos(int fd); int tor_fd_setpos(int fd, off_t pos); int tor_fd_seekend(int fd); int tor_ftruncate(int fd); # 461 "./src/common/compat.h" int tor_close_socket_simple(int s); int tor_close_socket(int s); int tor_open_socket_with_extensions( int domain, int type, int protocol, int cloexec, int nonblock); int tor_open_socket (int domain, int type, int protocol) ; int tor_open_socket_nonblocking(int domain, int type, int protocol); int tor_accept_socket(int sockfd, struct sockaddr *addr, socklen_t *len); int tor_accept_socket_nonblocking(int sockfd, struct sockaddr *addr, socklen_t *len); int tor_accept_socket_with_extensions(int sockfd, struct sockaddr *addr, socklen_t *len, int cloexec, int nonblock); int tor_connect_socket (int socket,const struct sockaddr *address, socklen_t address_len) ; int get_n_open_sockets(void); int tor_getsockname (int socket, struct sockaddr *address, socklen_t *address_len) ; # 552 "./src/common/compat.h" int tor_gethostname (char *name, size_t namelen); int tor_inet_aton(const char *cp, struct in_addr *addr) ; const char *tor_inet_ntop(int af, const void *src, char *dst, size_t len); int tor_inet_pton(int af, const char *src, void *dst); int tor_lookup_hostname (const char *name, uint32_t *addr); int set_socket_nonblocking(int socket); int tor_socketpair(int family, int type, int protocol, int fd[2]); int network_init(void); # 609 "./src/common/compat.h" typedef enum { SOCKS5_SUCCEEDED = 0x00, SOCKS5_GENERAL_ERROR = 0x01, SOCKS5_NOT_ALLOWED = 0x02, SOCKS5_NET_UNREACHABLE = 0x03, SOCKS5_HOST_UNREACHABLE = 0x04, SOCKS5_CONNECTION_REFUSED = 0x05, SOCKS5_TTL_EXPIRED = 0x06, SOCKS5_COMMAND_NOT_SUPPORTED = 0x07, SOCKS5_ADDRESS_TYPE_NOT_SUPPORTED = 0x08, } socks5_reply_status_t; const char *get_uname(void); uint16_t get_uint16(const void *cp) ; uint32_t get_uint32(const void *cp) ; uint64_t get_uint64(const void *cp) ; void set_uint16(void *cp, uint16_t v) ; void set_uint32(void *cp, uint32_t v) ; void set_uint64(void *cp, uint64_t v) ; static void set_uint8(void *cp, uint8_t v); static inline void set_uint8(void *cp, uint8_t v) { *(uint8_t*)cp = v; } int set_max_file_descriptors(rlim_t limit, int *max); int tor_disable_debugger_attach(void); int switch_id(const char *user); char *get_user_homedir(const char *username); const struct passwd *tor_getpwnam(const char *username); const struct passwd *tor_getpwuid(uid_t uid); int get_parent_directory(char *fname); char *make_path_absolute(char *fname); char **get_environment(void); int get_total_system_memory(size_t *mem_out); int compute_num_cpus(void); int tor_mlockall(void); # 712 "./src/common/compat.h" # 1 "./src/common/compat_threads.h" 1 # 9 "./src/common/compat_threads.h" # 1 "./orconfig.h" 1 # 10 "./src/common/compat_threads.h" 2 # 1 "/usr/include/pthread.h" 1 3 4 # 23 "/usr/include/pthread.h" 3 4 # 1 "/usr/include/sched.h" 1 3 4 # 28 "/usr/include/sched.h" 3 4 # 1 "/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/include/stddef.h" 1 3 4 # 29 "/usr/include/sched.h" 2 3 4 # 43 "/usr/include/sched.h" 3 4 # 1 "/usr/include/bits/sched.h" 1 3 4 # 72 "/usr/include/bits/sched.h" 3 4 struct sched_param { int __sched_priority; }; # 95 "/usr/include/bits/sched.h" 3 4 struct __sched_param { int __sched_priority; }; # 118 "/usr/include/bits/sched.h" 3 4 typedef unsigned long int __cpu_mask; typedef struct { __cpu_mask __bits[1024 / (8 * sizeof (__cpu_mask))]; } cpu_set_t; # 201 "/usr/include/bits/sched.h" 3 4 extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp) __attribute__ ((__nothrow__ , __leaf__)); extern cpu_set_t *__sched_cpualloc (size_t __count) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__)); extern void __sched_cpufree (cpu_set_t *__set) __attribute__ ((__nothrow__ , __leaf__)); # 44 "/usr/include/sched.h" 2 3 4 extern int sched_setparam (__pid_t __pid, const struct sched_param *__param) __attribute__ ((__nothrow__ , __leaf__)); extern int sched_getparam (__pid_t __pid, struct sched_param *__param) __attribute__ ((__nothrow__ , __leaf__)); extern int sched_setscheduler (__pid_t __pid, int __policy, const struct sched_param *__param) __attribute__ ((__nothrow__ , __leaf__)); extern int sched_getscheduler (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__)); extern int sched_yield (void) __attribute__ ((__nothrow__ , __leaf__)); extern int sched_get_priority_max (int __algorithm) __attribute__ ((__nothrow__ , __leaf__)); extern int sched_get_priority_min (int __algorithm) __attribute__ ((__nothrow__ , __leaf__)); extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __attribute__ ((__nothrow__ , __leaf__)); # 126 "/usr/include/sched.h" 3 4 # 24 "/usr/include/pthread.h" 2 3 4 # 1 "/usr/include/bits/setjmp.h" 1 3 4 # 26 "/usr/include/bits/setjmp.h" 3 4 # 1 "/usr/include/bits/wordsize.h" 1 3 4 # 27 "/usr/include/bits/setjmp.h" 2 3 4 typedef long int __jmp_buf[8]; # 28 "/usr/include/pthread.h" 2 3 4 # 1 "/usr/include/bits/wordsize.h" 1 3 4 # 29 "/usr/include/pthread.h" 2 3 4 enum { PTHREAD_CREATE_JOINABLE, PTHREAD_CREATE_DETACHED }; enum { PTHREAD_MUTEX_TIMED_NP, PTHREAD_MUTEX_RECURSIVE_NP, PTHREAD_MUTEX_ERRORCHECK_NP, PTHREAD_MUTEX_ADAPTIVE_NP , PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP, PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP, PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP, PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL }; enum { PTHREAD_MUTEX_STALLED, PTHREAD_MUTEX_STALLED_NP = PTHREAD_MUTEX_STALLED, PTHREAD_MUTEX_ROBUST, PTHREAD_MUTEX_ROBUST_NP = PTHREAD_MUTEX_ROBUST }; enum { PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT, PTHREAD_PRIO_PROTECT }; # 116 "/usr/include/pthread.h" 3 4 enum { PTHREAD_RWLOCK_PREFER_READER_NP, PTHREAD_RWLOCK_PREFER_WRITER_NP, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP }; # 157 "/usr/include/pthread.h" 3 4 enum { PTHREAD_INHERIT_SCHED, PTHREAD_EXPLICIT_SCHED }; enum { PTHREAD_SCOPE_SYSTEM, PTHREAD_SCOPE_PROCESS }; enum { PTHREAD_PROCESS_PRIVATE, PTHREAD_PROCESS_SHARED }; # 192 "/usr/include/pthread.h" 3 4 struct _pthread_cleanup_buffer { void (*__routine) (void *); void *__arg; int __canceltype; struct _pthread_cleanup_buffer *__prev; }; enum { PTHREAD_CANCEL_ENABLE, PTHREAD_CANCEL_DISABLE }; enum { PTHREAD_CANCEL_DEFERRED, PTHREAD_CANCEL_ASYNCHRONOUS }; # 230 "/usr/include/pthread.h" 3 4 extern int pthread_create (pthread_t *__restrict __newthread, const pthread_attr_t *__restrict __attr, void *(*__start_routine) (void *), void *__restrict __arg) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3))); extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__)); extern int pthread_join (pthread_t __th, void **__thread_return); # 273 "/usr/include/pthread.h" 3 4 extern int pthread_detach (pthread_t __th) __attribute__ ((__nothrow__ , __leaf__)); extern pthread_t pthread_self (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); extern int pthread_attr_init (pthread_attr_t *__attr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int pthread_attr_destroy (pthread_attr_t *__attr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int pthread_attr_getdetachstate (const pthread_attr_t *__attr, int *__detachstate) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int pthread_attr_setdetachstate (pthread_attr_t *__attr, int __detachstate) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int pthread_attr_getguardsize (const pthread_attr_t *__attr, size_t *__guardsize) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int pthread_attr_setguardsize (pthread_attr_t *__attr, size_t __guardsize) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int pthread_attr_getschedparam (const pthread_attr_t *__restrict __attr, struct sched_param *__restrict __param) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr, const struct sched_param *__restrict __param) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int pthread_attr_getschedpolicy (const pthread_attr_t *__restrict __attr, int *__restrict __policy) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int pthread_attr_getinheritsched (const pthread_attr_t *__restrict __attr, int *__restrict __inherit) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int pthread_attr_setinheritsched (pthread_attr_t *__attr, int __inherit) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int pthread_attr_getscope (const pthread_attr_t *__restrict __attr, int *__restrict __scope) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int pthread_attr_getstackaddr (const pthread_attr_t *__restrict __attr, void **__restrict __stackaddr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__deprecated__)); extern int pthread_attr_setstackaddr (pthread_attr_t *__attr, void *__stackaddr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__)); extern int pthread_attr_getstacksize (const pthread_attr_t *__restrict __attr, size_t *__restrict __stacksize) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int pthread_attr_setstacksize (pthread_attr_t *__attr, size_t __stacksize) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int pthread_attr_getstack (const pthread_attr_t *__restrict __attr, void **__restrict __stackaddr, size_t *__restrict __stacksize) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))); extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr, size_t __stacksize) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); # 431 "/usr/include/pthread.h" 3 4 extern int pthread_setschedparam (pthread_t __target_thread, int __policy, const struct sched_param *__param) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))); extern int pthread_getschedparam (pthread_t __target_thread, int *__restrict __policy, struct sched_param *__restrict __param) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3))); extern int pthread_setschedprio (pthread_t __target_thread, int __prio) __attribute__ ((__nothrow__ , __leaf__)); # 496 "/usr/include/pthread.h" 3 4 extern int pthread_once (pthread_once_t *__once_control, void (*__init_routine) (void)) __attribute__ ((__nonnull__ (1, 2))); # 508 "/usr/include/pthread.h" 3 4 extern int pthread_setcancelstate (int __state, int *__oldstate); extern int pthread_setcanceltype (int __type, int *__oldtype); extern int pthread_cancel (pthread_t __th); extern void pthread_testcancel (void); typedef struct { struct { __jmp_buf __cancel_jmp_buf; int __mask_was_saved; } __cancel_jmp_buf[1]; void *__pad[4]; } __pthread_unwind_buf_t __attribute__ ((__aligned__)); # 542 "/usr/include/pthread.h" 3 4 struct __pthread_cleanup_frame { void (*__cancel_routine) (void *); void *__cancel_arg; int __do_it; int __cancel_type; }; # 682 "/usr/include/pthread.h" 3 4 extern void __pthread_register_cancel (__pthread_unwind_buf_t *__buf) ; # 694 "/usr/include/pthread.h" 3 4 extern void __pthread_unregister_cancel (__pthread_unwind_buf_t *__buf) ; # 735 "/usr/include/pthread.h" 3 4 extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf) __attribute__ ((__noreturn__)) __attribute__ ((__weak__)) ; struct __jmp_buf_tag; extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __attribute__ ((__nothrow__)); extern int pthread_mutex_init (pthread_mutex_t *__mutex, const pthread_mutexattr_t *__mutexattr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int pthread_mutex_destroy (pthread_mutex_t *__mutex) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int pthread_mutex_trylock (pthread_mutex_t *__mutex) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int pthread_mutex_lock (pthread_mutex_t *__mutex) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex, const struct timespec *__restrict __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int pthread_mutex_getprioceiling (const pthread_mutex_t * __restrict __mutex, int *__restrict __prioceiling) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex, int __prioceiling, int *__restrict __old_ceiling) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))); extern int pthread_mutex_consistent (pthread_mutex_t *__mutex) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); # 808 "/usr/include/pthread.h" 3 4 extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int pthread_mutexattr_getpshared (const pthread_mutexattr_t * __restrict __attr, int *__restrict __pshared) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr, int __pshared) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int pthread_mutexattr_gettype (const pthread_mutexattr_t *__restrict __attr, int *__restrict __kind) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int pthread_mutexattr_getprotocol (const pthread_mutexattr_t * __restrict __attr, int *__restrict __protocol) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int pthread_mutexattr_setprotocol (pthread_mutexattr_t *__attr, int __protocol) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int pthread_mutexattr_getprioceiling (const pthread_mutexattr_t * __restrict __attr, int *__restrict __prioceiling) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int pthread_mutexattr_setprioceiling (pthread_mutexattr_t *__attr, int __prioceiling) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int pthread_mutexattr_getrobust (const pthread_mutexattr_t *__attr, int *__robustness) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr, int __robustness) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); # 890 "/usr/include/pthread.h" 3 4 extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock, const pthread_rwlockattr_t *__restrict __attr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock, const struct timespec *__restrict __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock, const struct timespec *__restrict __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int pthread_rwlockattr_getpshared (const pthread_rwlockattr_t * __restrict __attr, int *__restrict __pshared) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr, int __pshared) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int pthread_rwlockattr_getkind_np (const pthread_rwlockattr_t * __restrict __attr, int *__restrict __pref) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr, int __pref) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int pthread_cond_init (pthread_cond_t *__restrict __cond, const pthread_condattr_t *__restrict __cond_attr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int pthread_cond_destroy (pthread_cond_t *__cond) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int pthread_cond_signal (pthread_cond_t *__cond) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int pthread_cond_broadcast (pthread_cond_t *__cond) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int pthread_cond_wait (pthread_cond_t *__restrict __cond, pthread_mutex_t *__restrict __mutex) __attribute__ ((__nonnull__ (1, 2))); # 1002 "/usr/include/pthread.h" 3 4 extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond, pthread_mutex_t *__restrict __mutex, const struct timespec *__restrict __abstime) __attribute__ ((__nonnull__ (1, 2, 3))); extern int pthread_condattr_init (pthread_condattr_t *__attr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int pthread_condattr_destroy (pthread_condattr_t *__attr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int pthread_condattr_getpshared (const pthread_condattr_t * __restrict __attr, int *__restrict __pshared) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int pthread_condattr_setpshared (pthread_condattr_t *__attr, int __pshared) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int pthread_condattr_getclock (const pthread_condattr_t * __restrict __attr, __clockid_t *__restrict __clock_id) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int pthread_condattr_setclock (pthread_condattr_t *__attr, __clockid_t __clock_id) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); # 1046 "/usr/include/pthread.h" 3 4 extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int pthread_spin_destroy (pthread_spinlock_t *__lock) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int pthread_spin_lock (pthread_spinlock_t *__lock) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int pthread_spin_trylock (pthread_spinlock_t *__lock) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int pthread_spin_unlock (pthread_spinlock_t *__lock) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier, const pthread_barrierattr_t *__restrict __attr, unsigned int __count) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int pthread_barrier_destroy (pthread_barrier_t *__barrier) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int pthread_barrier_wait (pthread_barrier_t *__barrier) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int pthread_barrierattr_getpshared (const pthread_barrierattr_t * __restrict __attr, int *__restrict __pshared) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr, int __pshared) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); # 1113 "/usr/include/pthread.h" 3 4 extern int pthread_key_create (pthread_key_t *__key, void (*__destr_function) (void *)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); extern int pthread_key_delete (pthread_key_t __key) __attribute__ ((__nothrow__ , __leaf__)); extern void *pthread_getspecific (pthread_key_t __key) __attribute__ ((__nothrow__ , __leaf__)); extern int pthread_setspecific (pthread_key_t __key, const void *__pointer) __attribute__ ((__nothrow__ , __leaf__)) ; extern int pthread_getcpuclockid (pthread_t __thread_id, __clockid_t *__clock_id) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); # 1147 "/usr/include/pthread.h" 3 4 extern int pthread_atfork (void (*__prepare) (void), void (*__parent) (void), void (*__child) (void)) __attribute__ ((__nothrow__ , __leaf__)); extern __inline __attribute__ ((__gnu_inline__)) int __attribute__ ((__nothrow__ , __leaf__)) pthread_equal (pthread_t __thread1, pthread_t __thread2) { return __thread1 == __thread2; } # 15 "./src/common/compat_threads.h" 2 # 25 "./src/common/compat_threads.h" int spawn_func(void (*func)(void *), void *data); void spawn_exit(void) __attribute__((noreturn)); typedef struct tor_mutex_t { pthread_mutex_t mutex; } tor_mutex_t; tor_mutex_t *tor_mutex_new(void); tor_mutex_t *tor_mutex_new_nonrecursive(void); void tor_mutex_init(tor_mutex_t *m); void tor_mutex_init_nonrecursive(tor_mutex_t *m); void tor_mutex_acquire(tor_mutex_t *m); void tor_mutex_release(tor_mutex_t *m); void tor_mutex_free(tor_mutex_t *m); void tor_mutex_uninit(tor_mutex_t *m); unsigned long tor_get_thread_id(void); void tor_threads_init(void); void set_main_thread(void); int in_main_thread(void); typedef struct tor_cond_t { pthread_cond_t cond; # 77 "./src/common/compat_threads.h" } tor_cond_t; tor_cond_t *tor_cond_new(void); void tor_cond_free(tor_cond_t *cond); int tor_cond_init(tor_cond_t *cond); void tor_cond_uninit(tor_cond_t *cond); int tor_cond_wait(tor_cond_t *cond, tor_mutex_t *mutex, const struct timeval *tv); void tor_cond_signal_one(tor_cond_t *cond); void tor_cond_signal_all(tor_cond_t *cond); typedef struct alert_sockets_s { int read_fd; int write_fd; int (*alert_fn)(int write_fd); int (*drain_fn)(int read_fd); } alert_sockets_t; # 111 "./src/common/compat_threads.h" int alert_sockets_create(alert_sockets_t *socks_out, uint32_t flags); void alert_sockets_close(alert_sockets_t *socks); # 713 "./src/common/compat.h" 2 # 17 "./src/common/util.h" 2 # 1 "./src/common/di_ops.h" 1 # 14 "./src/common/di_ops.h" # 1 "./orconfig.h" 1 # 15 "./src/common/di_ops.h" 2 int tor_memcmp(const void *a, const void *b, size_t sz); int tor_memeq(const void *a, const void *b, size_t sz); # 30 "./src/common/di_ops.h" int safe_mem_is_zero(const void *mem, size_t sz); typedef struct di_digest256_map_t di_digest256_map_t; typedef void (*dimap_free_fn)(void *); void dimap_free(di_digest256_map_t *map, dimap_free_fn free_fn); void dimap_add_entry(di_digest256_map_t **map, const uint8_t *key, void *val); void *dimap_search(const di_digest256_map_t *map, const uint8_t *key, void *dflt_val); # 18 "./src/common/util.h" 2 # 64 "./src/common/util.h" void tor_assertion_failed_(const char *fname, unsigned int line, const char *func, const char *expr); # 86 "./src/common/util.h" void *tor_malloc_(size_t size ) __attribute__((malloc)); void *tor_malloc_zero_(size_t size ) __attribute__((malloc)); void *tor_calloc_(size_t nmemb, size_t size ) __attribute__((malloc)); void *tor_realloc_(void *ptr, size_t size ); void *tor_reallocarray_(void *ptr, size_t size1, size_t size2 ); char *tor_strdup_(const char *s ) __attribute__((malloc)) ; char *tor_strndup_(const char *s, size_t n ) __attribute__((malloc)) ; void *tor_memdup_(const void *mem, size_t len ) __attribute__((malloc)) ; void *tor_memdup_nulterm_(const void *mem, size_t len ) __attribute__((malloc)) ; void tor_free_(void *mem); # 135 "./src/common/util.h" void tor_log_mallinfo(int severity); # 175 "./src/common/util.h" double tor_mathlog(double d) __attribute__((const)); long tor_lround(double d) __attribute__((const)); int64_t tor_llround(double d) __attribute__((const)); int tor_log2(uint64_t u64) __attribute__((const)); uint64_t round_to_power_of_2(uint64_t u64); unsigned round_to_next_multiple_of(unsigned number, unsigned divisor); uint32_t round_uint32_to_next_multiple_of(uint32_t number, uint32_t divisor); uint64_t round_uint64_to_next_multiple_of(uint64_t number, uint64_t divisor); int64_t round_int64_to_next_multiple_of(int64_t number, int64_t divisor); int64_t sample_laplace_distribution(double mu, double b, double p); int64_t add_laplace_noise(int64_t signal, double random, double delta_f, double epsilon); int n_bits_set_u8(uint8_t v); # 209 "./src/common/util.h" void tor_strlower(char *s) ; void tor_strupper(char *s) ; int tor_strisprint(const char *s) ; int tor_strisnonupper(const char *s) ; int strcmp_opt(const char *s1, const char *s2); int strcmpstart(const char *s1, const char *s2) ; int strcmp_len(const char *s1, const char *s2, size_t len) ; int strcasecmpstart(const char *s1, const char *s2) ; int strcmpend(const char *s1, const char *s2) ; int strcasecmpend(const char *s1, const char *s2) ; int fast_memcmpstart(const void *mem, size_t memlen, const char *prefix); void tor_strstrip(char *s, const char *strip) ; long tor_parse_long(const char *s, int base, long min, long max, int *ok, char **next); unsigned long tor_parse_ulong(const char *s, int base, unsigned long min, unsigned long max, int *ok, char **next); double tor_parse_double(const char *s, double min, double max, int *ok, char **next); uint64_t tor_parse_uint64(const char *s, int base, uint64_t min, uint64_t max, int *ok, char **next); const char *hex_str(const char *from, size_t fromlen) ; const char *eat_whitespace(const char *s); const char *eat_whitespace_eos(const char *s, const char *eos); const char *eat_whitespace_no_nl(const char *s); const char *eat_whitespace_eos_no_nl(const char *s, const char *eos); const char *find_whitespace(const char *s); const char *find_whitespace_eos(const char *s, const char *eos); const char *find_str_at_start_of_line(const char *haystack, const char *needle); int string_is_C_identifier(const char *string); int string_is_key_value(int severity, const char *string); int string_is_valid_hostname(const char *string); int string_is_valid_ipv4_address(const char *string); int string_is_valid_ipv6_address(const char *string); int tor_mem_is_zero(const char *mem, size_t len); int tor_digest_is_zero(const char *digest); int tor_digest256_is_zero(const char *digest); char *esc_for_log(const char *string) __attribute__((malloc)); char *esc_for_log_len(const char *chars, size_t n) __attribute__((malloc)); const char *escaped(const char *string); char *tor_escape_str_for_pt_args(const char *string, const char *chars_to_escape); struct smartlist_t; int tor_vsscanf(const char *buf, const char *pattern, va_list ap) __attribute__ ((format(scanf, 2, 0))); int tor_sscanf(const char *buf, const char *pattern, ...) __attribute__ ((format(scanf, 2, 3))); void smartlist_add_asprintf(struct smartlist_t *sl, const char *pattern, ...) __attribute__ ((format(printf, 2, 3))); void smartlist_add_vasprintf(struct smartlist_t *sl, const char *pattern, va_list args) __attribute__ ((format(printf, 2, 0))); int hex_decode_digit(char c); void base16_encode(char *dest, size_t destlen, const char *src, size_t srclen); int base16_decode(char *dest, size_t destlen, const char *src, size_t srclen); long tv_udiff(const struct timeval *start, const struct timeval *end); long tv_mdiff(const struct timeval *start, const struct timeval *end); int64_t tv_to_msec(const struct timeval *tv); int tor_timegm(const struct tm *tm, time_t *time_out); void format_rfc1123_time(char *buf, time_t t); int parse_rfc1123_time(const char *buf, time_t *t); void format_local_iso_time(char *buf, time_t t); void format_iso_time(char *buf, time_t t); void format_iso_time_nospace(char *buf, time_t t); void format_iso_time_nospace_usec(char *buf, const struct timeval *tv); int parse_iso_time_(const char *cp, time_t *t, int strict); int parse_iso_time(const char *buf, time_t *t); int parse_http_time(const char *buf, struct tm *tm); int format_time_interval(char *out, size_t out_len, long interval); time_t approx_time(void); void update_approx_time(time_t now); # 325 "./src/common/util.h" typedef struct ratelim_t { int rate; time_t last_allowed; int n_calls_since_last_time; } ratelim_t; char *rate_limit_log(ratelim_t *lim, time_t now); ssize_t write_all(int fd, const char *buf, size_t count,int isSocket); ssize_t read_all(int fd, char *buf, size_t count, int isSocket); enum stream_status { IO_STREAM_OKAY, IO_STREAM_EAGAIN, IO_STREAM_TERM, IO_STREAM_CLOSED }; const char *stream_status_to_string(enum stream_status stream_status); enum stream_status get_string_from_pipe(FILE *stream, char *buf, size_t count); typedef enum { FN_ERROR, FN_NOENT, FN_FILE, FN_DIR, FN_EMPTY } file_status_t; file_status_t file_status(const char *filename); typedef unsigned int cpd_check_t; int check_private_dir(const char *dirname, cpd_check_t check, const char *effective_user); typedef struct open_file_t open_file_t; int start_writing_to_file(const char *fname, int open_flags, int mode, open_file_t **data_out); FILE *start_writing_to_stdio_file(const char *fname, int open_flags, int mode, open_file_t **data_out); FILE *fdopen_file(open_file_t *file_data); int finish_writing_to_file(open_file_t *file_data); int abort_writing_to_file(open_file_t *file_data); int write_str_to_file(const char *fname, const char *str, int bin); int write_bytes_to_file (const char *fname, const char *str, size_t len, int bin) ; typedef struct sized_chunk_t { const char *bytes; size_t len; } sized_chunk_t; int write_chunks_to_file(const char *fname, const struct smartlist_t *chunks, int bin, int no_tempfile); int append_bytes_to_file(const char *fname, const char *str, size_t len, int bin); int write_bytes_to_new_file(const char *fname, const char *str, size_t len, int bin); struct stat; char *read_file_to_str(const char *filename, int flags, struct stat *stat_out) __attribute__((malloc)); char *read_file_to_str_until_eof(int fd, size_t max_bytes_to_read, size_t *sz_out) __attribute__((malloc)); const char *parse_config_line_from_str_verbose(const char *line, char **key_out, char **value_out, const char **err_out); char *expand_filename(const char *filename); struct smartlist_t *tor_listdir(const char *dirname); int path_is_relative(const char *filename); void start_daemon(void); void finish_daemon(const char *desired_cwd); void write_pidfile(const char *filename); void tor_check_port_forwarding(const char *filename, struct smartlist_t *ports_to_forward, time_t now); typedef struct process_handle_t process_handle_t; typedef struct process_environment_t process_environment_t; int tor_spawn_background(const char *const filename, const char **argv, process_environment_t *env, process_handle_t **process_handle_out); int environment_variable_names_equal(const char *s1, const char *s2); struct process_environment_t { char *windows_environment_block; char **unixoid_environment_block; }; process_environment_t *process_environment_make(struct smartlist_t *env_vars); void process_environment_free(process_environment_t *env); struct smartlist_t *get_current_process_environment_variables(void); void set_environment_variable_in_smartlist(struct smartlist_t *env_vars, const char *new_var, void (*free_old)(void*), int free_p); # 503 "./src/common/util.h" int tor_get_exit_code(process_handle_t *process_handle, int block, int *exit_code); int tor_split_lines(struct smartlist_t *sl, char *buf, int len); ssize_t tor_read_all_handle(FILE *h, char *buf, size_t count, const process_handle_t *process, int *eof); ssize_t tor_read_all_from_process_stdout( const process_handle_t *process_handle, char *buf, size_t count); ssize_t tor_read_all_from_process_stderr( const process_handle_t *process_handle, char *buf, size_t count); char *tor_join_win_cmdline(const char *argv[]); int tor_process_get_pid(process_handle_t *process_handle); FILE *tor_process_get_stdout_pipe(process_handle_t *process_handle); struct smartlist_t * tor_get_lines_from_handle (FILE *handle, enum stream_status *stream_status) ; int tor_terminate_process(process_handle_t *process_handle); void tor_process_handle_destroy (process_handle_t *process_handle, int also_terminate_process) ; typedef struct tor_weak_rng_t { uint32_t state; } tor_weak_rng_t; void tor_init_weak_random(tor_weak_rng_t *weak_rng, unsigned seed); int32_t tor_weak_random(tor_weak_rng_t *weak_rng); int32_t tor_weak_random_range(tor_weak_rng_t *rng, int32_t top); int format_hex_number_sigsafe(unsigned long x, char *buf, int max_len); int format_dec_number_sigsafe(unsigned long x, char *buf, int max_len); # 10 "./src/common/container.h" 2 # 1 "./src/ext/siphash.h" 1 struct sipkey { uint64_t k0; uint64_t k1; }; uint64_t siphash24(const void *src, unsigned long src_sz, const struct sipkey *key); void siphash_set_global_key(const struct sipkey *key); uint64_t siphash24g(const void *src, unsigned long src_sz); # 11 "./src/common/container.h" 2 typedef struct smartlist_t { void **list; int num_used; int capacity; } smartlist_t; smartlist_t * smartlist_new (void); void smartlist_free (smartlist_t *sl); void smartlist_clear(smartlist_t *sl); void smartlist_add(smartlist_t *sl, void *element); void smartlist_add_all(smartlist_t *sl, const smartlist_t *s2); void smartlist_remove(smartlist_t *sl, const void *element); void *smartlist_pop_last(smartlist_t *sl); void smartlist_reverse(smartlist_t *sl); void smartlist_string_remove(smartlist_t *sl, const char *element); int smartlist_contains(const smartlist_t *sl, const void *element); int smartlist_contains_string(const smartlist_t *sl, const char *element); int smartlist_string_pos(const smartlist_t *, const char *elt); int smartlist_contains_string_case(const smartlist_t *sl, const char *element); int smartlist_contains_int_as_string(const smartlist_t *sl, int num); int smartlist_strings_eq(const smartlist_t *sl1, const smartlist_t *sl2); int smartlist_contains_digest(const smartlist_t *sl, const char *element); int smartlist_ints_eq(const smartlist_t *sl1, const smartlist_t *sl2); int smartlist_overlap(const smartlist_t *sl1, const smartlist_t *sl2); void smartlist_intersect(smartlist_t *sl1, const smartlist_t *sl2); void smartlist_subtract(smartlist_t *sl1, const smartlist_t *sl2); # 83 "./src/common/container.h" static inline void smartlist_swap(smartlist_t *sl, int idx1, int idx2) { if (idx1 != idx2) { void *elt = ((sl)->list[idx1]); ((sl)->list[idx1] = (((sl)->list[idx2]))); ((sl)->list[idx2] = (elt)); } } void smartlist_del(smartlist_t *sl, int idx); void smartlist_del_keeporder(smartlist_t *sl, int idx); void smartlist_insert(smartlist_t *sl, int idx, void *val); void smartlist_sort(smartlist_t *sl, int (*compare)(const void **a, const void **b)); void *smartlist_get_most_frequent_(const smartlist_t *sl, int (*compare)(const void **a, const void **b), int *count_out); void smartlist_uniq(smartlist_t *sl, int (*compare)(const void **a, const void **b), void (*free_fn)(void *elt)); void smartlist_sort_strings(smartlist_t *sl); void smartlist_sort_digests(smartlist_t *sl); void smartlist_sort_digests256(smartlist_t *sl); void smartlist_sort_pointers(smartlist_t *sl); char *smartlist_get_most_frequent_string(smartlist_t *sl); char *smartlist_get_most_frequent_string_(smartlist_t *sl, int *count_out); char *smartlist_get_most_frequent_digest256(smartlist_t *sl); void smartlist_uniq_strings(smartlist_t *sl); void smartlist_uniq_digests(smartlist_t *sl); void smartlist_uniq_digests256(smartlist_t *sl); void *smartlist_bsearch(smartlist_t *sl, const void *key, int (*compare)(const void *key, const void **member)); int smartlist_bsearch_idx(const smartlist_t *sl, const void *key, int (*compare)(const void *key, const void **member), int *found_out); void smartlist_pqueue_add(smartlist_t *sl, int (*compare)(const void *a, const void *b), int idx_field_offset, void *item); void *smartlist_pqueue_pop(smartlist_t *sl, int (*compare)(const void *a, const void *b), int idx_field_offset); void smartlist_pqueue_remove(smartlist_t *sl, int (*compare)(const void *a, const void *b), int idx_field_offset, void *item); void smartlist_pqueue_assert_ok(smartlist_t *sl, int (*compare)(const void *a, const void *b), int idx_field_offset); int smartlist_split_string(smartlist_t *sl, const char *str, const char *sep, int flags, int max); char *smartlist_join_strings(smartlist_t *sl, const char *join, int terminate, size_t *len_out) __attribute__((malloc)); char *smartlist_join_strings2(smartlist_t *sl, const char *join, size_t join_len, int terminate, size_t *len_out) __attribute__((malloc)); # 360 "./src/common/container.h" typedef struct strmap_t strmap_t; typedef struct strmap_entry_t *strmap_iter_t; strmap_t* strmap_new (void); void* strmap_set(strmap_t *map, const char * key, void *val); void* strmap_get(const strmap_t *map, const char * key); void* strmap_remove(strmap_t *map, const char * key); void strmap_free (strmap_t *map, void (*free_val)(void*)); int strmap_isempty(const strmap_t *map); int strmap_size(const strmap_t *map); strmap_iter_t *strmap_iter_init(strmap_t *map); strmap_iter_t *strmap_iter_next(strmap_t *map, strmap_iter_t *iter); strmap_iter_t *strmap_iter_next_rmv(strmap_t *map, strmap_iter_t *iter); void strmap_iter_get(strmap_iter_t *iter, const char * *keyp, void **valp); int strmap_iter_done(strmap_iter_t *iter); void strmap_assert_ok(const strmap_t *map); typedef struct digestmap_t digestmap_t; typedef struct digestmap_entry_t *digestmap_iter_t; digestmap_t* digestmap_new (void); void* digestmap_set(digestmap_t *map, const char * key, void *val); void* digestmap_get(const digestmap_t *map, const char * key); void* digestmap_remove(digestmap_t *map, const char * key); void digestmap_free (digestmap_t *map, void (*free_val)(void*)); int digestmap_isempty(const digestmap_t *map); int digestmap_size(const digestmap_t *map); digestmap_iter_t *digestmap_iter_init(digestmap_t *map); digestmap_iter_t *digestmap_iter_next(digestmap_t *map, digestmap_iter_t *iter); digestmap_iter_t *digestmap_iter_next_rmv(digestmap_t *map, digestmap_iter_t *iter); void digestmap_iter_get(digestmap_iter_t *iter, const char * *keyp, void **valp); int digestmap_iter_done(digestmap_iter_t *iter); void digestmap_assert_ok(const digestmap_t *map); typedef struct digest256map_t digest256map_t; typedef struct digest256map_entry_t *digest256map_iter_t; digest256map_t* digest256map_new (void); void* digest256map_set(digest256map_t *map, const uint8_t * key, void *val); void* digest256map_get(const digest256map_t *map, const uint8_t * key); void* digest256map_remove(digest256map_t *map, const uint8_t * key); void digest256map_free (digest256map_t *map, void (*free_val)(void*)); int digest256map_isempty(const digest256map_t *map); int digest256map_size(const digest256map_t *map); digest256map_iter_t *digest256map_iter_init(digest256map_t *map); digest256map_iter_t *digest256map_iter_next(digest256map_t *map, digest256map_iter_t *iter); digest256map_iter_t *digest256map_iter_next_rmv(digest256map_t *map, digest256map_iter_t *iter); void digest256map_iter_get(digest256map_iter_t *iter, const uint8_t * *keyp, void **valp); int digest256map_iter_done(digest256map_iter_t *iter); void digest256map_assert_ok(const digest256map_t *map); # 494 "./src/common/container.h" void* strmap_set_lc(strmap_t *map, const char *key, void *val); void* strmap_get_lc(const strmap_t *map, const char *key); void* strmap_remove_lc(strmap_t *map, const char *key); # 583 "./src/common/container.h" typedef unsigned int bitarray_t; static inline bitarray_t * bitarray_init_zero(unsigned int n_bits) { size_t sz = (n_bits+((1u<<5)-1)) >> 5; return tor_calloc_(sz, sizeof(unsigned int) ); } static inline bitarray_t * bitarray_expand(bitarray_t *ba, unsigned int n_bits_old, unsigned int n_bits_new) { size_t sz_old = (n_bits_old+((1u<<5)-1)) >> 5; size_t sz_new = (n_bits_new+((1u<<5)-1)) >> 5; char *ptr; if (sz_new <= sz_old) return ba; ptr = tor_reallocarray_((ba), (sz_new), (sizeof(unsigned int)) ); memset(ptr+sz_old*sizeof(unsigned int), 0, (sz_new-sz_old)*sizeof(unsigned int)); return (bitarray_t*) ptr; } static inline void bitarray_free(bitarray_t *ba) { (void) ({ if (__builtin_expect(!!((ba)!=((void *)0)), 1)) { free(ba); (ba)=((void *)0); } }); } static inline void bitarray_set(bitarray_t *b, int bit) { b[bit >> 5] |= (1u << (bit & ((1u<<5)-1))); } static inline void bitarray_clear(bitarray_t *b, int bit) { b[bit >> 5] &= ~ (1u << (bit & ((1u<<5)-1))); } static inline unsigned int bitarray_is_set(bitarray_t *b, int bit) { return b[bit >> 5] & (1u << (bit & ((1u<<5)-1))); } typedef struct { int mask; bitarray_t *ba; } digestset_t; static inline void digestset_add(digestset_t *set, const char *digest) { const uint64_t x = siphash24g(digest, 20); const uint32_t d1 = (uint32_t) x; const uint32_t d2 = (uint32_t)( (x>>16) + x); const uint32_t d3 = (uint32_t)( (x>>32) + x); const uint32_t d4 = (uint32_t)( (x>>48) + x); bitarray_set(set->ba, ((d1) & set->mask)); bitarray_set(set->ba, ((d2) & set->mask)); bitarray_set(set->ba, ((d3) & set->mask)); bitarray_set(set->ba, ((d4) & set->mask)); } static inline int digestset_contains(const digestset_t *set, const char *digest) { const uint64_t x = siphash24g(digest, 20); const uint32_t d1 = (uint32_t) x; const uint32_t d2 = (uint32_t)( (x>>16) + x); const uint32_t d3 = (uint32_t)( (x>>32) + x); const uint32_t d4 = (uint32_t)( (x>>48) + x); return bitarray_is_set(set->ba, ((d1) & set->mask)) && bitarray_is_set(set->ba, ((d2) & set->mask)) && bitarray_is_set(set->ba, ((d3) & set->mask)) && bitarray_is_set(set->ba, ((d4) & set->mask)); } digestset_t *digestset_new(int max_elements); void digestset_free(digestset_t* set); int find_nth_int(int *array, int n_elements, int nth); time_t find_nth_time(time_t *array, int n_elements, int nth); double find_nth_double(double *array, int n_elements, int nth); int32_t find_nth_int32(int32_t *array, int n_elements, int nth); uint32_t find_nth_uint32(uint32_t *array, int n_elements, int nth); long find_nth_long(long *array, int n_elements, int nth); static inline int median_int(int *array, int n_elements) { return find_nth_int(array, n_elements, (n_elements-1)/2); } static inline time_t median_time(time_t *array, int n_elements) { return find_nth_time(array, n_elements, (n_elements-1)/2); } static inline double median_double(double *array, int n_elements) { return find_nth_double(array, n_elements, (n_elements-1)/2); } static inline uint32_t median_uint32(uint32_t *array, int n_elements) { return find_nth_uint32(array, n_elements, (n_elements-1)/2); } static inline int32_t median_int32(int32_t *array, int n_elements) { return find_nth_int32(array, n_elements, (n_elements-1)/2); } static inline uint32_t third_quartile_uint32(uint32_t *array, int n_elements) { return find_nth_uint32(array, n_elements, (n_elements*3)/4); } # 26 "src/tools/tor-fw-helper/tor-fw-helper.c" 2 # 1 "src/tools/tor-fw-helper/tor-fw-helper.h" 1 # 29 "src/tools/tor-fw-helper/tor-fw-helper.h" typedef struct { uint16_t external_port; uint16_t internal_port; } port_to_forward_t; typedef struct { int verbose; int help; int test_commandline; struct smartlist_t *ports_to_forward; int fetch_public_ip; int nat_pmp_status; int upnp_status; int public_ip_status; } tor_fw_options_t; typedef struct tor_fw_backend_t { const char *name; size_t state_len; int (*init)(tor_fw_options_t *options, void *backend_state); int (*cleanup)(tor_fw_options_t *options, void *backend_state); int (*fetch_public_ip)(tor_fw_options_t *options, void *backend_state); int (*add_tcp_mapping)(uint16_t internal_port, uint16_t external_port, int is_verbose, void *backend_state); } tor_fw_backend_t; # 32 "src/tools/tor-fw-helper/tor-fw-helper.c" 2 # 1 "src/tools/tor-fw-helper/tor-fw-helper-natpmp.h" 1 # 13 "src/tools/tor-fw-helper/tor-fw-helper-natpmp.h" # 1 "/usr/include/natpmp.h" 1 3 4 # 54 "/usr/include/natpmp.h" 3 4 # 1 "/usr/include/declspec.h" 1 3 4 # 55 "/usr/include/natpmp.h" 2 3 4 typedef struct { int s; in_addr_t gateway; int has_pending_request; unsigned char pending_request[12]; int pending_request_len; int try_number; struct timeval retry_time; } natpmp_t; typedef struct { uint16_t type; uint16_t resultcode; uint32_t epoch; union { struct { struct in_addr addr; } publicaddress; struct { uint16_t privateport; uint16_t mappedpublicport; uint32_t lifetime; } newportmapping; } pnu; } natpmpresp_t; # 146 "/usr/include/natpmp.h" 3 4 __attribute__ ((visibility ("default"))) int initnatpmp(natpmp_t * p, int forcegw, in_addr_t forcedgw); __attribute__ ((visibility ("default"))) int closenatpmp(natpmp_t * p); __attribute__ ((visibility ("default"))) int sendpublicaddressrequest(natpmp_t * p); # 176 "/usr/include/natpmp.h" 3 4 __attribute__ ((visibility ("default"))) int sendnewportmappingrequest(natpmp_t * p, int protocol, uint16_t privateport, uint16_t publicport, uint32_t lifetime); # 188 "/usr/include/natpmp.h" 3 4 __attribute__ ((visibility ("default"))) int getnatpmprequesttimeout(natpmp_t * p, struct timeval * timeout); # 207 "/usr/include/natpmp.h" 3 4 __attribute__ ((visibility ("default"))) int readnatpmpresponseorretry(natpmp_t * p, natpmpresp_t * response); # 14 "src/tools/tor-fw-helper/tor-fw-helper-natpmp.h" 2 # 23 "src/tools/tor-fw-helper/tor-fw-helper-natpmp.h" typedef struct natpmp_state_t { natpmp_t natpmp; natpmpresp_t response; int fetch_public_ip; int status; int init; int protocol; int lease; } natpmp_state_t; const tor_fw_backend_t *tor_fw_get_natpmp_backend(void); int tor_natpmp_init(tor_fw_options_t *tor_fw_options, void *backend_state); int tor_natpmp_cleanup(tor_fw_options_t *tor_fw_options, void *backend_state); int tor_natpmp_add_tcp_mapping(uint16_t internal_port, uint16_t external_port, int is_verbose, void *backend_state); int tor_natpmp_fetch_public_ip(tor_fw_options_t *tor_fw_options, void *backend_state); # 34 "src/tools/tor-fw-helper/tor-fw-helper.c" 2 # 1 "src/tools/tor-fw-helper/tor-fw-helper-upnp.h" 1 # 14 "src/tools/tor-fw-helper/tor-fw-helper-upnp.h" # 1 "/usr/include/miniupnpc/miniwget.h" 1 3 4 # 11 "/usr/include/miniupnpc/miniwget.h" 3 4 # 1 "/usr/include/miniupnpc/declspec.h" 1 3 4 # 12 "/usr/include/miniupnpc/miniwget.h" 2 3 4 MINIUPNP_LIBSPEC void * getHTTPResponse(int s, int * size); MINIUPNP_LIBSPEC void * miniwget(const char *, int *, unsigned int); MINIUPNP_LIBSPEC void * miniwget_getaddr(const char *, int *, char *, int, unsigned int); int parseURL(const char *, char *, unsigned short *, char * *, unsigned int *); # 15 "src/tools/tor-fw-helper/tor-fw-helper-upnp.h" 2 # 1 "/usr/include/miniupnpc/miniupnpc.h" 1 3 4 # 12 "/usr/include/miniupnpc/miniupnpc.h" 3 4 # 1 "/usr/include/miniupnpc/igd_desc_parse.h" 1 3 4 # 15 "/usr/include/miniupnpc/igd_desc_parse.h" 3 4 struct IGDdatas_service { char controlurl[(128)]; char eventsuburl[(128)]; char scpdurl[(128)]; char servicetype[(128)]; }; struct IGDdatas { char cureltname[(128)]; char urlbase[(128)]; char presentationurl[(128)]; int level; struct IGDdatas_service CIF; struct IGDdatas_service first; struct IGDdatas_service second; struct IGDdatas_service IPv6FC; struct IGDdatas_service tmp; }; void IGDstartelt(void *, const char *, int); void IGDendelt(void *, const char *, int); void IGDdata(void *, const char *, int); # 13 "/usr/include/miniupnpc/miniupnpc.h" 2 3 4 # 29 "/usr/include/miniupnpc/miniupnpc.h" 3 4 struct UPNParg { const char * elt; const char * val; }; char * simpleUPnPcommand(int, const char *, const char *, const char *, struct UPNParg *, int *); struct UPNPDev { struct UPNPDev * pNext; char * descURL; char * st; unsigned int scope_id; char buffer[2]; }; # 57 "/usr/include/miniupnpc/miniupnpc.h" 3 4 MINIUPNP_LIBSPEC struct UPNPDev * upnpDiscover(int delay, const char * multicastif, const char * minissdpdsock, int sameport, int ipv6, int * error); MINIUPNP_LIBSPEC struct UPNPDev * upnpDiscoverAll(int delay, const char * multicastif, const char * minissdpdsock, int sameport, int ipv6, int * error); MINIUPNP_LIBSPEC struct UPNPDev * upnpDiscoverDevice(const char * device, int delay, const char * multicastif, const char * minissdpdsock, int sameport, int ipv6, int * error); MINIUPNP_LIBSPEC struct UPNPDev * upnpDiscoverDevices(const char * const deviceTypes[], int delay, const char * multicastif, const char * minissdpdsock, int sameport, int ipv6, int * error); MINIUPNP_LIBSPEC void freeUPNPDevlist(struct UPNPDev * devlist); MINIUPNP_LIBSPEC void parserootdesc(const char *, int, struct IGDdatas *); struct UPNPUrls { char * controlURL; char * ipcondescURL; char * controlURL_CIF; char * controlURL_6FC; char * rootdescURL; }; # 117 "/usr/include/miniupnpc/miniupnpc.h" 3 4 MINIUPNP_LIBSPEC int UPNP_GetValidIGD(struct UPNPDev * devlist, struct UPNPUrls * urls, struct IGDdatas * data, char * lanaddr, int lanaddrlen); MINIUPNP_LIBSPEC int UPNP_GetIGDFromUrl(const char * rootdescurl, struct UPNPUrls * urls, struct IGDdatas * data, char * lanaddr, int lanaddrlen); MINIUPNP_LIBSPEC void GetUPNPUrls(struct UPNPUrls *, struct IGDdatas *, const char *, unsigned int); MINIUPNP_LIBSPEC void FreeUPNPUrls(struct UPNPUrls *); MINIUPNP_LIBSPEC int UPNPIGD_IsConnected(struct UPNPUrls *, struct IGDdatas *); # 16 "src/tools/tor-fw-helper/tor-fw-helper-upnp.h" 2 # 1 "/usr/include/miniupnpc/upnpcommands.h" 1 3 4 # 10 "/usr/include/miniupnpc/upnpcommands.h" 3 4 # 1 "/usr/include/miniupnpc/upnpreplyparse.h" 1 3 4 # 15 "/usr/include/miniupnpc/upnpreplyparse.h" 3 4 struct NameValue { struct NameValue * l_next; char name[64]; char value[128]; }; struct NameValueParserData { struct NameValue * l_head; char curelt[64]; char * portListing; int portListingLength; int topelt; const char * cdata; int cdatalen; }; void ParseNameValue(const char * buffer, int bufsize, struct NameValueParserData * data); void ClearNameValueList(struct NameValueParserData * pdata); char * GetValueFromNameValueList(struct NameValueParserData * pdata, const char * Name); # 11 "/usr/include/miniupnpc/upnpcommands.h" 2 3 4 # 1 "/usr/include/miniupnpc/portlistingparse.h" 1 3 4 # 12 "/usr/include/miniupnpc/portlistingparse.h" 3 4 # 1 "/usr/include/miniupnpc/miniupnpctypes.h" 1 3 4 # 13 "/usr/include/miniupnpc/portlistingparse.h" 2 3 4 # 30 "/usr/include/miniupnpc/portlistingparse.h" 3 4 typedef enum { PortMappingEltNone, PortMappingEntry, NewRemoteHost, NewExternalPort, NewProtocol, NewInternalPort, NewInternalClient, NewEnabled, NewDescription, NewLeaseTime } portMappingElt; struct PortMapping { struct PortMapping * l_next; unsigned long long leaseTime; unsigned short externalPort; unsigned short internalPort; char remoteHost[64]; char internalClient[64]; char description[64]; char protocol[4]; unsigned char enabled; }; struct PortMappingParserData { struct PortMapping * l_head; portMappingElt curelt; }; MINIUPNP_LIBSPEC void ParsePortListing(const char * buffer, int bufsize, struct PortMappingParserData * pdata); MINIUPNP_LIBSPEC void FreePortListing(struct PortMappingParserData * pdata); # 12 "/usr/include/miniupnpc/upnpcommands.h" 2 3 4 # 26 "/usr/include/miniupnpc/upnpcommands.h" 3 4 MINIUPNP_LIBSPEC unsigned long long UPNP_GetTotalBytesSent(const char * controlURL, const char * servicetype); MINIUPNP_LIBSPEC unsigned long long UPNP_GetTotalBytesReceived(const char * controlURL, const char * servicetype); MINIUPNP_LIBSPEC unsigned long long UPNP_GetTotalPacketsSent(const char * controlURL, const char * servicetype); MINIUPNP_LIBSPEC unsigned long long UPNP_GetTotalPacketsReceived(const char * controlURL, const char * servicetype); MINIUPNP_LIBSPEC int UPNP_GetStatusInfo(const char * controlURL, const char * servicetype, char * status, unsigned int * uptime, char * lastconnerror); MINIUPNP_LIBSPEC int UPNP_GetConnectionTypeInfo(const char * controlURL, const char * servicetype, char * connectionType); # 75 "/usr/include/miniupnpc/upnpcommands.h" 3 4 MINIUPNP_LIBSPEC int UPNP_GetExternalIPAddress(const char * controlURL, const char * servicetype, char * extIpAdd); MINIUPNP_LIBSPEC int UPNP_GetLinkLayerMaxBitRates(const char* controlURL, const char* servicetype, unsigned int * bitrateDown, unsigned int * bitrateUp); # 125 "/usr/include/miniupnpc/upnpcommands.h" 3 4 MINIUPNP_LIBSPEC int UPNP_AddPortMapping(const char * controlURL, const char * servicetype, const char * extPort, const char * inPort, const char * inClient, const char * desc, const char * proto, const char * remoteHost, const char * leaseDuration); # 158 "/usr/include/miniupnpc/upnpcommands.h" 3 4 MINIUPNP_LIBSPEC int UPNP_AddAnyPortMapping(const char * controlURL, const char * servicetype, const char * extPort, const char * inPort, const char * inClient, const char * desc, const char * proto, const char * remoteHost, const char * leaseDuration, char * reservedPort); # 181 "/usr/include/miniupnpc/upnpcommands.h" 3 4 MINIUPNP_LIBSPEC int UPNP_DeletePortMapping(const char * controlURL, const char * servicetype, const char * extPort, const char * proto, const char * remoteHost); # 199 "/usr/include/miniupnpc/upnpcommands.h" 3 4 MINIUPNP_LIBSPEC int UPNP_DeletePortMappingRange(const char * controlURL, const char * servicetype, const char * extPortStart, const char * extPortEnd, const char * proto, const char * manage); MINIUPNP_LIBSPEC int UPNP_GetPortMappingNumberOfEntries(const char* controlURL, const char* servicetype, unsigned int * num); # 235 "/usr/include/miniupnpc/upnpcommands.h" 3 4 MINIUPNP_LIBSPEC int UPNP_GetSpecificPortMappingEntry(const char * controlURL, const char * servicetype, const char * extPort, const char * proto, const char * remoteHost, char * intClient, char * intPort, char * desc, char * enabled, char * leaseDuration); # 269 "/usr/include/miniupnpc/upnpcommands.h" 3 4 MINIUPNP_LIBSPEC int UPNP_GetGenericPortMappingEntry(const char * controlURL, const char * servicetype, const char * index, char * extPort, char * intClient, char * intPort, char * protocol, char * desc, char * enabled, char * rHost, char * duration); # 291 "/usr/include/miniupnpc/upnpcommands.h" 3 4 MINIUPNP_LIBSPEC int UPNP_GetListOfPortMappings(const char * controlURL, const char * servicetype, const char * startPort, const char * endPort, const char * protocol, const char * numberOfPorts, struct PortMappingParserData * data); MINIUPNP_LIBSPEC int UPNP_GetFirewallStatus(const char * controlURL, const char * servicetype, int * firewallEnabled, int * inboundPinholeAllowed); MINIUPNP_LIBSPEC int UPNP_GetOutboundPinholeTimeout(const char * controlURL, const char * servicetype, const char * remoteHost, const char * remotePort, const char * intClient, const char * intPort, const char * proto, int * opTimeout); MINIUPNP_LIBSPEC int UPNP_AddPinhole(const char * controlURL, const char * servicetype, const char * remoteHost, const char * remotePort, const char * intClient, const char * intPort, const char * proto, const char * leaseTime, char * uniqueID); MINIUPNP_LIBSPEC int UPNP_UpdatePinhole(const char * controlURL, const char * servicetype, const char * uniqueID, const char * leaseTime); MINIUPNP_LIBSPEC int UPNP_DeletePinhole(const char * controlURL, const char * servicetype, const char * uniqueID); MINIUPNP_LIBSPEC int UPNP_CheckPinholeWorking(const char * controlURL, const char * servicetype, const char * uniqueID, int * isWorking); MINIUPNP_LIBSPEC int UPNP_GetPinholePackets(const char * controlURL, const char * servicetype, const char * uniqueID, int * packets); # 17 "src/tools/tor-fw-helper/tor-fw-helper-upnp.h" 2 # 1 "/usr/include/miniupnpc/upnperrors.h" 1 3 4 # 20 "/usr/include/miniupnpc/upnperrors.h" 3 4 MINIUPNP_LIBSPEC const char * strupnperror(int err); # 18 "src/tools/tor-fw-helper/tor-fw-helper-upnp.h" 2 typedef struct miniupnpc_state_t { struct UPNPUrls urls; struct IGDdatas data; char lanaddr[64]; int init; } miniupnpc_state_t; const tor_fw_backend_t *tor_fw_get_miniupnp_backend(void); int tor_upnp_init(tor_fw_options_t *options, void *backend_state); int tor_upnp_cleanup(tor_fw_options_t *options, void *backend_state); int tor_upnp_fetch_public_ip(tor_fw_options_t *options, void *backend_state); int tor_upnp_add_tcp_mapping(uint16_t internal_port, uint16_t external_port, int is_verbose, void *backend_state); # 37 "src/tools/tor-fw-helper/tor-fw-helper.c" 2 typedef struct backends_t { int n_backends; tor_fw_backend_t backend_ops[23]; void *backend_state[23]; } backends_t; static int init_backends(tor_fw_options_t *options, backends_t *backends) { int n_available = 0; int i, r, n; tor_fw_backend_t *backend_ops_list[23]; void *data = ((void *)0); n = 0; backend_ops_list[n++] = (tor_fw_backend_t *) tor_fw_get_miniupnp_backend(); backend_ops_list[n++] = (tor_fw_backend_t *) tor_fw_get_natpmp_backend(); n_available = n; n = 0; for (i=0; istate_len); if (!data) { perror("calloc"); exit(1); } r = backend_ops_list[i]->init(options, data); if (r == 0) { backends->backend_ops[n] = *backend_ops_list[i]; backends->backend_state[n] = data; n++; } else { free(data); } } backends->n_backends = n; return n; } static void usage(void) { fprintf(stderr, "tor-fw-helper usage:\n" " [-h|--help]\n" " [-T|--test-commandline]\n" " [-v|--verbose]\n" " [-g|--fetch-public-ip]\n" " [-p|--forward-port ([]:)]\n"); } static int log_commandline_options(int argc, char **argv) { int i, retval; FILE *logfile; time_t now; logfile = fopen("tor-fw-helper.log", "a"); if (((void *)0) == logfile) return -1; now = time(((void *)0)); retval = fprintf(logfile, "START: %s\n", ctime(&now)); for (i = 0; i < argc; i++) { retval = fprintf(logfile, "ARG: %d: %s\n", i, argv[i]); if (retval < 0) goto error; retval = fprintf(stderr, "ARG: %d: %s\n", i, argv[i]); if (retval < 0) goto error; } now = time(((void *)0)); retval = fprintf(logfile, "END: %s\n", ctime(&now)); retval = fclose(logfile); return retval; error: fclose(logfile); return -1; } static void tor_fw_fetch_public_ip(tor_fw_options_t *tor_fw_options, backends_t *backends) { int i; int r = 0; if (tor_fw_options->verbose) fprintf(stderr, "V: tor_fw_fetch_public_ip\n"); for (i=0; in_backends; ++i) { if (tor_fw_options->verbose) { fprintf(stderr, "V: running backend_state now: %i\n", i); fprintf(stderr, "V: size of backend state: %u\n", (int)(backends->backend_ops)[i].state_len); fprintf(stderr, "V: backend state name: %s\n", (char *)(backends->backend_ops)[i].name); } r = backends->backend_ops[i].fetch_public_ip(tor_fw_options, backends->backend_state[i]); fprintf(stderr, "tor-fw-helper: tor_fw_fetch_public_ip backend %s " " returned: %i\n", (char *)(backends->backend_ops)[i].name, r); } } static void tor_fw_helper_report_port_fw_results(uint16_t internal_port, uint16_t external_port, int succeded, const char *message) { char *report_string = ((void *)0); tor_asprintf(&report_string, "%s %s %u %u %s %s\n", "tor-fw-helper", "tcp-forward", external_port, internal_port, succeded ? "SUCCESS" : "FAIL", message); fprintf(stdout, "%s", report_string); fflush(stdout); (void) ({ if (__builtin_expect(!!((report_string)!=((void *)0)), 1)) { free(report_string); (report_string)=((void *)0); } }); } # 203 "src/tools/tor-fw-helper/tor-fw-helper.c" static char * get_list_of_backends_string(backends_t *backends) { char *backend_names = ((void *)0); int i; smartlist_t *backend_names_sl = smartlist_new(); ((backends->n_backends) ? (void) (0) : __assert_fail ("backends->n_backends", "src/tools/tor-fw-helper/tor-fw-helper.c", 210, __PRETTY_FUNCTION__)); for (i=0; in_backends; ++i) smartlist_add(backend_names_sl, (char *) backends->backend_ops[i].name); backend_names = smartlist_join_strings(backend_names_sl, ", ", 0, ((void *)0)); smartlist_free(backend_names_sl); return backend_names; } static void tor_fw_add_ports(tor_fw_options_t *tor_fw_options, backends_t *backends) { int i; int r = 0; int succeeded = 0; if (tor_fw_options->verbose) fprintf(stderr, "V: %s\n", __func__); (void) ({ int port_to_forward_sl_idx, port_to_forward_sl_len=(tor_fw_options->ports_to_forward)->num_used; port_to_forward_t * port_to_forward; for (port_to_forward_sl_idx = 0; port_to_forward_sl_idx < port_to_forward_sl_len; ++port_to_forward_sl_idx) { port_to_forward = (tor_fw_options->ports_to_forward)->list[port_to_forward_sl_idx]; { succeeded = 0; for (i=0; in_backends; ++i) { if (tor_fw_options->verbose) { fprintf(stderr, "V: running backend_state now: %i\n", i); fprintf(stderr, "V: size of backend state: %u\n", (int)(backends->backend_ops)[i].state_len); fprintf(stderr, "V: backend state name: %s\n", (const char *) backends->backend_ops[i].name); } r = backends->backend_ops[i].add_tcp_mapping(port_to_forward->internal_port, port_to_forward->external_port, tor_fw_options->verbose, backends->backend_state[i]); if (r == 0) { tor_fw_helper_report_port_fw_results((port_to_forward->internal_port), (port_to_forward->external_port), 1, (backends->backend_ops[i].name)) ; succeeded = 1; break; } fprintf(stderr, "tor-fw-helper: tor_fw_add_port backend %s " "returned: %i\n", (const char *) backends->backend_ops[i].name, r); } if (!succeeded) { char *list_of_backends_str = get_list_of_backends_string(backends); char *fail_msg = ((void *)0); tor_asprintf(&fail_msg, "All port forwarding backends (%s) failed.", list_of_backends_str); tor_fw_helper_report_port_fw_results((port_to_forward->internal_port), (port_to_forward->external_port), 0, (fail_msg)) ; (void) ({ if (__builtin_expect(!!((list_of_backends_str)!=((void *)0)), 1)) { free(list_of_backends_str); (list_of_backends_str)=((void *)0); } }); (void) ({ if (__builtin_expect(!!((fail_msg)!=((void *)0)), 1)) { free(fail_msg); (fail_msg)=((void *)0); } }); } } port_to_forward = ((void *)0); } }); } static int tor_fw_helper_network_init(void) { # 306 "src/tools/tor-fw-helper/tor-fw-helper.c" return 0; } static port_to_forward_t * parse_port(const char *arg) { smartlist_t *sl = smartlist_new(); port_to_forward_t *port_to_forward = ((void *)0); char *port_str = ((void *)0); int ok; int port; smartlist_split_string(sl, arg, ":", 0, 0); if (((sl)->num_used) != 2) goto err; port_to_forward = tor_malloc_(sizeof(port_to_forward_t) ); if (!port_to_forward) goto err; port_str = ((sl)->list[0]); port = (int)tor_parse_long(port_str, 10, 1, 65535, &ok, ((void *)0)); if (!ok && strlen(port_str)) goto err; port_to_forward->external_port = port; port_str = ((sl)->list[1]); port = (int)tor_parse_long(port_str, 10, 1, 65535, &ok, ((void *)0)); if (!ok) goto err; port_to_forward->internal_port = port; goto done; err: (void) ({ if (__builtin_expect(!!((port_to_forward)!=((void *)0)), 1)) { free(port_to_forward); (port_to_forward)=((void *)0); } }); done: (void) ({ int cp_sl_idx, cp_sl_len=(sl)->num_used; char * cp; for (cp_sl_idx = 0; cp_sl_idx < cp_sl_len; ++cp_sl_idx) { cp = (sl)->list[cp_sl_idx]; { (void) ({ if (__builtin_expect(!!((cp)!=((void *)0)), 1)) { free(cp); (cp)=((void *)0); } }); } cp = ((void *)0); } }); smartlist_free(sl); return port_to_forward; } static void report_full_fail(const smartlist_t *ports_to_forward) { if (!ports_to_forward) return; (void) ({ int port_to_forward_sl_idx, port_to_forward_sl_len=(ports_to_forward)->num_used; const port_to_forward_t * port_to_forward; for (port_to_forward_sl_idx = 0; port_to_forward_sl_idx < port_to_forward_sl_len; ++port_to_forward_sl_idx) { port_to_forward = (ports_to_forward)->list[port_to_forward_sl_idx]; { tor_fw_helper_report_port_fw_results((port_to_forward->internal_port), (port_to_forward->external_port), 0, ("All backends (NAT-PMP, UPnP) failed " "to initialize!")) ; } port_to_forward = ((void *)0); } }); } int main(int argc, char **argv) { int r = 0; int c = 0; tor_fw_options_t tor_fw_options; backends_t backend_state; memset(&tor_fw_options, 0, sizeof(tor_fw_options)); memset(&backend_state, 0, sizeof(backend_state)); while (1) { int option_index = 0; static struct option long_options[] = { {"verbose", 0, 0, 'v'}, {"help", 0, 0, 'h'}, {"port", 1, 0, 'p'}, {"fetch-public-ip", 0, 0, 'g'}, {"test-commandline", 0, 0, 'T'}, {0, 0, 0, 0} }; c = getopt_long(argc, argv, "vhp:gT", long_options, &option_index); if (c == -1) break; switch (c) { case 'v': tor_fw_options.verbose = 1; break; case 'h': tor_fw_options.help = 1; usage(); exit(1); break; case 'p': { port_to_forward_t *port_to_forward = parse_port(optarg); if (!port_to_forward) { fprintf(stderr, "E: Failed to parse '%s'.\n", optarg); usage(); exit(1); } if (!port_to_forward->external_port) { ((port_to_forward->internal_port) ? (void) (0) : __assert_fail ("port_to_forward->internal_port", "src/tools/tor-fw-helper/tor-fw-helper.c", 414, __PRETTY_FUNCTION__)); if (tor_fw_options.verbose) fprintf(stderr, "V: No external port was given. Setting to %u.\n", port_to_forward->internal_port); port_to_forward->external_port = port_to_forward->internal_port; } if (!tor_fw_options.ports_to_forward) tor_fw_options.ports_to_forward = smartlist_new(); smartlist_add(tor_fw_options.ports_to_forward, port_to_forward); break; } case 'g': tor_fw_options.fetch_public_ip = 1; break; case 'T': tor_fw_options.test_commandline = 1; break; case '?': break; default : fprintf(stderr, "Unknown option!\n"); usage(); exit(1); } } { if (tor_fw_options.verbose) fprintf(stderr, "V: tor-fw-helper version %s\n" "V: We were called with the following arguments:\n" "V: verbose = %d, help = %d, fetch_public_ip = %u\n", "0.2", tor_fw_options.verbose, tor_fw_options.help, tor_fw_options.fetch_public_ip); if (tor_fw_options.verbose && tor_fw_options.ports_to_forward) { fprintf(stderr, "V: TCP forwarding:\n"); (void) ({ int port_to_forward_sl_idx, port_to_forward_sl_len=(tor_fw_options.ports_to_forward)->num_used; const port_to_forward_t * port_to_forward; for (port_to_forward_sl_idx = 0; port_to_forward_sl_idx < port_to_forward_sl_len; ++port_to_forward_sl_idx) { port_to_forward = (tor_fw_options.ports_to_forward)->list[port_to_forward_sl_idx]; { fprintf(stderr, "V: External: %u, Internal: %u\n", port_to_forward->external_port, port_to_forward->internal_port); } port_to_forward = ((void *)0); } }) ; } } if (tor_fw_options.test_commandline) { return log_commandline_options(argc, argv); } if (!tor_fw_options.fetch_public_ip && !tor_fw_options.ports_to_forward) { fprintf(stderr, "E: We require a port to be forwarded or " "fetch_public_ip request!\n"); usage(); exit(1); } if (tor_fw_helper_network_init()) exit(1); r = init_backends(&tor_fw_options, &backend_state); if (!r) { report_full_fail(tor_fw_options.ports_to_forward); fprintf(stderr, "tor-fw-helper: All backends failed.\n"); exit(1); } else { fprintf(stderr, "tor-fw-helper: %i NAT traversal helper(s) loaded\n", r); } if (tor_fw_options.ports_to_forward) { tor_fw_add_ports(&tor_fw_options, &backend_state); } if (tor_fw_options.fetch_public_ip) { tor_fw_fetch_public_ip(&tor_fw_options, &backend_state); } if (tor_fw_options.ports_to_forward) { (void) ({ int port_sl_idx, port_sl_len=(tor_fw_options.ports_to_forward)->num_used; port_to_forward_t * port; for (port_sl_idx = 0; port_sl_idx < port_sl_len; ++port_sl_idx) { port = (tor_fw_options.ports_to_forward)->list[port_sl_idx]; { (void) ({ if (__builtin_expect(!!((port)!=((void *)0)), 1)) { free(port); (port)=((void *)0); } }); } port = ((void *)0); } }) ; smartlist_free(tor_fw_options.ports_to_forward); } exit(0); }