Changeset 8135eaee0b0d6dfb4595c77c878f2a998a7303e1

Show
Ignore:
Timestamp:
12/03/09 14:00:47 (4 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1259848847 +0000
git-parent:

[602270e2de465d232fd9d53d4c4354fa733294b1]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1259848847 +0000
Message:

add more names fpr callbacks for introspection, refs #221

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/eventer/eventer_impl.c

    r31d42e5 r8135eae  
    130130    } 
    131131  } 
     132  eventer_name_callback("eventer_jobq_execute_timeout", 
     133                        eventer_jobq_execute_timeout); 
     134  eventer_name_callback("eventer_jobq_consume_available", 
     135                        eventer_jobq_consume_available); 
     136 
    132137  eventer_impl_epoch = malloc(sizeof(struct timeval)); 
    133138  gettimeofday(eventer_impl_epoch, NULL); 
  • src/modules/lua.c

    rcec1cb6 r8135eae  
    831831  if(!nlerr) nlerr = noit_stderr; 
    832832  if(!nldeb) nldeb = noit_debug; 
     833  eventer_name_callback("lua/check_timeout", noit_lua_check_timeout); 
    833834  return 0; 
    834835} 
  • src/modules/ping_icmp.c

    rfd01712 r8135eae  
    582582  eventer_name_callback("ping_icmp/timeout", ping_icmp_timeout); 
    583583  eventer_name_callback("ping_icmp/handler", ping_icmp_handler); 
     584  eventer_name_callback("ping_icmp/send", ping_icmp_real_send); 
    584585  return 0; 
    585586} 
  • src/noit_check_tools.c

    rd38990d r8135eae  
    5555  start = strstr(replacement, "::"); 
    5656  return interpolate_oper_copy(buff, len, start ? (start + 2) : replacement); 
    57 } 
    58  
    59 void 
    60 noit_check_tools_init() { 
    61   noit_check_interpolate_register_oper_fn("copy", interpolate_oper_copy); 
    62   noit_check_interpolate_register_oper_fn("ccns", interpolate_oper_ccns); 
    6357} 
    6458 
     
    261255  return strlen(xpath); 
    262256} 
     257 
     258void 
     259noit_check_tools_init() { 
     260  noit_check_interpolate_register_oper_fn("copy", interpolate_oper_copy); 
     261  noit_check_interpolate_register_oper_fn("ccns", interpolate_oper_ccns); 
     262  eventer_name_callback("noit_check_recur_handler", noit_check_recur_handler); 
     263} 
     264 
  • src/noit_console_state.c

    r31d42e5 r8135eae  
    8181} 
    8282static int 
    83 noit_console_eventer(noit_console_closure_t ncct, int argc, char **argv, 
    84                      noit_console_state_t *dstate, void *unused) { 
    85   if(argc < 2 || strcmp(argv[0], "debug")) { 
    86     nc_printf(ncct, "eventer <debug> ...\n"); 
    87     return -1; 
    88   } 
    89   if(argc == 2) { 
    90     if(!strcmp(argv[1], "sockets")) { 
    91       eventer_foreach_fdevent(noit_console_spit_event, ncct); 
    92       return 0; 
    93     } 
    94     if(!strcmp(argv[1], "timers")) { 
    95       eventer_foreach_timedevent(noit_console_spit_event, ncct); 
    96       return 0; 
    97     } 
    98   } 
    99   nc_printf(ncct, "eventer command not understood\n"); 
    100   return -1; 
     83noit_console_eventer_timers(noit_console_closure_t ncct, int argc, char **argv, 
     84                            noit_console_state_t *dstate, void *unused) { 
     85  if(argc != 0) return -1; 
     86  eventer_foreach_timedevent(noit_console_spit_event, ncct); 
     87  return 0; 
     88
     89static int 
     90noit_console_eventer_sockets(noit_console_closure_t ncct, int argc, char **argv, 
     91                             noit_console_state_t *dstate, void *unused) { 
     92  if(argc != 0) return -1; 
     93  eventer_foreach_fdevent(noit_console_spit_event, ncct); 
     94  return 0; 
    10195} 
    10296 
     
    113107  "restart", noit_console_restart, NULL, NULL, NULL 
    114108}; 
    115 cmd_info_t console_command_eventer = { 
    116   "eventer", noit_console_eventer, NULL, NULL, NULL 
     109cmd_info_t console_command_eventer_timers = { 
     110  "timers", noit_console_eventer_timers, NULL, NULL, NULL 
     111}; 
     112cmd_info_t console_command_eventer_sockets = { 
     113  "sockets", noit_console_eventer_sockets, NULL, NULL, NULL 
    117114}; 
    118115 
     
    456453 
    457454noit_console_state_t * 
     455noit_console_mksubdelegate(noit_console_state_t *parent, const char *cmd) { 
     456  noit_console_state_t *child; 
     457  cmd_info_t *existing; 
     458  existing = noit_console_state_get_cmd(parent, cmd); 
     459  if(existing) return existing->dstate; 
     460  child = noit_console_state_alloc(); 
     461  noit_console_state_add_cmd(parent, 
     462                              NCSCMD(cmd, noit_console_state_delegate, 
     463                                     noit_console_opt_delegate, child, NULL)); 
     464  return child; 
     465} 
     466 
     467noit_console_state_t * 
    458468noit_console_state_initial() { 
    459469  static noit_console_state_t *_top_level_state = NULL; 
    460470  if(!_top_level_state) { 
    461     static noit_console_state_t *no_state, *show_state
     471    static noit_console_state_t *no_state, *show_state, *evdeb
    462472    _top_level_state = noit_console_state_alloc(); 
    463473    noit_console_state_add_cmd(_top_level_state, &console_command_exit); 
    464     show_state = noit_console_state_alloc(); 
    465     noit_console_state_add_cmd(_top_level_state, 
    466       NCSCMD("show", noit_console_state_delegate, noit_console_opt_delegate, 
    467              show_state, NULL)); 
    468     no_state = noit_console_state_alloc(); 
    469     noit_console_state_add_cmd(_top_level_state, 
    470       NCSCMD("no", noit_console_state_delegate, noit_console_opt_delegate, 
    471              no_state, NULL)); 
     474    show_state = noit_console_mksubdelegate(_top_level_state, "show"); 
     475    no_state = noit_console_mksubdelegate(_top_level_state, "no"); 
    472476 
    473477    noit_console_state_add_cmd(_top_level_state, &console_command_shutdown); 
    474478    noit_console_state_add_cmd(_top_level_state, &console_command_restart); 
    475     noit_console_state_add_cmd(show_state, &console_command_eventer); 
     479 
     480    evdeb = noit_console_mksubdelegate( 
     481              noit_console_mksubdelegate(show_state, 
     482                                         "eventer"), 
     483                                       "debug"); 
     484    noit_console_state_add_cmd(evdeb, &console_command_eventer_timers); 
     485    noit_console_state_add_cmd(evdeb, &console_command_eventer_sockets); 
    476486  } 
    477487  return _top_level_state;