* 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_trace.c 3183 2007-02-01 01:07:42Z jilles $
*/
#include "stdinc.h"
#include "parse.h"
#include "modules.h"
-static int m_trace(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static const char trace_desc[] =
+ "Provides the TRACE command to trace the route to a client or server";
+
+static void m_trace(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
static void trace_spy(struct Client *, struct Client *);
{ "doing_trace", &doing_trace_hook },
{ NULL, NULL }
};
-DECLARE_MODULE_AV1(trace, NULL, NULL, trace_clist, trace_hlist, NULL, "$Revision: 3183 $");
+DECLARE_MODULE_AV2(trace, NULL, NULL, trace_clist, trace_hlist, NULL, NULL, NULL, trace_desc);
static void count_downlinks(struct Client *server_p, int *pservcount, int *pusercount);
static int report_this_status(struct Client *source_p, struct Client *target_p);
* m_trace
* parv[1] = servername
*/
-static int
+static void
m_trace(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
struct Client *target_p = NULL;
struct Class *cltmp;
const char *tname;
- int doall = 0;
- int cnt = 0, wilds, dow;
+ bool doall = false, wilds, dow;
+ int cnt = 0;
rb_dlink_node *ptr;
if(parc > 1)
{
if(hunt_server(client_p, source_p, ":%s TRACE %s :%s", 2, parc, parv) !=
HUNTED_ISME)
- return 0;
+ return;
}
}
else
ac2ptr ? ac2ptr->name : tname,
ac2ptr ? ac2ptr->from->name : "EEK!");
- return 0;
+ return;
}
case HUNTED_ISME:
break;
default:
- return 0;
+ return;
}
}
if(match(tname, me.name))
{
- doall = 1;
+ doall = true;
}
/* if theyre tracing our SID, we need to move tname to our name so
* we dont give the sid in ENDOFTRACE
*/
else if(!MyClient(source_p) && !strcmp(tname, me.id))
{
- doall = 1;
+ doall = true;
tname = me.name;
}
dow = wilds || doall;
/* specific trace */
- if(dow == 0)
+ if(!dow)
{
if(MyClient(source_p) || parc > 2)
target_p = find_named_person(tname);
sendto_one_numeric(source_p, RPL_ENDOFTRACE,
form_str(RPL_ENDOFTRACE), tname);
- return 0;
+ return;
}
trace_spy(source_p, NULL);
sendto_one_numeric(source_p, RPL_ENDOFTRACE,
form_str(RPL_ENDOFTRACE), tname);
- return 0;
+ return;
}
/* source_p is opered */
*/
sendto_one_numeric(source_p, RPL_ENDOFTRACE,
form_str(RPL_ENDOFTRACE), tname);
- return 0;
+ return;
}
if(doall)
}
sendto_one_numeric(source_p, RPL_ENDOFTRACE, form_str(RPL_ENDOFTRACE), tname);
-
- return 0;
}
/*