]> jfr.im git - solanum.git/blobdiff - ircd/parse.c
modules: add origin field to V2
[solanum.git] / ircd / parse.c
index 484ae842d646c42227acddd4a7d2b8a22dbbd1e5..61d7a485073a30721dd10ee056604e79e7b62c8e 100644 (file)
@@ -21,8 +21,6 @@
  *  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 3177 2007-02-01 00:19:14Z jilles $
  */
 
 #include "stdinc.h"
@@ -44,7 +42,7 @@
 #include "packet.h"
 #include "s_assert.h"
 
-static struct Dictionary *cmd_dict = NULL;
+struct Dictionary *cmd_dict = NULL;
 struct Dictionary *alias_dict = NULL;
 
 /* parv[0] is not used, and parv[LAST] == NULL */
@@ -138,14 +136,14 @@ parse(struct Client *client_p, char *pbuffer, char *bufend)
        }
        else
        {
-               mptr = irc_dictionary_retrieve(cmd_dict, msgbuf.cmd);
+               mptr = rb_dictionary_retrieve(cmd_dict, msgbuf.cmd);
 
                /* no command or its encap only, error */
                if(!mptr || !mptr->cmd)
                {
                        if (IsPerson(client_p))
                        {
-                               struct alias_entry *aptr = irc_dictionary_retrieve(alias_dict, msgbuf.cmd);
+                               struct alias_entry *aptr = rb_dictionary_retrieve(alias_dict, msgbuf.cmd);
                                if (aptr != NULL)
                                {
                                        do_alias(aptr, client_p, reconstruct_parv(msgbuf.n_para - 1, msgbuf.para + 1));
@@ -221,19 +219,6 @@ handle_command(struct Message *mptr, struct MsgBuf *msgbuf_p, struct Client *cli
 
        mptr->count++;
 
-       /* New patch to avoid server flooding from unregistered connects
-          - Pie-Man 07/27/2000 */
-
-       if(!IsRegistered(client_p))
-       {
-               /* if its from a possible server connection
-                * ignore it.. more than likely its a header thats sneaked through
-                */
-
-               if(IsAnyServer(client_p) && !(mptr->flags & MFLG_UNREG))
-                       return (1);
-       }
-
        ehandler = mptr->handlers[from->handler];
        handler = ehandler.handler;
 
@@ -279,7 +264,7 @@ handle_encap(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *so
        struct MessageEntry ehandler;
        MessageHandler handler = 0;
 
-       mptr = irc_dictionary_retrieve(cmd_dict, command);
+       mptr = rb_dictionary_retrieve(cmd_dict, command);
 
        if(mptr == NULL || mptr->cmd == NULL)
                return;
@@ -301,12 +286,11 @@ handle_encap(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *so
  * output       - NONE
  * side effects - MUST MUST be called at startup ONCE before
  *                any other keyword hash routine is used.
- *
  */
 void
 clear_hash_parse()
 {
-       cmd_dict = irc_dictionary_create("command", strcasecmp);
+       cmd_dict = rb_dictionary_create("command", strcasecmp);
 }
 
 /* mod_add_cmd
@@ -325,14 +309,14 @@ mod_add_cmd(struct Message *msg)
        if(msg == NULL)
                return;
 
-       if (irc_dictionary_find(cmd_dict, msg->cmd) != NULL)
+       if (rb_dictionary_find(cmd_dict, msg->cmd) != NULL)
                return;
 
        msg->count = 0;
        msg->rcount = 0;
        msg->bytes = 0;
 
-       irc_dictionary_add(cmd_dict, msg->cmd, msg);
+       rb_dictionary_add(cmd_dict, msg->cmd, msg);
 }
 
 /* mod_del_cmd
@@ -348,39 +332,7 @@ mod_del_cmd(struct Message *msg)
        if(msg == NULL)
                return;
 
-       irc_dictionary_delete(cmd_dict, msg->cmd);
-}
-
-/*
- * report_messages
- *
- * inputs      - pointer to client to report to
- * output      - NONE
- * side effects        - NONE
- */
-void
-report_messages(struct Client *source_p)
-{
-       struct DictionaryIter iter;
-       struct Message *msg;
-       struct alias_entry *amsg;
-
-       DICTIONARY_FOREACH(msg, &iter, cmd_dict)
-       {
-               s_assert(msg->cmd != NULL);
-               sendto_one_numeric(source_p, RPL_STATSCOMMANDS,
-                                  form_str(RPL_STATSCOMMANDS),
-                                  msg->cmd, msg->count,
-                                  msg->bytes, msg->rcount);
-       }
-
-       DICTIONARY_FOREACH(amsg, &iter, alias_dict)
-       {
-               s_assert(amsg->name != NULL);
-               sendto_one_numeric(source_p, RPL_STATSCOMMANDS,
-                                  form_str(RPL_STATSCOMMANDS),
-                                  amsg->name, amsg->hits, 0L, 0);
-       }
+       rb_dictionary_delete(cmd_dict, msg->cmd);
 }
 
 /* cancel_clients()