home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / nmap254b.zip / timing.h < prev    next >
C/C++ Source or Header  |  2001-07-02  |  4KB  |  76 lines

  1.  
  2. /***********************************************************************/
  3. /* timing.h -- Functions related to computing scan timing (such as     */
  4. /* keeping track of and adjusting smoothed round trip times,           */
  5. /* statistical deviations, timeout values, etc.  Various user options  */
  6. /* (such as the timing policy (-T)) also play a role in these          */
  7. /* calculations                                                        */
  8. /*                                                                     */
  9. /***********************************************************************/
  10. /*  The Nmap Security Scanner is (C) 1995-2001 Insecure.Com LLC. This  */
  11. /*  program is free software; you can redistribute it and/or modify    */
  12. /*  it under the terms of the GNU General Public License as published  */
  13. /*  by the Free Software Foundation; Version 2.  This guarantees your  */
  14. /*  right to use, modify, and redistribute this software under certain */
  15. /*  conditions.  If this license is unacceptable to you, we may be     */
  16. /*  willing to sell alternative licenses (contact sales@insecure.com). */
  17. /*                                                                     */
  18. /*  If you received these files with a written license agreement       */
  19. /*  stating terms other than the (GPL) terms above, then that          */
  20. /*  alternative license agreement takes precendence over this comment. */
  21. /*                                                                     */
  22. /*  Source is provided to this software because we believe users have  */
  23. /*  a right to know exactly what a program is going to do before they  */
  24. /*  run it.  This also allows you to audit the software for security   */
  25. /*  holes (none have been found so far).                               */
  26. /*                                                                     */
  27. /*  Source code also allows you to port Nmap to new platforms, fix     */
  28. /*  bugs, and add new features.  You are highly encouraged to send     */
  29. /*  your changes to fyodor@insecure.org for possible incorporation     */
  30. /*  into the main distribution.  By sending these changes to Fyodor or */
  31. /*  one the insecure.org development mailing lists, it is assumed that */
  32. /*  you are offering Fyodor the unlimited, non-exclusive right to      */
  33. /*  reuse, modify, and relicense the code.  This is important because  */
  34. /*  the inability to relicense code has caused devastating problems    */
  35. /*  for other Free Software projects (such as KDE and NASM).  Nmap     */
  36. /*  will always be available Open Source.  If you wish to specify      */
  37. /*  special license conditions of your contributions, just say so      */
  38. /*  when you send them.                                                */
  39. /*                                                                     */
  40. /*  This program is distributed in the hope that it will be useful,    */
  41. /*  but WITHOUT ANY WARRANTY; without even the implied warranty of     */
  42. /*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU  */
  43. /*  General Public License for more details (                          */
  44. /*  http://www.gnu.org/copyleft/gpl.html ).                            */
  45. /*                                                                     */
  46. /***********************************************************************/
  47.  
  48. /* $Id: timing.h,v 1.3 2001/07/02 09:38:14 fyodor Exp $ */
  49.  
  50. #ifndef NMAP_TIMING_H
  51. #define NMAP_TIMING_H
  52.  
  53. #include "tcpip.h"
  54. #include "global_structures.h"
  55.  
  56. /* Same as adjust_timeouts(), except this one allows you to specify
  57.  the receive time too (which could be because it was received a while
  58.  back or it could be for efficiency because the caller already knows
  59.  the current time */
  60. void adjust_timeouts2(const struct timeval *sent, 
  61.               const struct timeval *received, 
  62.               struct timeout_info *to);
  63.  
  64. /* Adjust our timeout values based on the time the latest probe took for a 
  65.    response.  We update our RTT averages, etc. */
  66. void adjust_timeouts(struct timeval sent, struct timeout_info *to);
  67.  
  68.  
  69. /* Sleeps if necessary to ensure that it isn't called twice withen less
  70.    time than o.send_delay.  If it is passed a non-null tv, the POST-SLEEP
  71.    time is recorded in it */
  72. void enforce_scan_delay(struct timeval *tv);
  73.  
  74. #endif /* NMAP_TIMING_H */
  75.  
  76.