94 lines
2.5 KiB
C
94 lines
2.5 KiB
C
|
|
|
|
/***********************************************************/
|
|
/* Telnet3d (the single process telnet service) written by
|
|
/* <WildThang> (dvmitche@nssl.uoknor.edu) ALL RIGHTS RESERVED.
|
|
/*
|
|
/* Duplication of this code is not permitted without explicit
|
|
/* aproval from the authors (dvmitche@nssl.uoknor.edu) in whole
|
|
/* or in parts.
|
|
/*
|
|
/* This project was designed to be used on UNDERNET IRC ONLY.
|
|
/* No exceptions to this without explicit permission from the
|
|
/* authors (dvmitche@nssl.uoknor.edu) (intru@step.polymtl.ca)
|
|
/*
|
|
/* Special Thanks for your ideas and support with this project.
|
|
/* go out to:
|
|
/* mandar@vinson.ecn.uoknor.edu
|
|
/*************************************************************/
|
|
#include <time.h>
|
|
|
|
#define MAXNICKLEN 15
|
|
|
|
/* Original value 26 */
|
|
#define MAXNICKHASH 59
|
|
/*
|
|
#define MAXNICKHASH 2600
|
|
*/
|
|
#define KLINE_FILE "kline.request"
|
|
struct nicklist {
|
|
struct nicklist *next;
|
|
struct nicklist *prev;
|
|
int level;
|
|
char oper;
|
|
char vrfy;
|
|
char *serv;
|
|
char *name;
|
|
char *uname;
|
|
char *host;
|
|
char umode;
|
|
int hops;
|
|
int sck;
|
|
time_t ts;
|
|
int nickchange;
|
|
time_t lastchange;
|
|
char *ip;
|
|
char *iphost;
|
|
};
|
|
struct nick_hash {
|
|
struct nicklist *host[MAXNICKHASH];
|
|
};
|
|
|
|
struct nick_hash *new_nick_hash();
|
|
struct nicklist *new_nicklist();
|
|
int add_nickhash(struct nicklist *nicklistid);
|
|
int add_nicklist(struct nicklist *nicklistid,struct nicklist **startid);
|
|
int remove_nicklist(struct nicklist *nicklistid);
|
|
int myfree_nicklist(struct nicklist *nicklistid);
|
|
int nick_oper(char *nickname,int flag);
|
|
int nick_level(char *nickname);
|
|
char *nick_userhost(char *nickname);
|
|
int add_newuser(char *mytok[],int args,int offset);
|
|
int seperate_nicklist(struct nicklist *nicklistid);
|
|
struct nicklist *find_nicklist(char *name);
|
|
int switch_nickname(char *mytok[],int args);
|
|
int get_hashid(char *name,int MAXHASH);
|
|
char *my_strcpy(char *inp);
|
|
int my_strfree(char *inp);
|
|
int nick_info(char *nick,int sck);
|
|
int remove_nickname(char *name);
|
|
int total_users();
|
|
int scan_userid(char *fromhost);
|
|
int destroy_nickhash();
|
|
int dump_nicklist();
|
|
int add_kline(struct nicklist *nicklistid,char *filename);
|
|
|
|
|
|
|
|
|
|
#ifdef __NICKLIST__
|
|
long MEM_nicklist_total = 0;
|
|
long MEM_nickhash_total = 0;
|
|
int MEM_nicklist_cnt = 0;
|
|
long MEM_nicklist_used = 0;
|
|
long MEM_string=0;
|
|
struct nick_hash *nick_hashid=NULL;
|
|
#else
|
|
extern long MEM_nicklist_total;
|
|
extern long MEM_nickhash_total;
|
|
extern int MEM_nicklist_cnt;
|
|
extern long MEM_nicklist_used;
|
|
extern struct nick_hash *nick_hashid;
|
|
extern long MEM_string;
|
|
#endif
|