[IRC-Dev CVS] [CVS] Module ircd-ircdev: Change committed
Brought to you by:
zolty
From: Toni G. <zo...@us...> - 2004-04-23 11:08:41
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2004-04-23 11:08:19 UTC Modified files: ChangeLog ChangeLog.es TODO.es include/client.h include/handlers.h include/msg.h include/numeric.h include/patchlevel.h include/querycmds.h include/s_serv.h ircd/Makefile.in ircd/channel.c ircd/engine_epoll.c ircd/gline.c ircd/ircd.c ircd/ircd_parser.y ircd/m_invite.c ircd/m_join.c ircd/m_lusers.c ircd/m_names.c ircd/m_watch.c ircd/m_whois.c ircd/parse.c ircd/s_err.c ircd/s_serv.c ircd/watch.c ircd/whocmds.c Added files: ircd/m_users.c Log message: Author: zoltan <zo...@ir...> Log message: 2004-04-23 Toni García <zo...@ir...> 1.0.alpha9 * Fix de warnings de compilacion * Comando USERS * Sincronizacion Undernet 2004-04-23 Roberto Muñoz <r5...@te...> * Soporte @+ en WHOIS, WHO y NAMES ---------------------- diff included ---------------------- Index: ircd-ircdev/ChangeLog diff -u ircd-ircdev/ChangeLog:1.9 ircd-ircdev/ChangeLog:1.10 --- ircd-ircdev/ChangeLog:1.9 Sun Feb 22 08:16:22 2004 +++ ircd-ircdev/ChangeLog Fri Apr 23 04:08:08 2004 @@ -1,10 +1,17 @@ # # ChangeLog for ircd-ircdev # -# $Id: ChangeLog,v 1.9 2004/02/22 16:16:22 zolty Exp $ +# $Id: ChangeLog,v 1.10 2004/04/23 11:08:08 zolty Exp $ # # Insert new changes at beginning of the change list. # +2004-04-23 Toni García <zo...@ir...> 1.0.alpha9 + * Warnings fixes + * USERS command + * Undernet synchronization +2004-04-23 Roberto Muñoz <r5...@te...> + * @+ support on WHOIS, WHO y NAMES + 2004-02-22 Toni Garcia <zo...@ir...> 1.0.alpha8 * Synchronization with u2.10.11.07. * Headers cleanup (GPLv2 licence) Index: ircd-ircdev/ChangeLog.es diff -u ircd-ircdev/ChangeLog.es:1.9 ircd-ircdev/ChangeLog.es:1.10 --- ircd-ircdev/ChangeLog.es:1.9 Sun Feb 22 08:16:22 2004 +++ ircd-ircdev/ChangeLog.es Fri Apr 23 04:08:08 2004 @@ -1,10 +1,17 @@ # # Log de Cambios para ircd-ircdev # -# $Id: ChangeLog.es,v 1.9 2004/02/22 16:16:22 zolty Exp $ +# $Id: ChangeLog.es,v 1.10 2004/04/23 11:08:08 zolty Exp $ # # Insertar los nuevos cambios al principio de esta lista de cambios. # +2004-04-23 Toni García <zo...@ir...> 1.0.alpha9 + * Fix de warnings de compilacion + * Comando USERS + * Sincronizacion Undernet +2004-04-23 Roberto Muñoz <r5...@te...> + * Soporte @+ en WHOIS, WHO y NAMES + 2004-02-22 Toni Garcia <zo...@ir...> 1.0.alpha8 * Sincronizacion con u2.10.11.07. * Limpieza de cabeceras (Licencia GPLv2) Index: ircd-ircdev/TODO.es diff -u ircd-ircdev/TODO.es:1.5 ircd-ircdev/TODO.es:1.6 --- ircd-ircdev/TODO.es:1.5 Sun Feb 22 08:16:22 2004 +++ ircd-ircdev/TODO.es Fri Apr 23 04:08:08 2004 @@ -1,14 +1,13 @@ # # TODO para ircd-ircdev # -# $Id: TODO.es,v 1.5 2004/02/22 16:16:22 zolty Exp $ +# $Id: TODO.es,v 1.6 2004/04/23 11:08:08 zolty Exp $ # # Insertar las nuevas entradas al principio de la lista TODO. # URGENTE: -Limpieza de licencias en los ircd/m_*.c Bugs Conocidos: @@ -23,7 +22,6 @@ Features para General: -------------------------------------------------------------------------------------- - Caracter '~' en los nicks. -- Mostrar @+#canal en NAMES, WHOIS y WHO. - Los clientes con +k han de poder "hablar" en canales. - Mostrar tiempo en formato humano en las G-lines. - Soporte de E-lines (excepciones a K-lines). @@ -32,8 +30,6 @@ - ¿Modo +M de canales?. - Enviar un Closing Link en los QUIT. - ¿Ampliacion comando OPER para elegir clase? -- Comando USERS. -- No permitir invitar a canales desde fuera. - Poner uuna Feature para elegir entre salir o no el nombre del servidor en los notices de auth y dnslookup al conectar. - Cuando nos silencian, que salga un numerico. Index: ircd-ircdev/include/client.h diff -u ircd-ircdev/include/client.h:1.4 ircd-ircdev/include/client.h:1.5 --- ircd-ircdev/include/client.h:1.4 Sun Feb 22 08:13:20 2004 +++ ircd-ircdev/include/client.h Fri Apr 23 04:08:08 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: client.h,v 1.4 2004/02/22 16:13:20 zolty Exp $ + * $Id: client.h,v 1.5 2004/04/23 11:08:08 zolty Exp $ * */ #ifndef INCLUDED_client_h @@ -160,8 +160,8 @@ FLAG_GLOBAL_UMODES = FLAG_OPER /* First global mode flag */ }; -DECLARE_FLAGSET(Privs, PRIV_LAST_PRIV); -DECLARE_FLAGSET(Flags, FLAG_LAST_FLAG); +DECLARE_FLAGSET(Privs, PRIV_LAST_PRIV) +DECLARE_FLAGSET(Flags, FLAG_LAST_FLAG) struct Connection { /* Index: ircd-ircdev/include/handlers.h diff -u ircd-ircdev/include/handlers.h:1.4 ircd-ircdev/include/handlers.h:1.5 --- ircd-ircdev/include/handlers.h:1.4 Sun Feb 22 08:13:20 2004 +++ ircd-ircdev/include/handlers.h Fri Apr 23 04:08:08 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: handlers.h,v 1.4 2004/02/22 16:13:20 zolty Exp $ + * $Id: handlers.h,v 1.5 2004/04/23 11:08:08 zolty Exp $ * */ #ifndef INCLUDED_handlers_h @@ -133,6 +133,7 @@ extern int m_user(struct Client*, struct Client*, int, char*[]); extern int m_userhost(struct Client*, struct Client*, int, char*[]); extern int m_userip(struct Client*, struct Client*, int, char*[]); +extern int m_users(struct Client*, struct Client*, int, char*[]); extern int m_version(struct Client*, struct Client*, int, char*[]); extern int m_wallchops(struct Client*, struct Client*, int, char*[]); extern int m_wallvoices(struct Client*, struct Client*, int, char*[]); @@ -232,6 +233,7 @@ extern int ms_topic(struct Client*, struct Client*, int, char*[]); extern int ms_trace(struct Client*, struct Client*, int, char*[]); extern int ms_uping(struct Client*, struct Client*, int, char*[]); +extern int ms_users(struct Client*, struct Client*, int, char*[]); extern int ms_version(struct Client*, struct Client*, int, char*[]); extern int ms_wallchops(struct Client*, struct Client*, int, char*[]); extern int ms_wallvoices(struct Client*, struct Client*, int, char*[]); Index: ircd-ircdev/include/msg.h diff -u ircd-ircdev/include/msg.h:1.3 ircd-ircdev/include/msg.h:1.4 --- ircd-ircdev/include/msg.h:1.3 Sun Feb 22 08:13:21 2004 +++ ircd-ircdev/include/msg.h Fri Apr 23 04:08:08 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: msg.h,v 1.3 2004/02/22 16:13:21 zolty Exp $ + * $Id: msg.h,v 1.4 2004/04/23 11:08:08 zolty Exp $ * */ #ifndef INCLUDED_msg_h @@ -225,6 +225,10 @@ #define TOK_LUSERS "LU" #define CMD_LUSERS MSG_LUSERS, TOK_LUSERS +#define MSG_USERS "USERS" /* USE */ +#define TOK_USERS "US" +#define CMD_USERS MSG_USERS, TOK_USERS + #define MSG_MOTD "MOTD" /* MOTD */ #define TOK_MOTD "MO" #define CMD_MOTD MSG_MOTD, TOK_MOTD Index: ircd-ircdev/include/numeric.h diff -u ircd-ircdev/include/numeric.h:1.4 ircd-ircdev/include/numeric.h:1.5 --- ircd-ircdev/include/numeric.h:1.4 Sun Feb 22 08:13:21 2004 +++ ircd-ircdev/include/numeric.h Fri Apr 23 04:08:08 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: numeric.h,v 1.4 2004/02/22 16:13:21 zolty Exp $ + * $Id: numeric.h,v 1.5 2004/04/23 11:08:08 zolty Exp $ * */ #ifndef INCLUDED_numeric_h @@ -165,8 +165,8 @@ /* RPL_LOAD_THROTTLED 263 efnet/hybrid */ /* RPL_TRYAGAIN 263 Numerics List: IRCnet */ /* RPL_LOAD2HI 263 Dalnet */ -/* RPL_CURRENT_LOCAL 265 aircd/efnet/hybrid/dalnet*/ -/* RPL_CURRENT_GLOBAL 266 aircd/efnet/hybrid/dalnet */ +#define RPL_CURRENT_LOCAL 265 /* irc-dev/aircd/efnet/hybrid/dalnet */ +#define RPL_CURRENT_GLOBAL 266 /* irc-dev/aircd/efnet/hybrid/dalnet */ /* RPL_START_NETSTAT 267 aircd */ /* RPL_NETSTAT 268 aircd */ /* RPL_END_NETSTAT 269 aircd */ Index: ircd-ircdev/include/patchlevel.h diff -u ircd-ircdev/include/patchlevel.h:1.9 ircd-ircdev/include/patchlevel.h:1.10 --- ircd-ircdev/include/patchlevel.h:1.9 Sun Feb 22 08:13:21 2004 +++ ircd-ircdev/include/patchlevel.h Fri Apr 23 04:08:08 2004 @@ -17,10 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: patchlevel.h,v 1.9 2004/02/22 16:13:21 zolty Exp $ + * $Id: patchlevel.h,v 1.10 2004/04/23 11:08:08 zolty Exp $ * */ -#define PATCHLEVEL ".alpha8" +#define PATCHLEVEL ".alpha9" #define RELEASE "1.0" Index: ircd-ircdev/include/querycmds.h diff -u ircd-ircdev/include/querycmds.h:1.2 ircd-ircdev/include/querycmds.h:1.3 --- ircd-ircdev/include/querycmds.h:1.2 Sun Feb 22 08:13:21 2004 +++ ircd-ircdev/include/querycmds.h Fri Apr 23 04:08:08 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: querycmds.h,v 1.2 2004/02/22 16:13:21 zolty Exp $ + * $Id: querycmds.h,v 1.3 2004/04/23 11:08:08 zolty Exp $ * */ #ifndef INCLUDED_querycmds_h @@ -59,7 +59,17 @@ */ /* Macros for remote connections: */ -#define Count_newremoteclient(UserStats, cptr) (++UserStats.clients, ++(cli_serv(cptr)->clients)) +#define Count_newremoteclient(UserStats, cptr) \ + do { \ + ++UserStats.clients; \ + ++(cli_serv(cptr)->clients); \ + if (UserStats.clients >= max_global_count) \ + { \ + max_global_count = UserStats.clients; \ + max_global_count_TS = CurrentTime; \ + } \ + } while (0) + #define Count_newremoteserver(UserStats) (++UserStats.servers) #define Count_remoteclientquits(UserStats,cptr) \ @@ -80,6 +90,10 @@ ++current_load.local_count; \ if (UserStats.local_clients > max_client_count) \ max_client_count = UserStats.local_clients; \ + max_client_count_TS = CurrentTime; \ + if (UserStats.clients > max_global_count) \ + max_global_count = UserStats.clients; \ + max_global_count_TS = CurrentTime; \ if (UserStats.local_clients + UserStats.local_servers > max_connection_count) \ { \ max_connection_count = UserStats.local_clients + UserStats.local_servers; \ Index: ircd-ircdev/include/s_serv.h diff -u ircd-ircdev/include/s_serv.h:1.2 ircd-ircdev/include/s_serv.h:1.3 --- ircd-ircdev/include/s_serv.h:1.2 Sun Feb 22 08:13:21 2004 +++ ircd-ircdev/include/s_serv.h Fri Apr 23 04:08:08 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: s_serv.h,v 1.2 2004/02/22 16:13:21 zolty Exp $ + * $Id: s_serv.h,v 1.3 2004/04/23 11:08:08 zolty Exp $ * */ #ifndef INCLUDED_s_serv_h @@ -34,6 +34,9 @@ extern unsigned int max_connection_count; extern unsigned int max_client_count; +extern unsigned int max_global_count; +extern time_t max_client_count_TS; +extern time_t max_global_count_TS; /* * Prototypes Index: ircd-ircdev/ircd/Makefile.in diff -u ircd-ircdev/ircd/Makefile.in:1.8 ircd-ircdev/ircd/Makefile.in:1.9 --- ircd-ircdev/ircd/Makefile.in:1.8 Sun Feb 22 08:11:42 2004 +++ ircd-ircdev/ircd/Makefile.in Fri Apr 23 04:08:08 2004 @@ -18,7 +18,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA -# $Id: Makefile.in,v 1.8 2004/02/22 16:11:42 zolty Exp $ +# $Id: Makefile.in,v 1.9 2004/04/23 11:08:08 zolty Exp $ #### Start of system configuration section. #### @@ -177,6 +177,7 @@ m_trace.c \ m_uping.c \ m_user.c \ + m_users.c \ m_userhost.c \ m_userip.c \ m_version.c \ Index: ircd-ircdev/ircd/channel.c diff -u ircd-ircdev/ircd/channel.c:1.5 ircd-ircdev/ircd/channel.c:1.6 --- ircd-ircdev/ircd/channel.c:1.5 Sun Feb 22 08:11:42 2004 +++ ircd-ircdev/ircd/channel.c Fri Apr 23 04:08:08 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: channel.c,v 1.5 2004/02/22 16:11:42 zolty Exp $ + * $Id: channel.c,v 1.6 2004/04/23 11:08:08 zolty Exp $ * */ #include "config.h" @@ -454,9 +454,11 @@ struct Membership* member) { struct SLink* tmp; +#if defined(UNDERNET) char tmphost[HOSTLEN + 1]; - char nu_host[NUH_BUFSIZE]; char nu_realhost[NUH_BUFSIZE]; +#endif + char nu_host[NUH_BUFSIZE]; char nu_ip[NUI_BUFSIZE]; char* s; char* sr = NULL; Index: ircd-ircdev/ircd/engine_epoll.c diff -u ircd-ircdev/ircd/engine_epoll.c:1.2 ircd-ircdev/ircd/engine_epoll.c:1.3 --- ircd-ircdev/ircd/engine_epoll.c:1.2 Sun Feb 22 08:11:42 2004 +++ ircd-ircdev/ircd/engine_epoll.c Fri Apr 23 04:08:08 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: engine_epoll.c,v 1.2 2004/02/22 16:11:42 zolty Exp $ + * $Id: engine_epoll.c,v 1.3 2004/04/23 11:08:08 zolty Exp $ * */ #include "config.h" @@ -43,7 +43,7 @@ /* The GNU C library may have a valid header but stub implementations * of the epoll system calls. If so, provide our own. */ -#if defined(__stub_epoll_create) || defined(__stub___epoll_create) +#if defined(__stub_epoll_create) || defined(__stub___epoll_create) || defined(EPOLL_NEED_BODY) /* Oh, did we mention that some glibc releases do not even define the * syscall numbers? */ Index: ircd-ircdev/ircd/gline.c diff -u ircd-ircdev/ircd/gline.c:1.4 ircd-ircdev/ircd/gline.c:1.5 --- ircd-ircdev/ircd/gline.c:1.4 Sun Feb 22 08:11:42 2004 +++ ircd-ircdev/ircd/gline.c Fri Apr 23 04:08:08 2004 @@ -20,7 +20,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: gline.c,v 1.4 2004/02/22 16:11:42 zolty Exp $ + * $Id: gline.c,v 1.5 2004/04/23 11:08:08 zolty Exp $ * */ #include "config.h" @@ -815,7 +815,8 @@ if (gline->gl_expire <= CurrentTime) gline_free(gline); - send_reply(sptr, RPL_STATSGLINE, 'G', gline->gl_user, gline->gl_host, + else + send_reply(sptr, RPL_STATSGLINE, 'G', gline->gl_user, gline->gl_host, gline->gl_host ? "@" : "", gline->gl_host ? gline->gl_host : "", gline->gl_expire + TSoffset, gline->gl_reason); Index: ircd-ircdev/ircd/ircd.c diff -u ircd-ircdev/ircd/ircd.c:1.5 ircd-ircdev/ircd/ircd.c:1.6 --- ircd-ircdev/ircd/ircd.c:1.5 Sun Feb 22 08:11:42 2004 +++ ircd-ircdev/ircd/ircd.c Fri Apr 23 04:08:08 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: ircd.c,v 1.5 2004/02/22 16:11:42 zolty Exp $ + * $Id: ircd.c,v 1.6 2004/04/23 11:08:08 zolty Exp $ * */ #include "config.h" @@ -254,7 +254,7 @@ for (aconf = GlobalConfList; aconf; aconf = aconf->next) { /* Also when already connecting! (update holdtimes) --SRB */ if (!(aconf->status & CONF_SERVER) || aconf->port == 0 || aconf->hold == 0) -// FIXME if (!(aconf->status & CONF_SERVER) || aconf->port == 0) +/* FIXME if (!(aconf->status & CONF_SERVER) || aconf->port == 0) */ continue; /* Also skip juped servers */ @@ -639,10 +639,6 @@ setup_signals(); feature_init(); /* initialize features... */ log_init(*argv); - if (check_pid()) { - Debug((DEBUG_FATAL, "Failed to acquire PID file lock after fork")); - exit(2); - } set_nomem_handler(outofmemory); if (!init_string()) { @@ -668,6 +664,11 @@ return 7; } + if (check_pid()) { + Debug((DEBUG_FATAL, "Failed to acquire PID file lock after fork")); + exit(2); + } + init_server_identity(); uping_init(); Index: ircd-ircdev/ircd/ircd_parser.y diff -u ircd-ircdev/ircd/ircd_parser.y:1.4 ircd-ircdev/ircd/ircd_parser.y:1.5 --- ircd-ircdev/ircd/ircd_parser.y:1.4 Sun Feb 22 08:11:42 2004 +++ ircd-ircdev/ircd/ircd_parser.y Fri Apr 23 04:08:08 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: ircd_parser.y,v 1.4 2004/02/22 16:11:42 zolty Exp $ + * $Id: ircd_parser.y,v 1.5 2004/04/23 11:08:08 zolty Exp $ * */ %{ @@ -153,42 +153,17 @@ %token FEATURES %token QUARANTINE /* and now a lot of priviledges... */ -%token TPRIV_CHAN_LIMIT -%token TPRIV_MODE_LCHAN -%token TPRIV_DEOP_LCHAN -%token TPRIV_WALK_LCHAN -%token TPRIV_KILL -%token TPRIV_LOCAL_KILL -%token TPRIV_REHASH -%token TPRIV_RESTART -%token TPRIV_DIE -%token TPRIV_GLINE -%token TPRIV_LOCAL_GLINE -%token TPRIV_JUPE -%token TPRIV_LOCAL_JUPE -%token TPRIV_LOCAL_OPMODE -%token TPRIV_OPMODE -%token TPRIV_SET -%token TPRIV_WHOX -%token TPRIV_BADCHAN +%token TPRIV_CHAN_LIMIT TPRIV_MODE_LCHAN TPRIV_DEOP_LCHAN TPRIV_WALK_LCHAN +%token TPRIV_KILL TPRIV_LOCAL_KILL TPRIV_REHASH TPRIV_RESTART TPRIV_DIE +%token TPRIV_GLINE TPRIV_LOCAL_GLINE TPRIV_JUPE TPRIV_LOCAL_JUPE +%token TPRIV_LOCAL_OPMODE TPRIV_OPMODE TPRIV_SET TPRIV_WHOX TPRIV_BADCHAN %token TPRIV_LOCAL_BADCHAN -%token TPRIV_SEE_CHAN -%token TPRIV_SHOW_INVIS -%token TPRIV_SHOW_ALL_INVIS -%token TPRIV_PROPAGATE -%token TPRIV_UNLIMIT_QUERY -%token TPRIV_DISPLAY -%token TPRIV_SEE_OPERS -%token TPRIV_WIDE_GLINE +%token TPRIV_SEE_CHAN TPRIV_SHOW_INVIS TPRIV_SHOW_ALL_INVIS TPRIV_PROPAGATE +%token TPRIV_UNLIMIT_QUERY TPRIV_DISPLAY TPRIV_SEE_OPERS TPRIV_WIDE_GLINE /* and some types... */ %type <num> sizespec -%type <num> timespec -%type <num> timefactor -%type <num> factoredtimes -%type <num> factoredtime -%type <num> expr -%type <num> yesorno -%type <num> privtype +%type <num> timespec timefactor factoredtimes factoredtime +%type <num> expr yesorno privtype %left '+' '-' %left '*' '/' @@ -228,28 +203,22 @@ | DECADES { $$ = 60 * 60 * 24 * 365 * 10; }; -sizespec: expr - { +sizespec: expr { $$ = $1; } - | expr BYTES - { + | expr BYTES { $$ = $1; } - | expr KBYTES - { + | expr KBYTES { $$ = $1 * 1024; } - | expr MBYTES - { + | expr MBYTES { $$ = $1 * 1024 * 1024; } - | expr GBYTES - { + | expr GBYTES { $$ = $1 * 1024 * 1024 * 1024; } - | expr TBYTES - { + | expr TBYTES { $$ = $1 * 1024 * 1024 * 1024; } ; @@ -259,29 +228,24 @@ { $$ = $1; } - | expr '+' expr - { + | expr '+' expr { $$ = $1 + $3; } - | expr '-' expr - { + | expr '-' expr { $$ = $1 - $3; } - | expr '*' expr - { + | expr '*' expr { $$ = $1 * $3; } - | expr '/' expr - { + | expr '/' expr { $$ = $1 / $3; } /* leave this out until we find why it makes BSD yacc dump core -larne | '-' expr %prec NEG - { + = { $$ = -$2; } */ - | '(' expr ')' - { + | '(' expr ')' { $$ = $2; } ; Index: ircd-ircdev/ircd/m_invite.c diff -u ircd-ircdev/ircd/m_invite.c:1.2 ircd-ircdev/ircd/m_invite.c:1.3 --- ircd-ircdev/ircd/m_invite.c:1.2 Thu Apr 22 10:37:18 2004 +++ ircd-ircdev/ircd/m_invite.c Fri Apr 23 04:08:08 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_invite.c,v 1.2 2004/04/22 17:37:18 zolty Exp $ + * $Id: m_invite.c,v 1.3 2004/04/23 11:08:08 zolty Exp $ * */ @@ -145,24 +145,7 @@ return 0; if (!(chptr = FindChannel(parv[2]))) { - if (IsLocalChannel(parv[2])) { - send_reply(sptr, ERR_NOTONCHANNEL, parv[2]); - return 0; - } - - /* Do not disallow to invite to non-existant #channels, otherwise they - would simply first be created, causing only MORE bandwidth usage. */ - - if (check_target_limit(sptr, acptr, cli_name(acptr), 0)) - return 0; - - send_reply(sptr, RPL_INVITING, cli_name(acptr), parv[2]); - - if (cli_user(acptr)->away) - send_reply(sptr, RPL_AWAY, cli_name(acptr), cli_user(acptr)->away); - - sendcmdto_one(sptr, CMD_INVITE, acptr, "%s :%s", cli_name(acptr), parv[2]); - + send_reply(sptr, ERR_NOTONCHANNEL, parv[2]); return 0; } Index: ircd-ircdev/ircd/m_join.c diff -u ircd-ircdev/ircd/m_join.c:1.4 ircd-ircdev/ircd/m_join.c:1.5 --- ircd-ircdev/ircd/m_join.c:1.4 Thu Apr 22 10:37:18 2004 +++ ircd-ircdev/ircd/m_join.c Fri Apr 23 04:08:08 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_join.c,v 1.4 2004/04/22 17:37:18 zolty Exp $ + * $Id: m_join.c,v 1.5 2004/04/23 11:08:08 zolty Exp $ * */ @@ -166,7 +166,9 @@ struct Channel *chptr; struct JoinBuf join; struct JoinBuf create; +#if defined(UNDERNET) struct ModeBuf mbuf; +#endif struct Gline *gline; unsigned int flags = 0; int i, j, k = 0; Index: ircd-ircdev/ircd/m_lusers.c diff -u ircd-ircdev/ircd/m_lusers.c:1.2 ircd-ircdev/ircd/m_lusers.c:1.3 --- ircd-ircdev/ircd/m_lusers.c:1.2 Thu Apr 22 10:37:18 2004 +++ ircd-ircdev/ircd/m_lusers.c Fri Apr 23 04:08:08 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_lusers.c,v 1.2 2004/04/22 17:37:18 zolty Exp $ + * $Id: m_lusers.c,v 1.3 2004/04/23 11:08:08 zolty Exp $ */ /* @@ -80,6 +80,7 @@ #include "config.h" #include "client.h" +#include "handlers.h" #include "ircd.h" #include "ircd_features.h" #include "ircd_reply.h" @@ -88,8 +89,9 @@ #include "numeric.h" #include "numnicks.h" #include "querycmds.h" -#include "s_user.h" +#include "s_misc.h" #include "s_serv.h" +#include "s_user.h" #include "send.h" #include <assert.h> @@ -120,9 +122,15 @@ send_reply(sptr, RPL_LUSERME, UserStats.local_clients, UserStats.local_servers); + m_users(cptr, sptr, parc, parv); + +/* sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :Highest connection count: " "%d (%d clients)", sptr, max_connection_count, max_client_count); +*/ + send_reply(sptr, RPL_STATSCONN, max_connection_count, max_client_count, + ServerStats->is_cl); return 0; } @@ -153,9 +161,16 @@ send_reply(sptr, RPL_LUSERME, UserStats.local_clients, UserStats.local_servers); + m_users(cptr, sptr, parc, parv); + +/* sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :Highest connection count: " "%d (%d clients)", sptr, max_connection_count, max_client_count); +*/ + + send_reply(sptr, RPL_STATSCONN, max_connection_count, max_client_count, + ServerStats->is_cl); return 0; } Index: ircd-ircdev/ircd/m_names.c diff -u ircd-ircdev/ircd/m_names.c:1.3 ircd-ircdev/ircd/m_names.c:1.4 --- ircd-ircdev/ircd/m_names.c:1.3 Thu Apr 22 10:37:18 2004 +++ ircd-ircdev/ircd/m_names.c Fri Apr 23 04:08:08 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_names.c,v 1.3 2004/04/22 17:37:18 zolty Exp $ + * $Id: m_names.c,v 1.4 2004/04/23 11:08:08 zolty Exp $ * */ @@ -164,15 +164,18 @@ strcat(buf, "!"); idx++; } - else if (IsChanOp(member)) + else { - strcat(buf, "@"); - idx++; - } - else if (HasVoice(member)) - { - strcat(buf, "+"); - idx++; + if (IsChanOp(member)) + { + strcat(buf, "@"); + idx++; + } + if (HasVoice(member)) + { + strcat(buf, "+"); + idx++; + } } strcat(buf, cli_name(c2ptr)); idx += strlen(cli_name(c2ptr)); Index: ircd-ircdev/ircd/m_users.c diff -u /dev/null ircd-ircdev/ircd/m_users.c:1.1 --- /dev/null Fri Apr 23 04:08:34 2004 +++ ircd-ircdev/ircd/m_users.c Fri Apr 23 04:08:09 2004 @@ -0,0 +1,136 @@ +/* + * IRC-Dev IRCD - An advanced and innovative IRC Daemon, ircd/m_users.c + * + * Copyright (C) 2002-2004 IRC-Dev Development Team <de...@ir...> + * Copyright (C) 2004 Toni Garcia (zoltan) <zo...@ir...> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * $Id: m_users.c,v 1.1 2004/04/23 11:08:09 zolty Exp $ + */ + +/* + * m_functions execute protocol messages on this server: + * + * cptr is always NON-NULL, pointing to a *LOCAL* client + * structure (with an open socket connected!). This + * identifies the physical socket where the message + * originated (or which caused the m_function to be + * executed--some m_functions may call others...). + * + * sptr is the source of the message, defined by the + * prefix part of the message if present. If not + * or prefix not found, then sptr==cptr. + * + * (!IsServer(cptr)) => (cptr == sptr), because + * prefixes are taken *only* from servers... + * + * (IsServer(cptr)) + * (sptr == cptr) => the message didn't + * have the prefix. + * + * (sptr != cptr && IsServer(sptr) means + * the prefix specified servername. (?) + * + * (sptr != cptr && !IsServer(sptr) means + * that message originated from a remote + * user (not local). + * + * combining + * + * (!IsServer(sptr)) means that, sptr can safely + * taken as defining the target structure of the + * message in this server. + * + * *Always* true (if 'parse' and others are working correct): + * + * 1) sptr->from == cptr (note: cptr->from == cptr) + * + * 2) MyConnect(sptr) <=> sptr == cptr (e.g. sptr + * *cannot* be a local connection, unless it's + * actually cptr!). [MyConnect(x) should probably + * be defined as (x == x->from) --msa ] + * + * parc number of variable parameter strings (if zero, + * parv is allowed to be NULL) + * + * parv a NULL terminated list of parameter pointers, + * + * parv[0], sender (prefix string), if not present + * this points to an empty string. + * parv[1]...parv[parc-1] + * pointers to additional parameters + * parv[parc] == NULL, *always* + * + * note: it is guaranteed that parv[0]..parv[parc-1] are all + * non-NULL pointers. + */ +#include "config.h" + +#include "client.h" +#include "ircd_features.h" +#include "ircd_reply.h" +#include "msg.h" +#include "numeric.h" +#include "querycmds.h" +#include "s_misc.h" +#include "s_user.h" +#include "s_serv.h" + +#include <assert.h> + +/* + * m_users - generic message handler + * + * parv[0] = sender + * parv[1] = ignored + * parv[2] = server to query + */ +int m_users(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) +{ + if (parc > 2) + if (hunt_server_cmd(sptr, CMD_USERS, cptr, feature_int(FEAT_HIS_REMOTE), + "%s :%C", 2, parc, parv) != HUNTED_ISME) + return 0; + + send_reply(sptr, RPL_CURRENT_LOCAL, UserStats.local_clients, max_client_count, + date(max_client_count_TS)); + send_reply(sptr, RPL_CURRENT_GLOBAL, UserStats.clients, max_global_count, + date(max_global_count_TS)); + + return 0; +} + +/* + * ms_users - server message handler + * + * parv[0] = sender + * parv[1] = ignored + * parv[2] = server to query + */ +int ms_users(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) +{ + if (parc > 2) + if (hunt_server_cmd(sptr, CMD_USERS, cptr, 0, "%s :%C", 2, parc, parv) != + HUNTED_ISME) + return 0; + + send_reply(sptr, RPL_CURRENT_LOCAL, UserStats.local_clients, max_client_count, + date(max_client_count_TS)); + send_reply(sptr, RPL_CURRENT_GLOBAL, UserStats.clients, max_global_count, + date(max_global_count_TS)); + + return 0; +} Index: ircd-ircdev/ircd/m_watch.c diff -u ircd-ircdev/ircd/m_watch.c:1.2 ircd-ircdev/ircd/m_watch.c:1.3 --- ircd-ircdev/ircd/m_watch.c:1.2 Thu Apr 22 10:37:18 2004 +++ ircd-ircdev/ircd/m_watch.c Fri Apr 23 04:08:09 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_watch.c,v 1.2 2004/04/22 17:37:18 zolty Exp $ + * $Id: m_watch.c,v 1.3 2004/04/23 11:08:09 zolty Exp $ * */ @@ -84,6 +84,7 @@ #include "hash.h" #include "ircd.h" #include "ircd_features.h" +#include "ircd_reply.h" #include "ircd_string.h" #include "list.h" #include "numeric.h" Index: ircd-ircdev/ircd/m_whois.c diff -u ircd-ircdev/ircd/m_whois.c:1.5 ircd-ircdev/ircd/m_whois.c:1.6 --- ircd-ircdev/ircd/m_whois.c:1.5 Thu Apr 22 10:37:18 2004 +++ ircd-ircdev/ircd/m_whois.c Fri Apr 23 04:08:09 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: m_whois.c,v 1.5 2004/04/22 17:37:18 zolty Exp $ + * $Id: m_whois.c,v 1.6 2004/04/23 11:08:09 zolty Exp $ */ /* @@ -151,7 +151,7 @@ chptr = chan->channel; if (!(IsOper(sptr) && IsLocalChannel(chptr->chname)) - && ShowChannel(sptr, chptr)) + && !ShowChannel(sptr, chptr)) continue; if (acptr != sptr && IsZombie(chan)) @@ -168,14 +168,12 @@ if (IsOper(sptr) && !ShowChannel(sptr,chptr)) *(buf + len++) = '*'; if (IsZombie(chan)) - { *(buf + len++) = '!'; - } else { if (IsChanOp(chan)) *(buf + len++) = '@'; - else if (HasVoice(chan)) + if (HasVoice(chan)) *(buf + len++) = '+'; } if (len) Index: ircd-ircdev/ircd/parse.c diff -u ircd-ircdev/ircd/parse.c:1.4 ircd-ircdev/ircd/parse.c:1.5 --- ircd-ircdev/ircd/parse.c:1.4 Sun Feb 22 08:11:42 2004 +++ ircd-ircdev/ircd/parse.c Fri Apr 23 04:08:09 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: parse.c,v 1.4 2004/02/22 16:11:42 zolty Exp $ + * $Id: parse.c,v 1.5 2004/04/23 11:08:09 zolty Exp $ * */ #include "config.h" @@ -340,6 +340,13 @@ { m_unregistered, m_lusers, ms_lusers, m_lusers, m_ignore } }, { + MSG_USERS, + TOK_USERS, + 0, MAXPARA, MFLG_SLOW, 0, + /* UNREG, CLIENT, SERVER, OPER, SERVICE */ + { m_unregistered, m_users, ms_users, m_users, m_ignore } + }, + { MSG_TIME, TOK_TIME, 0, MAXPARA, MFLG_SLOW, 0, Index: ircd-ircdev/ircd/s_err.c diff -u ircd-ircdev/ircd/s_err.c:1.5 ircd-ircdev/ircd/s_err.c:1.6 --- ircd-ircdev/ircd/s_err.c:1.5 Sun Feb 22 08:11:42 2004 +++ ircd-ircdev/ircd/s_err.c Fri Apr 23 04:08:09 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: s_err.c,v 1.5 2004/02/22 16:11:42 zolty Exp $ + * $Id: s_err.c,v 1.6 2004/04/23 11:08:09 zolty Exp $ * */ #include "config.h" @@ -539,7 +539,7 @@ /* 249 */ { RPL_STATSDEBUG, 0, "249" }, /* 250 */ - { RPL_STATSCONN, ":Highest connection count: %d (%d clients)", "250" }, + { RPL_STATSCONN, ":Highest connection count: %d (%d clients) (%d connections received)", "250" }, /* 251 */ { RPL_LUSERCLIENT, ":There are %d users and %d invisible on %d servers", "251" }, /* 252 */ @@ -569,9 +569,9 @@ /* 264 */ { 0 }, /* 265 */ - { 0 }, + { RPL_CURRENT_LOCAL, ":Current local users: %d Max: %d (%s)", "265" }, /* 266 */ - { 0 }, + { RPL_CURRENT_GLOBAL, ":Current global users: %d Max: %d (%s)", "266" }, /* 267 */ { 0 }, /* 268 */ Index: ircd-ircdev/ircd/s_serv.c diff -u ircd-ircdev/ircd/s_serv.c:1.3 ircd-ircdev/ircd/s_serv.c:1.4 --- ircd-ircdev/ircd/s_serv.c:1.3 Sun Feb 22 08:11:43 2004 +++ ircd-ircdev/ircd/s_serv.c Fri Apr 23 04:08:09 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: s_serv.c,v 1.3 2004/02/22 16:11:43 zolty Exp $ + * $Id: s_serv.c,v 1.4 2004/04/23 11:08:09 zolty Exp $ * */ #include "config.h" @@ -60,6 +60,9 @@ unsigned int max_connection_count = 0; unsigned int max_client_count = 0; +unsigned int max_global_count = 0; +time_t max_client_count_TS = 0; +time_t max_global_count_TS = 0; int exit_new_server(struct Client *cptr, struct Client *sptr, const char *host, time_t timestamp, const char *pattern, ...) Index: ircd-ircdev/ircd/watch.c diff -u ircd-ircdev/ircd/watch.c:1.2 ircd-ircdev/ircd/watch.c:1.3 --- ircd-ircdev/ircd/watch.c:1.2 Sun Feb 22 08:11:43 2004 +++ ircd-ircdev/ircd/watch.c Fri Apr 23 04:08:09 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: watch.c,v 1.2 2004/02/22 16:11:43 zolty Exp $ + * $Id: watch.c,v 1.3 2004/04/23 11:08:09 zolty Exp $ * */ #include "config.h" @@ -28,6 +28,7 @@ #include "hash.h" #include "ircd.h" #include "ircd_alloc.h" +#include "ircd_reply.h" #include "ircd_string.h" #include "list.h" #include "numeric.h" @@ -84,7 +85,7 @@ hAddWatch(wptr); #ifdef DEBUGMODE -// watchs.inuse++; +/* watchs.inuse++; */ #endif return (wptr); @@ -104,7 +105,7 @@ MyFree(wptr); #ifdef DEBUGMODE -// watchs.inuse--; +/* watchs.inuse--; */ #endif } Index: ircd-ircdev/ircd/whocmds.c diff -u ircd-ircdev/ircd/whocmds.c:1.3 ircd-ircdev/ircd/whocmds.c:1.4 --- ircd-ircdev/ircd/whocmds.c:1.3 Sun Feb 22 08:11:43 2004 +++ ircd-ircdev/ircd/whocmds.c Fri Apr 23 04:08:09 2004 @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: whocmds.c,v 1.3 2004/02/22 16:11:43 zolty Exp $ + * $Id: whocmds.c,v 1.4 2004/04/23 11:08:09 zolty Exp $ * */ #include "config.h" @@ -173,12 +173,15 @@ *(p1++) = '!'; } else { - if (chptr && is_chan_op(acptr, chptr)) - *(p1++) = '@'; - else if (chptr && has_voice(acptr, chptr)) - *(p1++) = '+'; - else if (chptr && is_zombie(acptr, chptr)) + if (chptr && is_zombie(acptr, chptr)) *(p1++) = '!'; + else + { + if (chptr && is_chan_op(acptr, chptr)) + *(p1++) = '@'; + if (chptr && has_voice(acptr, chptr)) + *(p1++) = '+'; + } } if (IsDeaf(acptr)) *(p1++) = 'd'; ----------------------- End of diff ----------------------- |