home *** CD-ROM | disk | FTP | other *** search
/ Steganos Hacker Tools / SHT151.iso / programme / scanner / nmapNTsp1 / Win_2000.exe / nmapNT-src / targets.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-07-06  |  3.2 KB  |  98 lines

  1. #ifndef TARGETS_H
  2. #define TARGETS_H
  3. #ifdef WIN32
  4. #include <winclude.h>
  5. #else
  6. #include "config.h"
  7.  
  8. /* This contains pretty much everythign we need ... */
  9. #include <sys/time.h>
  10. #include <unistd.h>
  11.  
  12. #ifdef HAVE_SYS_PARAM_H   
  13. #include <sys/param.h> /* Defines MAXHOSTNAMELEN on BSD*/
  14. #endif
  15. #endif
  16.  
  17. #include "nmap.h"
  18. #include "global_structures.h"
  19.  
  20. /**************************STRUCTURES******************************/
  21. struct pingtune {
  22.   int up_this_block;
  23.   int down_this_block;
  24.   int block_tries;
  25.   int block_unaccounted;
  26.   int max_tries;
  27.   int num_responses;
  28.   int dropthistry;
  29.   int group_size;
  30.   int group_start;
  31.   int group_end;
  32.   int discardtimesbefore;
  33. };
  34.  
  35. struct tcpqueryinfo {
  36.   int *sockets;
  37.   int maxsd;
  38.   fd_set fds_r;
  39.   fd_set fds_w;
  40.   fd_set fds_x;
  41.   int sockets_out;
  42. };
  43.  
  44. struct pingtech {
  45.   int icmpscan: 1,
  46.     rawicmpscan: 1,
  47.     connecttcpscan: 1,
  48.     rawtcpscan: 1;
  49. };
  50.  
  51.  
  52. int get_ping_results(int sd, pcap_t *pd, struct hoststruct *hostbatch, struct timeval *time,  struct pingtune *pt, struct timeout_info *to, int id, struct pingtech *ptech);
  53. int hostupdate(struct hoststruct *hostbatch, struct hoststruct *target, 
  54.            int newstate, int dotimeout, int trynum, 
  55.            struct timeout_info *to, struct timeval *sent, 
  56.            struct pingtune *pt, struct tcpqueryinfo *tqi, int pingtype);
  57. int sendpingquery(int sd, int rawsd, struct hoststruct *target,  
  58.           int seq, unsigned short id, struct scanstats *ss, 
  59.           struct timeval *time, struct pingtech ptech);
  60. int sendrawtcppingquery(int rawsd, struct hoststruct *target, int seq,
  61.             struct timeval *time, struct pingtune *pt);
  62. int sendconnecttcpquery(struct hoststruct *hostbatch, struct tcpqueryinfo *tqi, struct hoststruct *target, 
  63.             int seq, struct timeval *time, struct pingtune *pt, struct timeout_info *to, int max_width);
  64. int get_connecttcpscan_results(struct tcpqueryinfo *tqi, 
  65.                    struct hoststruct *hostbatch, 
  66.                    struct timeval *time, struct pingtune *pt, 
  67.                    struct timeout_info *to);
  68. char *readhoststate(int state);
  69. void massping(struct hoststruct *hostbatch, int numhosts);
  70. /* Fills up the hostgroup_state structure passed in (which must point
  71.    to valid memory).  Lookahead is the number of hosts that can be
  72.    checked (such as ping scanned) in advance.  Randomize causes each
  73.    group of up to lookahead hosts to be internally shuffled around.
  74.    The target_expressions array must remail valid in memory as long as
  75.    this hostgroup_state structure is used -- the array is NOT copied */
  76. int hostgroup_state_init(struct hostgroup_state *hs, int lookahead,
  77.              int randomize, char *target_expressions[],
  78.              int num_expressions);
  79. /* If there is at least one IP address left in t, one is pulled out and placed
  80.    in sin and then zero is returned and state information in t is updated
  81.    to reflect that the IP was pulled out.  If t is empty, -1 is returned */
  82. int target_struct_get(struct targets *t, struct in_addr *sin);
  83. /* Undoes the previous target_struct_get operation */
  84. void target_struct_return(struct targets *t);
  85. void hoststructfry(struct hoststruct *hostbatch, int nelem);
  86. struct hoststruct *nexthost(struct hostgroup_state *hs);
  87. #endif /* TARGETS_H */
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.