00001 /* vim: set tabstop=4: */ 00002 /* 00003 * This file is part of TraceProto. 00004 * Copyright 2004-2005 Eric Hope and others; see the AUTHORS file for details. 00005 * 00006 * TraceProto is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * TraceProto is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with TraceProto; if not, write to the Free Software 00018 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 */ 00020 #ifndef TP_MISCFUNC_H 00021 #define TP_MISCFUNC_H 1 00022 00023 #include "config.h" 00024 00025 struct cleanup { 00026 unsigned int skips_free : 1; 00027 unsigned int payload_free : 1; 00028 unsigned int free_list_free : 1; 00029 unsigned int hop_record_free : 1; 00030 unsigned int fake_psocket_free : 1; 00031 unsigned int curses_end : 1; 00032 unsigned int libnet_cleanup : 1; 00033 unsigned int pcap_cleanup : 1; 00034 unsigned int addrinfo_cleanup : 1; 00035 } tixe_cleanup; 00036 00037 int parse_skips ( char * ); 00038 00039 void ctrl_c( __attribute__((__unused__)) int unused ); 00040 00041 void ctrl_z( __attribute__((__unused__)) int unused ); 00042 00043 double diff_time ( struct timeval *, struct timeval * ); 00044 00045 int do_filter ( void ); 00046 00047 int account_packet ( double return_time ); 00048 00049 void hop_audit( void ); 00050 00051 int reg_name ( char * ); 00052 00053 void tixe ( struct cleanup clean_list, int exit_status ) __attribute__((__noreturn__)); 00054 00055 void version( void ); 00056 00057 unsigned char parse_flags ( char * ); 00058 00059 int make_timestamp ( char * ); 00060 00061 u_char * tp_align ( const u_char *, unsigned int, unsigned int ); 00062 00063 void dropexcesscapabilities( void ); 00064 00065 void parse_debug ( char * optarg ); 00066 00067 void debug_packet ( const u_int8_t * const raw, const u_int bytes ); 00068 00069 #endif /* TP_MISCFUNC_H */