ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/hopm/trunk/src/scan.c
(Generate patch)

Comparing hopm/trunk/src/scan.c (file contents):
Revision 5090 by michael, Tue Dec 23 18:51:47 2014 UTC vs.
Revision 5091 by michael, Tue Dec 23 19:59:18 2014 UTC

# Line 118 | Line 118 | void scan_cycle()
118     /* Cycle each scanner object */
119     LIST_FOREACH(p, SCANNERS->head)
120     {
121 <      scs = (struct scanner_struct *) p->data;
121 >      scs = p->data;
122        opm_cycle(scs->scanner);
123     }
124   }
# Line 257 | Line 257 | void scan_init()
257        /* Setup the protocols */
258        LIST_FOREACH(p2, sc->protocols->head)
259        {
260 <         pc = (struct ProtocolConf *) p2->data;
260 >         pc = p2->data;
261  
262           if(OPT_DEBUG >= 2)
263           {
# Line 280 | Line 280 | void scan_init()
280     /* Give scanners a list of masks they scan */
281     LIST_FOREACH(p, SCANNERS->head)
282     {
283 <      scs = (struct scanner_struct *) p->data;
283 >      scs = p->data;
284  
285        LIST_FOREACH(p2, UserItemList->head)
286        {
287 <         uc = (struct UserConf *) p2->data;
287 >         uc = p2->data;
288           LIST_FOREACH(p3, uc->scanners->head)
289           {
290 <            scannername = (char *) p3->data;
290 >            scannername = p3->data;
291              /* Add all these masks to scanner */
292              if(strcasecmp(scannername, scs->name) == 0)
293              {
294                 LIST_FOREACH(p4, uc->masks->head)
295                 {
296 <                  mask = (char *) p4->data;
296 >                  mask = p4->data;
297  
298                    if(OPT_DEBUG)
299                    {
# Line 403 | Line 403 | void scan_connect(char **user, char *msg
403     /* Add ss->remote to all matching scanners */
404     LIST_FOREACH(p, SCANNERS->head)
405     {
406 <      scs = (struct scanner_struct *) p->data;
406 >      scs = p->data;
407        LIST_FOREACH(p2, scs->masks->head)
408        {
409 <         scsmask = (char *) p2->data;
409 >         scsmask = p2->data;
410           if(!match(scsmask, mask))
411           {
412              if(OPT_DEBUG)
# Line 588 | Line 588 | void scan_positive(struct scan_struct *s
588     /* Close all scans prematurely */
589     LIST_FOREACH(node, SCANNERS->head)
590     {
591 <      scanner = (OPM_T *) ((struct scanner_struct *) node->data)->scanner;
591 >      scanner = ((struct scanner_struct *)node->data)->scanner;
592        opm_end(scanner, ss->remote);
593     }
594  
# Line 619 | Line 619 | void scan_open_proxy(OPM_T *scanner, OPM
619     /* Record that a scan happened */
620     scan_log(remote);
621  
622 <   scs = (struct scanner_struct *) data;
623 <   ss = (struct scan_struct *) remote->data;
622 >   scs = data;
623 >   ss = remote->data;
624  
625     if(ss->manual_target == NULL)
626     {
# Line 677 | Line 677 | void scan_negotiation_failed(OPM_T *scan
677     /* Record that a scan happened */
678     scan_log(remote);
679  
680 <   scs = (struct scanner_struct *) data;
681 < //   ss = (struct scan_struct *) remote->data;
680 >   scs = data;
681 > //   ss = remote->data;
682  
683     if(OPT_DEBUG)
684     {
# Line 720 | Line 720 | static void scan_timeout(OPM_T *scanner,
720     /* Record that a scan happened */
721     scan_log(remote);
722  
723 <   scs = (struct scanner_struct *) data;
724 < //   ss = (struct scan_struct *) remote->data;
723 >   scs = data;
724 > //   ss = remote->data;
725  
726     if(OPT_DEBUG)
727     {
# Line 762 | Line 762 | static void scan_end(OPM_T *scanner, OPM
762     struct scan_struct *ss;
763     struct scanner_struct *scs;
764  
765 <   scs = (struct scanner_struct *) data;
766 <   ss = (struct scan_struct *) remote->data;
765 >   scs = data;
766 >   ss = remote->data;
767  
768     if(OPT_DEBUG)
769        log_printf("SCAN -> Scan %s [%s] completed", remote->ip, scs->name);
# Line 796 | Line 796 | static void scan_handle_error(OPM_T *sca
796     struct scan_struct *ss;
797     struct scanner_struct *scs;
798  
799 <   scs = (struct scanner_struct *) data;
800 <   ss = (struct scan_struct *) remote->data;
799 >   scs = data;
800 >   ss = remote->data;
801  
802     switch(err)
803     {
# Line 1055 | Line 1055 | void scan_manual(char *param, struct Cha
1055     /* Add ss->remote to all scanners */
1056     LIST_FOREACH(p, SCANNERS->head)
1057     {
1058 <      scs = (struct scanner_struct *) p->data;
1058 >      scs = p->data;
1059  
1060        /* If we have a scannername, only allow that scanner
1061           to be used */
# Line 1150 | Line 1150 | static void scan_log(OPM_REMOTE_T *remot
1150     char buf_present[25];
1151     time_t present;
1152     struct tm *tm_present;
1153 <   struct scan_struct *ss = (struct scan_struct *) remote->data;
1153 >   struct scan_struct *ss = remote->data;
1154  
1155     if(!(OptionsItem->scanlog && scanlogfile))
1156        return;

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)