00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include "main.h"
00027 #include "modules.h"
00028 #include "tandem.h"
00029 #include "md5/md5.h"
00030
00031 #ifdef TIME_WITH_SYS_TIME
00032 # include <sys/time.h>
00033 # include <time.h>
00034 #else
00035 # ifdef HAVE_SYS_TIME_H
00036 # include <sys/time.h>
00037 # else
00038 # include <time.h>
00039 # endif
00040 #endif
00041
00042 #include <sys/stat.h>
00043
00044 #ifdef HAVE_UNAME
00045 # include <sys/utsname.h>
00046 #endif
00047
00048 extern p_tcl_bind_list bind_table_list;
00049 extern tcl_timer_t *timer, *utimer;
00050 extern struct dcc_t *dcc;
00051 extern char botnetnick[], quit_msg[];
00052 extern struct userrec *userlist;
00053 extern time_t now;
00054 extern module_entry *module_list;
00055 extern int max_logs;
00056 extern log_t *logs;
00057 extern Tcl_Interp *interp;
00058
00059 int expmem_tclmisc()
00060 {
00061 int i, tot = 0;
00062
00063 for (i = 0; i < max_logs; i++) {
00064 if (logs[i].filename != NULL) {
00065 tot += strlen(logs[i].filename) + 1;
00066 tot += strlen(logs[i].chname) + 1;
00067 }
00068 }
00069
00070 return tot;
00071 }
00072
00073
00074
00075
00076
00077
00078 static int tcl_logfile STDVAR
00079 {
00080 int i;
00081 char s[151];
00082
00083 BADARGS(1, 4, " ?logModes channel logFile?");
00084
00085 if (argc == 1) {
00086
00087 for (i = 0; i < max_logs; i++)
00088 if (logs[i].filename != NULL) {
00089 snprintf(s, sizeof s, "%s %s %s", masktype(logs[i].mask),
00090 logs[i].chname, logs[i].filename);
00091 Tcl_AppendElement(interp, s);
00092 }
00093 return TCL_OK;
00094 }
00095
00096 BADARGS(4, 4, " ?logModes channel logFile?");
00097
00098 if (*argv[1] && !*argv[2]) {
00099 Tcl_AppendResult(interp,
00100 "log modes set, but no channel specified", NULL);
00101 return TCL_ERROR;
00102 }
00103 if (*argv[2] && !strchr(CHANMETA, *argv[2]) && strcmp(argv[2], "*")) {
00104 Tcl_AppendResult(interp, "invalid channel prefix", NULL);
00105 return TCL_ERROR;
00106 }
00107 if (*argv[2] && strchr(argv[2], ' ')) {
00108 Tcl_AppendResult(interp, "channel names cannot contain spaces", NULL);
00109 return TCL_ERROR;
00110 }
00111
00112 for (i = 0; i < max_logs; i++)
00113 if ((logs[i].filename != NULL) && (!strcmp(logs[i].filename, argv[3]))) {
00114 logs[i].flags &= ~LF_EXPIRING;
00115 logs[i].mask = logmodes(argv[1]);
00116 nfree(logs[i].chname);
00117 logs[i].chname = NULL;
00118 if (!logs[i].mask) {
00119
00120 nfree(logs[i].filename);
00121 logs[i].filename = NULL;
00122 if (logs[i].f != NULL) {
00123 fclose(logs[i].f);
00124 logs[i].f = NULL;
00125 }
00126 logs[i].flags = 0;
00127 } else {
00128 logs[i].chname = nmalloc(strlen(argv[2]) + 1);
00129 strcpy(logs[i].chname, argv[2]);
00130 }
00131 Tcl_AppendResult(interp, argv[3], NULL);
00132 return TCL_OK;
00133 }
00134
00135 if (!logmodes(argv[1])) {
00136 Tcl_AppendResult(interp, "can't remove \"", argv[3],
00137 "\" from list: no such logfile", NULL);
00138 return TCL_ERROR;
00139 }
00140 for (i = 0; i < max_logs; i++)
00141 if (logs[i].filename == NULL) {
00142 logs[i].flags = 0;
00143 logs[i].mask = logmodes(argv[1]);
00144 logs[i].filename = nmalloc(strlen(argv[3]) + 1);
00145 strcpy(logs[i].filename, argv[3]);
00146 logs[i].chname = nmalloc(strlen(argv[2]) + 1);
00147 strcpy(logs[i].chname, argv[2]);
00148 Tcl_AppendResult(interp, argv[3], NULL);
00149 return TCL_OK;
00150 }
00151 Tcl_AppendResult(interp, "reached max # of logfiles", NULL);
00152 return TCL_ERROR;
00153 }
00154
00155 static int tcl_putlog STDVAR
00156 {
00157 char logtext[501];
00158
00159 BADARGS(2, 2, " text");
00160
00161 strncpyz(logtext, argv[1], sizeof logtext);
00162 putlog(LOG_MISC, "*", "%s", logtext);
00163 return TCL_OK;
00164 }
00165
00166 static int tcl_putcmdlog STDVAR
00167 {
00168 char logtext[501];
00169
00170 BADARGS(2, 2, " text");
00171
00172 strncpyz(logtext, argv[1], sizeof logtext);
00173 putlog(LOG_CMDS, "*", "%s", logtext);
00174 return TCL_OK;
00175 }
00176
00177 static int tcl_putxferlog STDVAR
00178 {
00179 char logtext[501];
00180
00181 BADARGS(2, 2, " text");
00182
00183 strncpyz(logtext, argv[1], sizeof logtext);
00184 putlog(LOG_FILES, "*", "%s", logtext);
00185 return TCL_OK;
00186 }
00187
00188 static int tcl_putloglev STDVAR
00189 {
00190 int lev = 0;
00191 char logtext[501];
00192
00193 BADARGS(4, 4, " level(s) channel text");
00194
00195 lev = logmodes(argv[1]);
00196 if (!lev) {
00197 Tcl_AppendResult(irp, "No valid log-level given", NULL);
00198 return TCL_ERROR;
00199 }
00200 strncpyz(logtext, argv[3], sizeof logtext);
00201
00202 putlog(lev, argv[2], "%s", logtext);
00203 return TCL_OK;
00204 }
00205
00206 static int tcl_binds STDVAR
00207 {
00208 int matching = 0;
00209 char *g, flg[100], hits[11];
00210 EGG_CONST char *list[5];
00211 tcl_bind_list_t *tl, *tl_kind;
00212 tcl_bind_mask_t *tm;
00213 tcl_cmd_t *tc;
00214
00215 BADARGS(1, 2, " ?type/mask?");
00216
00217 if (argv[1])
00218 tl_kind = find_bind_table(argv[1]);
00219 else
00220 tl_kind = NULL;
00221 if (!tl_kind && argv[1])
00222 matching = 1;
00223 for (tl = tl_kind ? tl_kind : bind_table_list; tl;
00224 tl = tl_kind ? 0 : tl->next) {
00225 if (tl->flags & HT_DELETED)
00226 continue;
00227 for (tm = tl->first; tm; tm = tm->next) {
00228 if (tm->flags & TBM_DELETED)
00229 continue;
00230 for (tc = tm->first; tc; tc = tc->next) {
00231 if (tc->attributes & TC_DELETED)
00232 continue;
00233 if (matching &&
00234 !wild_match_per(argv[1], tl->name) &&
00235 !wild_match_per(argv[1], tm->mask) &&
00236 !wild_match_per(argv[1], tc->func_name))
00237 continue;
00238 build_flags(flg, &(tc->flags), NULL);
00239 egg_snprintf(hits, sizeof hits, "%i", (int) tc->hits);
00240 list[0] = tl->name;
00241 list[1] = flg;
00242 list[2] = tm->mask;
00243 list[3] = hits;
00244 list[4] = tc->func_name;
00245 g = Tcl_Merge(5, list);
00246 Tcl_AppendElement(irp, g);
00247 Tcl_Free((char *) g);
00248 }
00249 }
00250 }
00251 return TCL_OK;
00252 }
00253
00254 static int tcl_timer STDVAR
00255 {
00256 unsigned long x;
00257 char s[16];
00258
00259 BADARGS(3, 3, " minutes command");
00260
00261 if (atoi(argv[1]) < 0) {
00262 Tcl_AppendResult(irp, "time value must be positive", NULL);
00263 return TCL_ERROR;
00264 }
00265 if (argv[2][0] != '#') {
00266 x = add_timer(&timer, atoi(argv[1]), argv[2], 0L);
00267 egg_snprintf(s, sizeof s, "timer%lu", x);
00268 Tcl_AppendResult(irp, s, NULL);
00269 }
00270 return TCL_OK;
00271 }
00272
00273 static int tcl_utimer STDVAR
00274 {
00275 unsigned long x;
00276 char s[16];
00277
00278 BADARGS(3, 3, " seconds command");
00279
00280 if (atoi(argv[1]) < 0) {
00281 Tcl_AppendResult(irp, "time value must be positive", NULL);
00282 return TCL_ERROR;
00283 }
00284 if (argv[2][0] != '#') {
00285 x = add_timer(&utimer, atoi(argv[1]), argv[2], 0L);
00286 egg_snprintf(s, sizeof s, "timer%lu", x);
00287 Tcl_AppendResult(irp, s, NULL);
00288 }
00289 return TCL_OK;
00290 }
00291
00292 static int tcl_killtimer STDVAR
00293 {
00294 BADARGS(2, 2, " timerID");
00295
00296 if (strncmp(argv[1], "timer", 5)) {
00297 Tcl_AppendResult(irp, "argument is not a timerID", NULL);
00298 return TCL_ERROR;
00299 }
00300 if (remove_timer(&timer, atol(&argv[1][5])))
00301 return TCL_OK;
00302 Tcl_AppendResult(irp, "invalid timerID", NULL);
00303 return TCL_ERROR;
00304 }
00305
00306 static int tcl_killutimer STDVAR
00307 {
00308 BADARGS(2, 2, " timerID");
00309
00310 if (strncmp(argv[1], "timer", 5)) {
00311 Tcl_AppendResult(irp, "argument is not a timerID", NULL);
00312 return TCL_ERROR;
00313 }
00314 if (remove_timer(&utimer, atol(&argv[1][5])))
00315 return TCL_OK;
00316 Tcl_AppendResult(irp, "invalid timerID", NULL);
00317 return TCL_ERROR;
00318 }
00319
00320 static int tcl_timers STDVAR
00321 {
00322 BADARGS(1, 1, "");
00323
00324 list_timers(irp, timer);
00325 return TCL_OK;
00326 }
00327
00328 static int tcl_utimers STDVAR
00329 {
00330 BADARGS(1, 1, "");
00331
00332 list_timers(irp, utimer);
00333 return TCL_OK;
00334 }
00335
00336 static int tcl_duration STDVAR
00337 {
00338 char s[70];
00339 unsigned long sec, tmp;
00340
00341 BADARGS(2, 2, " seconds");
00342
00343 if (atol(argv[1]) <= 0) {
00344 Tcl_AppendResult(irp, "0 seconds", NULL);
00345 return TCL_OK;
00346 }
00347 sec = atol(argv[1]);
00348
00349 s[0] = 0;
00350 if (sec >= 31536000) {
00351 tmp = (sec / 31536000);
00352 sprintf(s, "%lu year%s ", tmp, (tmp == 1) ? "" : "s");
00353 sec -= (tmp * 31536000);
00354 }
00355 if (sec >= 604800) {
00356 tmp = (sec / 604800);
00357 sprintf(&s[strlen(s)], "%lu week%s ", tmp, (tmp == 1) ? "" : "s");
00358 sec -= (tmp * 604800);
00359 }
00360 if (sec >= 86400) {
00361 tmp = (sec / 86400);
00362 sprintf(&s[strlen(s)], "%lu day%s ", tmp, (tmp == 1) ? "" : "s");
00363 sec -= (tmp * 86400);
00364 }
00365 if (sec >= 3600) {
00366 tmp = (sec / 3600);
00367 sprintf(&s[strlen(s)], "%lu hour%s ", tmp, (tmp == 1) ? "" : "s");
00368 sec -= (tmp * 3600);
00369 }
00370 if (sec >= 60) {
00371 tmp = (sec / 60);
00372 sprintf(&s[strlen(s)], "%lu minute%s ", tmp, (tmp == 1) ? "" : "s");
00373 sec -= (tmp * 60);
00374 }
00375 if (sec > 0) {
00376 tmp = (sec);
00377 sprintf(&s[strlen(s)], "%lu second%s", tmp, (tmp == 1) ? "" : "s");
00378 }
00379 if (strlen(s) > 0 && s[strlen(s) - 1] == ' ')
00380 s[strlen(s) - 1] = 0;
00381 Tcl_AppendResult(irp, s, NULL);
00382 return TCL_OK;
00383 }
00384
00385 static int tcl_unixtime STDVAR
00386 {
00387 char s[11];
00388 time_t now2 = time(NULL);
00389
00390 BADARGS(1, 1, "");
00391
00392 egg_snprintf(s, sizeof s, "%li", (long) now2);
00393 Tcl_AppendResult(irp, s, NULL);
00394 return TCL_OK;
00395 }
00396
00397 static int tcl_ctime STDVAR
00398 {
00399 time_t tt;
00400 char s[25];
00401
00402 BADARGS(2, 2, " unixtime");
00403
00404 tt = (time_t) atol(argv[1]);
00405 strncpyz(s, ctime(&tt), sizeof s);
00406 Tcl_AppendResult(irp, s, NULL);
00407 return TCL_OK;
00408 }
00409
00410 static int tcl_strftime STDVAR
00411 {
00412 char buf[512];
00413 struct tm *tm1;
00414 time_t t;
00415
00416 BADARGS(2, 3, " format ?time?");
00417
00418 if (argc == 3)
00419 t = atol(argv[2]);
00420 else
00421 t = now;
00422 tm1 = localtime(&t);
00423 if (egg_strftime(buf, sizeof(buf) - 1, argv[1], tm1)) {
00424 Tcl_AppendResult(irp, buf, NULL);
00425 return TCL_OK;
00426 }
00427 Tcl_AppendResult(irp, " error with strftime", NULL);
00428 return TCL_ERROR;
00429 }
00430
00431 static int tcl_myip STDVAR
00432 {
00433 char s[16];
00434
00435 BADARGS(1, 1, "");
00436
00437 egg_snprintf(s, sizeof s, "%lu", iptolong(getmyip()));
00438 Tcl_AppendResult(irp, s, NULL);
00439 return TCL_OK;
00440 }
00441
00442 static int tcl_rand STDVAR
00443 {
00444 long i;
00445 unsigned long x;
00446 char s[11];
00447
00448 BADARGS(2, 2, " limit");
00449
00450 i = atol(argv[1]);
00451
00452 if (i <= 0) {
00453 Tcl_AppendResult(irp, "random limit must be greater than zero", NULL);
00454 return TCL_ERROR;
00455 } else if (i > RANDOM_MAX) {
00456 Tcl_AppendResult(irp, "random limit must be less than ", RANDOM_MAX, NULL);
00457 return TCL_ERROR;
00458 }
00459
00460 x = randint(i);
00461
00462 egg_snprintf(s, sizeof s, "%lu", x);
00463
00464 Tcl_AppendResult(irp, s, NULL);
00465 return TCL_OK;
00466 }
00467
00468 static int tcl_sendnote STDVAR
00469 {
00470 char s[5], from[NOTENAMELEN + 1], to[NOTENAMELEN + 1], msg[451];
00471
00472 BADARGS(4, 4, " from to message");
00473
00474 strncpyz(from, argv[1], sizeof from);
00475 strncpyz(to, argv[2], sizeof to);
00476 strncpyz(msg, argv[3], sizeof msg);
00477 egg_snprintf(s, sizeof s, "%d", add_note(to, from, msg, -1, 0));
00478 Tcl_AppendResult(irp, s, NULL);
00479 return TCL_OK;
00480 }
00481
00482 static int tcl_dumpfile STDVAR
00483 {
00484 char nick[NICKLEN];
00485 struct flag_record fr = { FR_GLOBAL | FR_CHAN, 0, 0, 0, 0, 0 };
00486
00487 BADARGS(3, 3, " nickname filename");
00488
00489 strncpyz(nick, argv[1], sizeof nick);
00490 get_user_flagrec(get_user_by_nick(nick), &fr, NULL);
00491 showhelp(argv[1], argv[2], &fr, HELP_TEXT);
00492 return TCL_OK;
00493 }
00494
00495 static int tcl_dccdumpfile STDVAR
00496 {
00497 int idx, i;
00498 struct flag_record fr = { FR_GLOBAL | FR_CHAN | FR_ANYWH, 0, 0, 0, 0, 0 };
00499
00500 BADARGS(3, 3, " idx filename");
00501
00502 i = atoi(argv[1]);
00503 idx = findidx(i);
00504 if (idx < 0) {
00505 Tcl_AppendResult(irp, "illegal idx", NULL);
00506 return TCL_ERROR;
00507 }
00508 get_user_flagrec(get_user_by_handle(userlist, dcc[idx].nick), &fr, NULL);
00509
00510 tellhelp(idx, argv[2], &fr, HELP_TEXT);
00511 return TCL_OK;
00512 }
00513
00514 static int tcl_backup STDVAR
00515 {
00516 BADARGS(1, 1, "");
00517
00518 call_hook(HOOK_BACKUP);
00519 return TCL_OK;
00520 }
00521
00522 static int tcl_die STDVAR
00523 {
00524 char s[1024];
00525
00526 BADARGS(1, 2, " ?reason?");
00527
00528 if (argc == 2) {
00529 egg_snprintf(s, sizeof s, "BOT SHUTDOWN (%s)", argv[1]);
00530 strncpyz(quit_msg, argv[1], 1024);
00531 } else {
00532 strncpyz(s, "BOT SHUTDOWN (No reason)", sizeof s);
00533 quit_msg[0] = 0;
00534 }
00535 kill_bot(s, quit_msg[0] ? quit_msg : "EXIT");
00536 return TCL_OK;
00537 }
00538
00539 static int tcl_loadmodule STDVAR
00540 {
00541 const char *p;
00542
00543 BADARGS(2, 2, " module-name");
00544
00545 p = module_load(argv[1]);
00546 if (p && strcmp(p, MOD_ALREADYLOAD) && !strcmp(argv[0], "loadmodule"))
00547 putlog(LOG_MISC, "*", "%s %s: %s", MOD_CANTLOADMOD, argv[1], p);
00548 Tcl_AppendResult(irp, p, NULL);
00549 return TCL_OK;
00550 }
00551
00552 static int tcl_unloadmodule STDVAR
00553 {
00554 BADARGS(2, 2, " module-name");
00555
00556 Tcl_AppendResult(irp, module_unload(argv[1], botnetnick), NULL);
00557 return TCL_OK;
00558 }
00559
00560 static int tcl_unames STDVAR
00561 {
00562 char *unix_n, *vers_n;
00563 #ifdef HAVE_UNAME
00564 struct utsname un;
00565
00566 if (uname(&un) < 0) {
00567 #endif
00568 unix_n = "*unknown*";
00569 vers_n = "";
00570 #ifdef HAVE_UNAME
00571 } else {
00572 unix_n = un.sysname;
00573 vers_n = un.release;
00574 }
00575 #endif
00576 Tcl_AppendResult(irp, unix_n, " ", vers_n, NULL);
00577 return TCL_OK;
00578 }
00579
00580 static int tcl_modules STDVAR
00581 {
00582 int i;
00583 char *p, s[24], s2[24];
00584 EGG_CONST char *list[100], *list2[2];
00585 dependancy *dep;
00586 module_entry *current;
00587
00588 BADARGS(1, 1, "");
00589
00590 for (current = module_list; current; current = current->next) {
00591 list[0] = current->name;
00592 egg_snprintf(s, sizeof s, "%d.%d", current->major, current->minor);
00593 list[1] = s;
00594 i = 2;
00595 for (dep = dependancy_list; dep && (i < 100); dep = dep->next) {
00596 if (dep->needing == current) {
00597 list2[0] = dep->needed->name;
00598 egg_snprintf(s2, sizeof s2, "%d.%d", dep->major, dep->minor);
00599 list2[1] = s2;
00600 list[i] = Tcl_Merge(2, list2);
00601 i++;
00602 }
00603 }
00604 p = Tcl_Merge(i, list);
00605 Tcl_AppendElement(irp, p);
00606 Tcl_Free((char *) p);
00607 while (i > 2) {
00608 i--;
00609 Tcl_Free((char *) list[i]);
00610 }
00611 }
00612 return TCL_OK;
00613 }
00614
00615 static int tcl_loadhelp STDVAR
00616 {
00617 BADARGS(2, 2, " helpfile-name");
00618
00619 add_help_reference(argv[1]);
00620 return TCL_OK;
00621 }
00622
00623 static int tcl_unloadhelp STDVAR
00624 {
00625 BADARGS(2, 2, " helpfile-name");
00626
00627 rem_help_reference(argv[1]);
00628 return TCL_OK;
00629 }
00630
00631 static int tcl_reloadhelp STDVAR
00632 {
00633 BADARGS(1, 1, "");
00634
00635 reload_help_data();
00636 return TCL_OK;
00637 }
00638
00639 static int tcl_callevent STDVAR
00640 {
00641 BADARGS(2, 2, " event");
00642
00643 check_tcl_event(argv[1]);
00644 return TCL_OK;
00645 }
00646
00647 static int tcl_stripcodes STDVAR
00648 {
00649 int flags = 0;
00650 char *p;
00651
00652 BADARGS(3, 3, " strip-flags string");
00653
00654 for (p = argv[1]; *p; p++)
00655 switch (*p) {
00656 case 'a':
00657 flags |= STRIP_ANSI;
00658 break;
00659 case 'b':
00660 flags |= STRIP_BOLD;
00661 break;
00662 case 'c':
00663 flags |= STRIP_COLOR;
00664 break;
00665 case 'g':
00666 flags |= STRIP_BELLS;
00667 break;
00668 case 'r':
00669 flags |= STRIP_REV;
00670 break;
00671 case 'u':
00672 flags |= STRIP_UNDER;
00673 break;
00674 default:
00675 Tcl_AppendResult(irp, "Invalid strip-flags: ", argv[1], NULL);
00676 return TCL_ERROR;
00677 }
00678
00679 strip_mirc_codes(flags, argv[2]);
00680 Tcl_AppendResult(irp, argv[2], NULL);
00681 return TCL_OK;
00682 }
00683
00684 #ifdef USE_TCL_OBJ
00685 static int tcl_md5(cd, irp, objc, objv)
00686 ClientData cd;
00687 Tcl_Interp *irp;
00688 int objc;
00689 Tcl_Obj *CONST objv[];
00690 {
00691 #else
00692 static int tcl_md5 STDVAR
00693 {
00694 #endif
00695 MD5_CTX md5context;
00696 char digest_string[33], *string;
00697 unsigned char digest[16];
00698 int i, len;
00699
00700 #ifdef USE_TCL_OBJ
00701 if (objc != 2) {
00702 Tcl_WrongNumArgs(irp, 1, objv, "string");
00703 return TCL_ERROR;
00704 }
00705 # ifdef USE_TCL_BYTE_ARRAYS
00706 string = (char *)Tcl_GetByteArrayFromObj(objv[1], &len);
00707 # else
00708 string = Tcl_GetStringFromObj(objv[1], &len);
00709 # endif
00710 #else
00711 BADARGS(2, 2, " string");
00712
00713 string = argv[1];
00714 len = strlen(argv[1]);
00715 #endif
00716
00717 MD5_Init(&md5context);
00718 MD5_Update(&md5context, (unsigned char *) string, len);
00719 MD5_Final(digest, &md5context);
00720 for (i = 0; i < 16; i++)
00721 sprintf(digest_string + (i * 2), "%.2x", digest[i]);
00722 Tcl_AppendResult(irp, digest_string, NULL);
00723 return TCL_OK;
00724 }
00725
00726 static int tcl_matchaddr STDVAR
00727 {
00728 BADARGS(3, 3, " mask address");
00729
00730 if (match_addr(argv[1], argv[2]))
00731 Tcl_AppendResult(irp, "1", NULL);
00732 else
00733 Tcl_AppendResult(irp, "0", NULL);
00734 return TCL_OK;
00735 }
00736
00737 static int tcl_matchcidr STDVAR
00738 {
00739 BADARGS(4, 4, " block address prefix");
00740
00741 if (cidr_match(argv[1], argv[2], atoi(argv[3])))
00742 Tcl_AppendResult(irp, "1", NULL);
00743 else
00744 Tcl_AppendResult(irp, "0", NULL);
00745 return TCL_OK;
00746 }
00747
00748 static int tcl_matchstr STDVAR
00749 {
00750 BADARGS(3, 3, " pattern string");
00751
00752 if (wild_match(argv[1], argv[2]))
00753 Tcl_AppendResult(irp, "1", NULL);
00754 else
00755 Tcl_AppendResult(irp, "0", NULL);
00756 return TCL_OK;
00757 }
00758
00759 tcl_cmds tclmisc_objcmds[] = {
00760 #ifdef USE_TCL_OBJ
00761 {"md5", tcl_md5},
00762 #endif
00763 {NULL, NULL}
00764 };
00765
00766 tcl_cmds tclmisc_cmds[] = {
00767 {"logfile", tcl_logfile},
00768 {"putlog", tcl_putlog},
00769 {"putcmdlog", tcl_putcmdlog},
00770 {"putxferlog", tcl_putxferlog},
00771 {"putloglev", tcl_putloglev},
00772 {"timer", tcl_timer},
00773 {"utimer", tcl_utimer},
00774 {"killtimer", tcl_killtimer},
00775 {"killutimer", tcl_killutimer},
00776 {"timers", tcl_timers},
00777 {"utimers", tcl_utimers},
00778 {"unixtime", tcl_unixtime},
00779 {"strftime", tcl_strftime},
00780 {"ctime", tcl_ctime},
00781 {"myip", tcl_myip},
00782 {"rand", tcl_rand},
00783 {"sendnote", tcl_sendnote},
00784 {"dumpfile", tcl_dumpfile},
00785 {"dccdumpfile", tcl_dccdumpfile},
00786 {"backup", tcl_backup},
00787 {"exit", tcl_die},
00788 {"die", tcl_die},
00789 {"unames", tcl_unames},
00790 {"unloadmodule", tcl_unloadmodule},
00791 {"loadmodule", tcl_loadmodule},
00792 {"checkmodule", tcl_loadmodule},
00793 {"modules", tcl_modules},
00794 {"loadhelp", tcl_loadhelp},
00795 {"unloadhelp", tcl_unloadhelp},
00796 {"reloadhelp", tcl_reloadhelp},
00797 {"duration", tcl_duration},
00798 #ifndef USE_TCL_OBJ
00799 {"md5", tcl_md5},
00800 #endif
00801 {"binds", tcl_binds},
00802 {"callevent", tcl_callevent},
00803 {"stripcodes", tcl_stripcodes},
00804 {"matchaddr", tcl_matchaddr},
00805 {"matchcidr", tcl_matchcidr},
00806 {"matchstr", tcl_matchstr},
00807 {NULL, NULL}
00808 };