muhstik

- irc flooding solution
git clone git://git.acid.vegas/muhstik.git
Log | Files | Refs | Archive | README

clone.h (2974B)

      1 /* Muhstik, Copyright (C) 2001-2002, Louis Bavoil <mulder@gmx.fr>       */
      2 /*                        2009-2011, Leon Kaiser <literalka@gnaa.eu>    */
      3 /*                                                                      */
      4 /* This program is free software; you can redistribute it and/or        */
      5 /* modify it under the terms of the GNU Library General Public License  */
      6 /* as published by the Free Software Foundation; either version 2       */
      7 /* of the License, or (at your option) any later version.               */
      8 /*                                                                      */
      9 /* This program is distributed in the hope that it will be useful,      */
     10 /* but WITHOUT ANY WARRANTY; without even the implied warranty of       */
     11 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        */
     12 /* GNU Library General Public License for more details.                 */
     13 
     14 #ifndef CLONE_H
     15 #define CLONE_H
     16 
     17 #include "init.h"
     18 #include "net.h"
     19 #include "lists.h"
     20 
     21 typedef struct
     22 {
     23      int type;
     24      char mode;
     25      char *save;
     26      char *server;
     27      unsigned short proxy_port;
     28      unsigned short server_port;
     29 } scan_t;
     30 
     31 typedef struct
     32 {
     33      int id;
     34      int type;
     35      char *proxy;
     36      unsigned short proxy_port;
     37      char *server;
     38      unsigned short server_port;
     39      char *server_pass;
     40      char *server_ident;
     41      char *host;
     42      unsigned short port;
     43      int sock;
     44      char *save;
     45      char online;
     46      char restricted;
     47      int reco;
     48      unsigned int monitor_tmax;
     49      int grabbing;
     50      char **jupes;
     51      char op[MAX_CHANS];
     52      char needop[MAX_CHANS];
     53      char *nick;
     54      char *nick2;
     55      char *ident;
     56      char *real;
     57      queue queue;
     58      char wait_whois;
     59      scan_t *scan;
     60      char mode;
     61      char status;
     62      time_t lastsend;
     63      time_t start;
     64      time_t alarm;
     65      time_t rejoin_time;
     66      char buffer[1024];
     67      char lastbuffer[1024];
     68 } clone_t;
     69 
     70 typedef struct
     71 {
     72      char *parm;
     73      void (*function) (clone_t *cl, char *cmd, char *nick, char *from, char *buf);
     74 } msg_t;
     75 
     76 void free_clone (clone_t *clone);
     77 int main_clone (void *arg);
     78 void save_host (clone_t *clone);
     79 int not_a_clone (char *s);
     80 int not_a_mast (char *s);
     81 int is_enemy (char *s);
     82 int is_op (clone_t *clone, int chid);
     83 void op (clone_t *clone, int chid, char *s);
     84 void deop (clone_t *clone, int chid, char *s);
     85 int deop_enemy (clone_t *clone, int chid, char *nick);
     86 void kick (clone_t *clone, int chid, char *s, char *reas, int mode);
     87 void ban (clone_t *clone, int chid, char *s, int mode);
     88 void unban (clone_t *clone, int chid, char *s);
     89 void kickban (clone_t *clone, char *s);
     90 void join (clone_t *clone, char *dest);
     91 void echo (clone_t *clone, char *chan, char *buf);
     92 void send_irc_nick (clone_t *clone, char *nick);
     93 void register_clone (clone_t *clone);
     94 
     95 void send2clones (char *buffer);
     96 void send2server (clone_t *clone, const char *fmt, ...);
     97 
     98 int parse_deco (clone_t *clone, char *buf);
     99 void parse_irc (clone_t *clone, char *buf);
    100 
    101 #endif