/[svn]/ircd-hybrid-7.3/contrib/m_ctrace.c
ViewVC logotype

Diff of /ircd-hybrid-7.3/contrib/m_ctrace.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1143 by michael, Sun Jan 9 11:03:03 2011 UTC revision 1144 by michael, Tue Jul 26 19:33:54 2011 UTC
# Line 48  struct Message ctrace_msgtab = { Line 48  struct Message ctrace_msgtab = {
48  };  };
49    
50  const char *_version = "$Revision$";  const char *_version = "$Revision$";
 static struct Callback *ctrace_cb;  
   
 static void *  
 va_ctrace(va_list args)  
 {  
   struct Client *source_p = va_arg(args, struct Client *);  
   int parc = va_arg(args, int);  
   char **parv = va_arg(args, char **);  
   
   do_ctrace(source_p, parc, parv);  
   return NULL;  
 }  
51    
52  void  void
53  _modinit(void)  _modinit(void)
54  {  {
   ctrace_cb = register_callback("doing_ctrace", va_ctrace);  
55    mod_add_cmd(&ctrace_msgtab);    mod_add_cmd(&ctrace_msgtab);
56  }  }
57    
# Line 72  void Line 59  void
59  _moddeinit(void)  _moddeinit(void)
60  {  {
61    mod_del_cmd(&ctrace_msgtab);    mod_del_cmd(&ctrace_msgtab);
   uninstall_hook(ctrace_cb, va_ctrace);  
62  }  }
63    
64  static void report_this_status(struct Client *, struct Client *);  static void report_this_status(struct Client *, struct Client *);
# Line 93  mo_ctrace(struct Client *client_p, struc Line 79  mo_ctrace(struct Client *client_p, struc
79      return;      return;
80    }    }
81    
82    execute_callback(ctrace_cb, source_p, parc, parv);    do_ctrace(source_p, parc, parv);
83  }  }
84    
85  /*  /*
# Line 102  mo_ctrace(struct Client *client_p, struc Line 88  mo_ctrace(struct Client *client_p, struc
88  static void  static void
89  do_ctrace(struct Client *source_p, int parc, char *parv[])  do_ctrace(struct Client *source_p, int parc, char *parv[])
90  {  {
   struct Client *target_p = NULL;  
91    char *class_looking_for;    char *class_looking_for;
92    const char *class_name;    const char *class_name = parv[1];
93    dlink_node *ptr;    dlink_node *ptr;
94    
95    class_looking_for = parv[1];    sendto_realops_flags(UMODE_SPY, L_ALL,
96                           "CTRACE requested by %s (%s@%s) [%s]",
97                           source_p->name, source_p->username,
98                           source_p->host, source_p->servptr->name);
99    
100    /* report all direct connections */    /* report all direct connections */
   
101    DLINK_FOREACH(ptr, local_client_list.head)    DLINK_FOREACH(ptr, local_client_list.head)
102    {    {
103      target_p = ptr->data;      struct Client *target_p = ptr->data;
104    
105      class_name = get_client_class(target_p);      class_name = get_client_class(target_p);
106      if ((class_name != NULL) && match(class_looking_for, class_name))      if ((class_name != NULL) && match(class_looking_for, class_name))

Legend:
Removed from v.1143  
changed lines
  Added in v.1144

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.26