Hi,<br><br>To show my module statistics using radmin I referred command.c and radmin.c and added my new command <br>"show module statistics <module>".<br><br>To
 brief you, I added an usigned array of module return codes in 
module_instance_t structure and updated the array in call_modsingle() 
function using the statement: <br><br>modsingle *sp;<br>sp->modinst->rtcode[result] = sp->modinst->rtcode[result] + 1; <br><br>I tested this and it is giving 100% correct results.<br><br>Now
 I have written a function static int 
command_show_module_statistics(rad_listen_t *listener, int argc, char 
*argv[]) in command.c file. I have used radius methods & structures 
only in this function, so guide me which is correct/wrong or what else 
radius methods or structures should be used. The problem is that correct
 module statistics are not being diplayed rather it is displaying 0 
statistics for all modules.Please help me resolve this. Here goes the 
function code:<br><br>static int command_show_module_statistics(rad_listen_t *listener, int argc, char *argv[])<br>{<br> int i;<br> CONF_SECTION *cs;<br> module_instance_t const *mi;<br><br> if (argc != 1) {<br> cprintf(listener, "ERROR: No module name was given\n");<br> return 0;<br> }<br><br> cs = cf_section_find("modules");<br> if (!cs) return 0;<br><br> mi = find_module_instance(cs, argv[0], false);<br> if (!mi) {<br> cprintf(listener, "ERROR: No such module \"%s\"\n", argv[0]);<br> return 0;<br> }<br><br> for (i = 0; i < RLM_MODULE_NUMCODES; i++) {<br> cprintf(listener, "\nRTCODE[%d]=%ld\n",i,mi->rtcode[i]);<br> }<br><br> return 1; /* success */<br>}<br><br>Regards,<br>Sonu
<br><A HREF="http://sigads.rediff.com/RealMedia/ads/click_nx.ads/www.rediffmail.com/signatureline.htm@Middle?" target="_blank"><IMG SRC="http://sigads.rediff.com/RealMedia/ads/adstream_nx.ads/www.rediffmail.com/signatureline.htm@Middle"></A><table cellpadding="0" cellspacing="0"><tbody><tr><td><div style="font-family: Arial, Helvetica, sans-serif; font-size:14px">Get your own <span style="padding-bottom: 0px; background-color: #cc0000; padding-left: 3px; padding-RIGHT: 3px; font-family: Arial, Helvetica, sans-serif; color: #ffffff; font-size: 12px; padding-top: 0px"><b>FREE</b></span> website,  <span style="padding-bottom: 0px; background-color: #c00; padding-left: 3px; padding-RIGHT: 3px; font-family: Arial, Helvetica, sans-serif; color: #ffffff; font-size: 12px; padding-top: 0px"><b>FREE</b></span> domain & <span style="padding-bottom: 0px; background-color: #c00; padding-left: 3px; padding-RIGHT: 3px; font-family: Arial, Helvetica, sans-serif; color: #ffffff; font-size: 12px; padding-top: 0px"><b>FREE</b></span> mobile app with Company email.  </div></td><td><a href="http://track.rediff.com/click?url=___http://businessemail.rediff.com/email-ids-for-companies-with-less-than-50-employees?sc_cid=sign-1-10-13___&cmp=host&lnk=sign-1-10-13&nsrv1=host" style="font-family: Arial, Helvetica, sans-serif; color: #fff; font-size: 14px; color:#0000cc" target="_blank"><b>Know More ></b></a><!-- <in-put type="button" cl-ass="button" on-click="parent.location='http://track.rediff.com/click?url=___http://businessemail.rediff.com/company-email-hosting-services?sc_cid=signature-23-9-13___&cmp=signature-23-9-13&lnk=mypagelogout&nsrv1=host'" value="Know more >"> </input> --></td></tr></tbody></table>