home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / XINE-1.ZIP / INJECTOR.ZIP / SRC / EXTERNAL.C < prev    next >
C/C++ Source or Header  |  1996-10-21  |  938b  |  48 lines

  1. #include <stdlib.h>
  2. #include <string.h>
  3.  
  4. #include "netool.h"
  5. #include "inject.h"
  6.  
  7.  
  8. #define MAXEXT 10
  9.  
  10. char * ext_name[MAXEXT];
  11. void (* ext_func[MAXEXT]) (void);
  12.  
  13. void initexternals(void)
  14. {
  15.     ext_name[0]="inject";        /* packet injector */
  16.     ext_func[0]=inject;
  17.     ext_name[1]="injectip";        /* packet injector with ip */
  18.     ext_func[1]=injectip;
  19.     ext_name[2]="rawlog";        /* raw logging facility */
  20.     ext_func[2]=rawlog;
  21.     ext_name[3]="flood";        /* packet flooding */
  22.     ext_func[3]=flood;
  23.     ext_name[4]="getarp";        /* do an arp request */
  24.     ext_func[4]=getarp;
  25.     ext_name[5]="getarpto";        /* do an arp request */
  26.     ext_func[5]=getarpto;
  27.     ext_name[6]="synflood";        /* do a syn flood */
  28.     ext_func[6]=synflood;
  29.     ext_name[7]=NULL;        /* the last must be NULL */
  30. }
  31.  
  32. int doext(char * w)
  33. {
  34.     int i;
  35.  
  36.  
  37.     i=0;
  38.     while (ext_name[i])
  39.     {
  40.         if (!strcmp(ext_name[i],w))
  41.         {
  42.             (*ext_func[i])();
  43.             return 0;
  44.         }
  45.         i++;
  46.     }
  47.     return 1;
  48. }