5 /* $ModDesc: Changes the ident of connecting bottler clients to 'bottler' */
7 class ModuleAntiBottler : public Module
18 virtual ~ModuleAntiBottler()
23 virtual Version GetVersion()
25 return Version(1,0,0,0);
29 virtual void OnServerRaw(std::string &raw, bool inbound)
34 strncpy(data,raw.c_str(),MAXBUF);
35 bool not_bottler = false;
36 if (!strncmp(data,"user ",5))
38 for (int j = 0; j < strlen(data); j++)
48 char *user = strtok(data," ");
49 char *ident = strtok(NULL," ");
50 char *local = strtok(NULL," ");
51 char *remote = strtok(NULL," :");
52 char *gecos = strtok(NULL,"\r\n");
53 for (int j = 0; j < strlen(remote); j++)
55 if (((remote[j] < '0') || (remote[j] > '9')) && (remote[j] != '.'))
63 raw = "USER bottler "+std::string(local)+" "+std::string(remote)+" "+std::string(gecos)+" [Possible bottler, ident: "+std::string(ident)+"]";
71 class ModuleAntiBottlerFactory : public ModuleFactory
74 ModuleAntiBottlerFactory()
78 ~ModuleAntiBottlerFactory()
82 virtual Module * CreateModule()
84 return new ModuleAntiBottler;
90 extern "C" void * init_module( void )
92 return new ModuleAntiBottlerFactory;