20 #include "sysdep_decls.h"
21 #include "citserver.h"
24 #include "housekeeping.h"
29 #include "locate_host.h"
32 #include "dynloader.h"
37 struct CitContext *ContextList = NULL;
38 int ScheduledShutdown = 0;
41 * Various things that need to be initialized at startup
43 void master_startup(void) {
44 lprintf(7, "Opening databases\n");
47 lprintf(7, "Checking floor reference counts\n");
50 lprintf(7, "Creating base rooms (if necessary)\n");
51 create_room(BASEROOM, 0, "", 0);
52 create_room(AIDEROOM, 4, "", 0);
53 create_room(config.c_twitroom, 0, "", 0);
57 * Cleanup routine to be called when the server is shutting down.
59 void master_cleanup(void) {
60 struct CleanupFunctionHook *fcn;
62 /* Cancel all running sessions */
63 lprintf(7, "Cancelling running sessions...\n");
64 while (ContextList != NULL) {
65 kill_session(ContextList->cs_pid);
68 /* Run any cleanup routines registered by loadable modules */
69 for (fcn = CleanupHookTable; fcn != NULL; fcn = fcn->next) {
70 (*fcn->h_function_pointer)();
74 lprintf(7, "Closing databases\n");
77 /* Do system-dependent stuff */
78 sysdep_master_cleanup();
81 lprintf(3, "citserver: exiting.\n");
82 fflush(stdout); fflush(stderr);
88 * Gracefully terminate the session and thread.
89 * (This is called as a cleanup handler by the thread library.)
91 * All NON-system-dependent stuff is done in this function.
92 * System-dependent session/thread cleanup is in cleanup() in sysdep.c
94 void cleanup_stuff(void *arg)
97 lprintf(9, "cleanup_stuff() called\n");
99 lprintf(7, "Calling logout(%d)\n", CC->cs_pid);
102 rec_log(CL_TERMINATE,CC->curr_user);
104 lprintf(3, "citserver[%3d]: ended.\n",CC->cs_pid);
106 /* Run any cleanup routines registered by loadable modules */
107 PerformSessionHooks(EVT_STOP);
109 syslog(LOG_NOTICE,"session %d ended", CC->cs_pid);
111 /* Deallocate any message list we might have in memory */
112 if (CC->msglist != NULL) phree(CC->msglist);
114 /* Now get rid of the session and context */
115 lprintf(7, "cleanup_stuff() calling RemoveContext(%d)\n", CC->cs_pid);
118 /* While we still have an extra thread with no user attached to it,
119 * take the opportunity to do some housekeeping before exiting.
126 * set_wtmpsupp() - alter the session listing
128 void set_wtmpsupp(char *newtext)
130 strncpy(CC->cs_room,newtext,sizeof CC->cs_room);
131 CC->cs_room[sizeof CC->cs_room - 1] = 0;
132 time(&CC->cs_lastupdt);
134 /* Run any routines registered by loadable modules */
135 PerformSessionHooks(EVT_NEWROOM);
140 * call set_wtmpsupp() with the name of the current room, modified a bit...
142 void set_wtmpsupp_to_current_room() {
143 if (CC->quickroom.QRflags & QR_PRIVATE) {
144 set_wtmpsupp("<private room>");
146 else if (CC->quickroom.QRflags & QR_MAILBOX) {
147 set_wtmpsupp(&CC->quickroom.QRname[11]);
150 set_wtmpsupp(CC->quickroom.QRname);
157 * cmd_info() - tell the client about this server
159 void cmd_info(void) {
160 cprintf("%d Server info:\n",LISTING_FOLLOWS);
161 cprintf("%d\n",CC->cs_pid);
162 cprintf("%s\n",config.c_nodename);
163 cprintf("%s\n",config.c_humannode);
164 cprintf("%s\n",config.c_fqdn);
165 cprintf("%s\n",CITADEL);
166 cprintf("%d\n",REV_LEVEL);
167 cprintf("%s\n",config.c_bbs_city);
168 cprintf("%s\n",config.c_sysadm);
169 cprintf("%d\n",SERVER_TYPE);
170 cprintf("%s\n",config.c_moreprompt);
171 cprintf("1\n"); /* 1 = yes, this system supports floors */
172 cprintf("1\n"); /* 1 = we support the extended paging options */
176 void cmd_rchg(char *argbuf)
178 char newroomname[256]; /* set to 256 to prevent buffer overruns <dme>*/
180 extract(newroomname, argbuf, 0);
181 newroomname[ROOMNAMELEN] = 0;
182 if (strlen(newroomname) > 0) {
183 strncpy(CC->fake_roomname, newroomname, ROOMNAMELEN);
184 CC->fake_roomname[ROOMNAMELEN - 1] = 0;
187 strcpy(CC->fake_roomname, "");
189 cprintf("%d OK\n", OK);
192 void cmd_hchg(char *newhostname)
194 if ((newhostname) && (newhostname[0]))
196 memset(CC->fake_hostname, 0, 25);
197 strncpy(CC->fake_hostname, newhostname, 24);
200 strcpy(CC->fake_hostname, "");
201 cprintf("%d OK\n",OK);
204 void cmd_uchg(char *newusername)
206 if (CC->usersupp.axlevel < 6)
208 cprintf("%d You must be an Aide to use UCHG.\n",
209 ERROR+HIGHER_ACCESS_REQUIRED);
212 if ((newusername) && (newusername[0]))
214 CC->cs_flags &= ~CS_STEALTH;
215 memset(CC->fake_username, 0, 32);
216 if (strncasecmp(newusername, CC->curr_user, strlen(CC->curr_user)))
217 strncpy(CC->fake_username, newusername, 31);
221 CC->fake_username[0] = '\0';
222 CC->cs_flags |= CS_STEALTH;
228 * returns an asterisk if there are any express messages waiting,
231 char check_express(void) {
232 if (CC->FirstExpressMessage == NULL) {
246 cprintf("%d %ld\n", OK, tv);
250 * check a hostname against the public_clients file
252 int is_public_client(char *where)
257 if (!strcasecmp(where,"localhost")) return(1);
258 if (!strcasecmp(where,config.c_fqdn)) return(1);
260 fp = fopen("public_clients","r");
261 if (fp == NULL) return(0);
263 while (fgets(buf,256,fp)!=NULL) {
264 while (isspace((buf[strlen(buf)-1])))
265 buf[strlen(buf)-1] = 0;
266 if (!strcasecmp(buf,where)) {
278 * the client is identifying itself to the server
280 void cmd_iden(char *argbuf)
288 if (num_parms(argbuf)<4) {
289 cprintf("%d usage error\n",ERROR);
293 dev_code = extract_int(argbuf,0);
294 cli_code = extract_int(argbuf,1);
295 rev_level = extract_int(argbuf,2);
296 extract(desc,argbuf,3);
298 strncpy(from_host,config.c_fqdn,sizeof from_host);
299 from_host[sizeof from_host - 1] = 0;
300 if (num_parms(argbuf)>=5) extract(from_host,argbuf,4);
302 CC->cs_clientdev = dev_code;
303 CC->cs_clienttyp = cli_code;
304 CC->cs_clientver = rev_level;
305 strncpy(CC->cs_clientname,desc,31);
306 CC->cs_clientname[31] = 0;
308 if ((strlen(from_host)>0) &&
309 (is_public_client(CC->cs_host))) {
310 strncpy(CC->cs_host,from_host,24);
313 set_wtmpsupp_to_current_room();
315 syslog(LOG_NOTICE,"client %d/%d/%01d.%02d (%s)\n",
321 cprintf("%d Ok\n",OK);
326 * enter or exit "stealth mode"
328 void cmd_stel(char *cmdbuf)
332 requested_mode = extract_int(cmdbuf,0);
333 if (requested_mode !=0) requested_mode = 1;
335 if (!CC->logged_in) {
336 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
340 if (CC->usersupp.axlevel < 6) {
341 cprintf("%d You must be an Aide to use stealth mode.\n",
342 ERROR+HIGHER_ACCESS_REQUIRED);
346 if (CC->cs_flags & CS_STEALTH) {
347 if (requested_mode == 0)
348 CC->cs_flags = CC->cs_flags-CS_STEALTH;
351 if (requested_mode == 1)
352 CC->cs_flags = CC->cs_flags|CS_STEALTH;
355 set_wtmpsupp_to_current_room();
356 cprintf("%d Ok\n",OK);
363 * display system messages or help
365 void cmd_mesg(char *mname)
372 extract(buf,mname,0);
377 strcpy(dirs[0],"messages");
378 strcpy(dirs[1],"help");
379 mesg_locate(targ,buf,2,dirs);
384 if (strlen(targ)==0) {
385 cprintf("%d '%s' not found.\n",ERROR,mname);
389 mfp = fopen(targ,"r");
391 cprintf("%d Cannot open '%s': %s\n",
392 ERROR,targ,strerror(errno));
395 cprintf("%d %s\n",LISTING_FOLLOWS,buf);
397 while (fgets(buf,255,mfp)!=NULL) {
398 buf[strlen(buf)-1] = 0;
409 * enter system messages or help
411 void cmd_emsg(char *mname)
419 if (CC->usersupp.axlevel < 6) {
420 cprintf("%d You must be an Aide to edit system messages.\n",
421 ERROR+HIGHER_ACCESS_REQUIRED);
425 extract(buf,mname,0);
426 for (a=0; a<strlen(buf); ++a) { /* security measure */
427 if (buf[a] == '/') buf[a] = '.';
432 strcpy(dirs[0],"messages");
433 strcpy(dirs[1],"help");
434 mesg_locate(targ,buf,2,dirs);
438 if (strlen(targ)==0) {
439 snprintf(targ, sizeof targ, "./help/%s", buf);
442 mfp = fopen(targ,"w");
444 cprintf("%d Cannot open '%s': %s\n",
445 ERROR,targ,strerror(errno));
448 cprintf("%d %s\n", SEND_LISTING, targ);
450 while (client_gets(buf), strcmp(buf, "000")) {
451 fprintf(mfp, "%s\n", buf);
461 void cmd_rwho(void) {
462 struct CitContext *cptr;
465 char un[40], room[40], host[40], flags[5];
467 aide = CC->usersupp.axlevel >= 6;
468 cprintf("%d\n",LISTING_FOLLOWS);
470 for (cptr = ContextList; cptr != NULL; cptr = cptr->next)
475 if (cptr->cs_flags & CS_POSTING)
480 if (cptr->fake_username[0])
482 strcpy(un, cptr->fake_username);
486 strcpy(un, cptr->curr_user);
488 if (cptr->fake_hostname[0])
490 strcpy(host, cptr->fake_hostname);
494 strcpy(host, cptr->cs_host);
496 if (cptr->fake_roomname[0])
498 strcpy(room, cptr->fake_roomname);
502 strcpy(room, cptr->cs_room);
505 if ((aide) && (spoofed))
508 if ((cptr->cs_flags & CS_STEALTH) && (aide))
511 if (((cptr->cs_flags&CS_STEALTH)==0) || (aide))
513 cprintf("%d|%s|%s|%s|%s|%ld|%s|%s\n",
514 cptr->cs_pid, un, room,
515 host, cptr->cs_clientname,
516 (long)(cptr->lastidle),
517 cptr->lastcmdname, flags);
519 if ((spoofed) && (aide))
521 cprintf("%d|%s|%s|%s|%s|%ld|%s|%s\n",
522 cptr->cs_pid, cptr->curr_user, cptr->cs_room,
523 cptr->cs_host, cptr->cs_clientname,
524 (long)(cptr->lastidle),
525 cptr->lastcmdname, flags);
534 * Terminate another running session
536 void cmd_term(char *cmdbuf)
539 struct CitContext *ccptr;
540 int session_to_kill = 0;
542 if (!CC->logged_in) {
543 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
547 if (CC->usersupp.axlevel < 6) {
548 cprintf("%d You must be an Aide to terminate sessions.\n",
549 ERROR+HIGHER_ACCESS_REQUIRED);
553 session_num = extract_int(cmdbuf, 0);
554 if (session_num == CC->cs_pid) {
555 cprintf("%d You can't kill your own session.\n", ERROR);
559 lprintf(9, "Locating session to kill\n");
560 begin_critical_section(S_SESSION_TABLE);
561 for (ccptr = ContextList; ccptr != NULL; ccptr = ccptr->next) {
562 if (session_num == ccptr->cs_pid) {
563 session_to_kill = ccptr->cs_pid;
566 end_critical_section(S_SESSION_TABLE);
567 lprintf(9, "session_to_kill == %d\n", session_to_kill);
569 if (session_to_kill > 0) {
570 lprintf(9, "calling kill_session()\n");
571 kill_session(session_to_kill);
572 cprintf("%d Session terminated.\n", OK);
575 cprintf("%d No such session.\n", ERROR);
584 * get the paginator prompt
586 void cmd_more(void) {
587 cprintf("%d %s\n",OK,config.c_moreprompt);
593 void cmd_echo(char *etext)
595 cprintf("%d %s\n",OK,etext);
601 * identify as internal program
603 void cmd_ipgm(char *argbuf)
607 secret = extract_int(argbuf, 0);
608 if (secret == config.c_ipgm_secret) {
609 CC->internal_pgm = 1;
610 strcpy(CC->curr_user, "<internal program>");
611 CC->cs_flags = CC->cs_flags|CS_STEALTH;
612 cprintf("%d Authenticated as an internal program.\n",OK);
615 cprintf("%d Authentication failed.\n",ERROR);
621 * Shut down the server
623 void cmd_down(void) {
624 if (!CC->logged_in) {
625 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
629 if (CC->usersupp.axlevel < 6) {
630 cprintf("%d You must be an Aide to shut down the server.\n",
631 ERROR+HIGHER_ACCESS_REQUIRED);
635 cprintf("%d Shutting down server. Goodbye.\n", OK);
640 * Schedule or cancel a server shutdown
642 void cmd_scdn(char *argbuf)
646 if (!CC->logged_in) {
647 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
651 if (CC->usersupp.axlevel < 6) {
652 cprintf("%d You must be an Aide to schedule a shutdown.\n",
653 ERROR+HIGHER_ACCESS_REQUIRED);
657 new_state = extract_int(argbuf, 0);
658 if ((new_state == 0) || (new_state == 1)) {
659 ScheduledShutdown = new_state;
661 cprintf("%d %d\n", OK, ScheduledShutdown);
668 void *context_loop(struct CitContext *con)
674 * Wedge our way into the context table.
679 * Initialize some variables specific to our context.
682 CC->internal_pgm = 0;
683 CC->download_fp = NULL;
684 CC->upload_fp = NULL;
685 CC->cs_pid = con->client_socket; /* not necessarily portable */
686 CC->FirstExpressMessage = NULL;
691 strcpy(CC->lastcmdname, " ");
692 strcpy(CC->cs_clientname, "(unknown)");
693 strcpy(CC->curr_user,"");
694 strcpy(CC->net_node,"");
695 snprintf(CC->temp, sizeof CC->temp, "/tmp/CitServer.%d.%d", getpid(), CC->cs_pid);
696 strcpy(CC->cs_room, "");
697 strncpy(CC->cs_host, config.c_fqdn, sizeof CC->cs_host);
698 CC->cs_host[sizeof CC->cs_host - 1] = 0;
699 locate_host(CC->cs_host);
701 CC->upload_type = UPL_FILE;
704 num_sessions = session_count();
706 if ((config.c_maxsessions > 0)&&(num_sessions > config.c_maxsessions))
709 if (CC->nologin==1) {
710 cprintf("%d %s: Too many users are already online (maximum is %d)\n",
711 ERROR+MAX_SESSIONS_EXCEEDED,
712 config.c_nodename,config.c_maxsessions);
715 cprintf("%d %s Citadel/UX server ready.\n",OK,config.c_nodename);
718 lprintf(3, "citserver[%3d]: started.\n", CC->cs_pid);
720 /* Run any session startup routines registered by loadable modules */
721 PerformSessionHooks(EVT_START);
723 rec_log(CL_CONNECT, "");
727 memset(cmdbuf, 0, sizeof cmdbuf); /* Clear it, just in case */
728 if (client_gets(cmdbuf) < 1) cleanup(EXIT_NULL);
729 lprintf(5, "citserver[%3d]: %s\n", CC->cs_pid, cmdbuf);
732 * Let other clients see the last command we executed, but
733 * exclude NOOP because that would be boring.
735 if (strncasecmp(cmdbuf, "NOOP", 4)) {
736 strcpy(CC->lastcmdname, " ");
737 strncpy(CC->lastcmdname, cmdbuf, 4);
741 if ((strncasecmp(cmdbuf, "ENT0", 4)) && (strncasecmp(cmdbuf, "MESG", 4)) && (strncasecmp(cmdbuf, "MSGS", 4)))
743 CC->cs_flags &= ~CS_POSTING;
747 * This loop recognizes all server commands.
750 if (!strncasecmp(cmdbuf,"NOOP",4)) {
751 cprintf("%d%cok\n",OK,check_express());
754 else if (!strncasecmp(cmdbuf,"QUIT",4)) {
755 cprintf("%d Goodbye.\n",OK);
758 else if (!strncasecmp(cmdbuf,"LOUT",4)) {
759 if (CC->logged_in) logout(CC);
760 cprintf("%d logged out.\n",OK);
763 else if (!strncasecmp(cmdbuf,"USER",4)) {
764 cmd_user(&cmdbuf[5]);
767 else if (!strncasecmp(cmdbuf,"PASS",4)) {
768 cmd_pass(&cmdbuf[5]);
771 else if (!strncasecmp(cmdbuf,"NEWU",4)) {
772 cmd_newu(&cmdbuf[5]);
775 else if (!strncasecmp(cmdbuf,"SETP",4)) {
776 cmd_setp(&cmdbuf[5]);
779 else if (!strncasecmp(cmdbuf,"LRMS",4)) {
780 cmd_lrms(&cmdbuf[5]);
783 else if (!strncasecmp(cmdbuf,"LKRA",4)) {
784 cmd_lkra(&cmdbuf[5]);
787 else if (!strncasecmp(cmdbuf,"LKRN",4)) {
788 cmd_lkrn(&cmdbuf[5]);
791 else if (!strncasecmp(cmdbuf,"LKRO",4)) {
792 cmd_lkro(&cmdbuf[5]);
795 else if (!strncasecmp(cmdbuf,"LZRM",4)) {
796 cmd_lzrm(&cmdbuf[5]);
799 else if (!strncasecmp(cmdbuf,"GETU",4)) {
803 else if (!strncasecmp(cmdbuf,"SETU",4)) {
804 cmd_setu(&cmdbuf[5]);
807 else if (!strncasecmp(cmdbuf,"GOTO",4)) {
808 cmd_goto(&cmdbuf[5]);
811 else if (!strncasecmp(cmdbuf,"MSGS",4)) {
812 cmd_msgs(&cmdbuf[5]);
815 else if (!strncasecmp(cmdbuf,"WHOK",4)) {
819 else if (!strncasecmp(cmdbuf,"RDIR",4)) {
823 else if (!strncasecmp(cmdbuf,"MSG0",4)) {
824 cmd_msg0(&cmdbuf[5]);
827 else if (!strncasecmp(cmdbuf,"MSG2",4)) {
828 cmd_msg2(&cmdbuf[5]);
831 else if (!strncasecmp(cmdbuf,"MSG3",4)) {
832 cmd_msg3(&cmdbuf[5]);
835 else if (!strncasecmp(cmdbuf,"MSG4",4)) {
836 cmd_msg4(&cmdbuf[5]);
839 else if (!strncasecmp(cmdbuf,"OPNA",4)) {
840 cmd_opna(&cmdbuf[5]);
843 else if (!strncasecmp(cmdbuf,"INFO",4)) {
847 else if (!strncasecmp(cmdbuf,"SLRP",4)) {
848 cmd_slrp(&cmdbuf[5]);
851 else if (!strncasecmp(cmdbuf,"INVT",4)) {
852 cmd_invt_kick(&cmdbuf[5],1);
855 else if (!strncasecmp(cmdbuf,"KICK",4)) {
856 cmd_invt_kick(&cmdbuf[5],0);
859 else if (!strncasecmp(cmdbuf,"GETR",4)) {
863 else if (!strncasecmp(cmdbuf,"SETR",4)) {
864 cmd_setr(&cmdbuf[5]);
867 else if (!strncasecmp(cmdbuf,"GETA",4)) {
871 else if (!strncasecmp(cmdbuf,"SETA",4)) {
872 cmd_seta(&cmdbuf[5]);
875 else if (!strncasecmp(cmdbuf,"ENT0",4)) {
876 cmd_ent0(&cmdbuf[5]);
879 else if (!strncasecmp(cmdbuf,"ENT3",4)) {
880 cmd_ent3(&cmdbuf[5]);
883 else if (!strncasecmp(cmdbuf,"RINF",4)) {
887 else if (!strncasecmp(cmdbuf,"DELE",4)) {
888 cmd_dele(&cmdbuf[5]);
891 else if (!strncasecmp(cmdbuf,"KILL",4)) {
892 cmd_kill(&cmdbuf[5]);
895 else if (!strncasecmp(cmdbuf,"CRE8",4)) {
896 cmd_cre8(&cmdbuf[5]);
899 else if (!strncasecmp(cmdbuf,"MOVE",4)) {
900 cmd_move(&cmdbuf[5]);
903 else if (!strncasecmp(cmdbuf,"FORG",4)) {
907 else if (!strncasecmp(cmdbuf,"MESG",4)) {
908 cmd_mesg(&cmdbuf[5]);
911 else if (!strncasecmp(cmdbuf,"EMSG",4)) {
912 cmd_emsg(&cmdbuf[5]);
915 else if (!strncasecmp(cmdbuf,"GNUR",4)) {
919 else if (!strncasecmp(cmdbuf,"GREG",4)) {
920 cmd_greg(&cmdbuf[5]);
923 else if (!strncasecmp(cmdbuf,"VALI",4)) {
924 cmd_vali(&cmdbuf[5]);
927 else if (!strncasecmp(cmdbuf,"EINF",4)) {
928 cmd_einf(&cmdbuf[5]);
931 else if (!strncasecmp(cmdbuf,"LIST",4)) {
935 else if (!strncasecmp(cmdbuf,"REGI",4)) {
939 else if (!strncasecmp(cmdbuf,"CHEK",4)) {
943 else if (!strncasecmp(cmdbuf,"DELF",4)) {
944 cmd_delf(&cmdbuf[5]);
947 else if (!strncasecmp(cmdbuf,"MOVF",4)) {
948 cmd_movf(&cmdbuf[5]);
951 else if (!strncasecmp(cmdbuf,"NETF",4)) {
952 cmd_netf(&cmdbuf[5]);
955 else if (!strncasecmp(cmdbuf,"RWHO",4)) {
959 else if (!strncasecmp(cmdbuf,"OPEN",4)) {
960 cmd_open(&cmdbuf[5]);
963 else if (!strncasecmp(cmdbuf,"CLOS",4)) {
967 else if (!strncasecmp(cmdbuf,"UOPN",4)) {
968 cmd_uopn(&cmdbuf[5]);
971 else if (!strncasecmp(cmdbuf,"UCLS",4)) {
972 cmd_ucls(&cmdbuf[5]);
975 else if (!strncasecmp(cmdbuf,"READ",4)) {
976 cmd_read(&cmdbuf[5]);
979 else if (!strncasecmp(cmdbuf,"WRIT",4)) {
980 cmd_writ(&cmdbuf[5]);
983 else if (!strncasecmp(cmdbuf,"QUSR",4)) {
984 cmd_qusr(&cmdbuf[5]);
987 else if (!strncasecmp(cmdbuf,"ECHO",4)) {
988 cmd_echo(&cmdbuf[5]);
991 else if (!strncasecmp(cmdbuf,"OIMG",4)) {
992 cmd_oimg(&cmdbuf[5]);
995 else if (!strncasecmp(cmdbuf,"MORE",4)) {
999 else if (!strncasecmp(cmdbuf,"NETP",4)) {
1000 cmd_netp(&cmdbuf[5]);
1003 else if (!strncasecmp(cmdbuf,"NDOP",4)) {
1004 cmd_ndop(&cmdbuf[5]);
1007 else if (!strncasecmp(cmdbuf,"NUOP",4)) {
1008 cmd_nuop(&cmdbuf[5]);
1011 else if (!strncasecmp(cmdbuf,"LFLR",4)) {
1015 else if (!strncasecmp(cmdbuf,"CFLR",4)) {
1016 cmd_cflr(&cmdbuf[5]);
1019 else if (!strncasecmp(cmdbuf,"KFLR",4)) {
1020 cmd_kflr(&cmdbuf[5]);
1023 else if (!strncasecmp(cmdbuf,"EFLR",4)) {
1024 cmd_eflr(&cmdbuf[5]);
1027 else if (!strncasecmp(cmdbuf,"IDEN",4)) {
1028 cmd_iden(&cmdbuf[5]);
1031 else if (!strncasecmp(cmdbuf,"IPGM",4)) {
1032 cmd_ipgm(&cmdbuf[5]);
1035 else if (!strncasecmp(cmdbuf,"EBIO",4)) {
1039 else if (!strncasecmp(cmdbuf,"RBIO",4)) {
1040 cmd_rbio(&cmdbuf[5]);
1043 else if (!strncasecmp(cmdbuf,"LBIO",4)) {
1047 else if (!strncasecmp(cmdbuf,"STEL",4)) {
1048 cmd_stel(&cmdbuf[5]);
1051 else if (!strncasecmp(cmdbuf,"TERM",4)) {
1052 cmd_term(&cmdbuf[5]);
1055 else if (!strncasecmp(cmdbuf,"DOWN",4)) {
1059 else if (!strncasecmp(cmdbuf,"SCDN",4)) {
1060 cmd_scdn(&cmdbuf[5]);
1063 else if (!strncasecmp(cmdbuf, "NSET", 4)) {
1064 cmd_nset(&cmdbuf[5]);
1067 else if (!strncasecmp(cmdbuf, "UIMG", 4)) {
1068 cmd_uimg(&cmdbuf[5]);
1071 else if (!strncasecmp(cmdbuf, "UCHG", 4)) {
1072 cmd_uchg(&cmdbuf[5]);
1075 else if (!strncasecmp(cmdbuf, "TIME", 4)) {
1079 else if (!strncasecmp(cmdbuf, "HCHG", 4)) {
1080 cmd_hchg(&cmdbuf[5]);
1083 else if (!strncasecmp(cmdbuf, "RCHG", 4)) {
1084 cmd_rchg(&cmdbuf[5]);
1087 else if (!strncasecmp(cmdbuf, "AGUP", 4)) {
1088 cmd_agup(&cmdbuf[5]);
1091 else if (!strncasecmp(cmdbuf, "ASUP", 4)) {
1092 cmd_asup(&cmdbuf[5]);
1095 else if (!strncasecmp(cmdbuf, "GPEX", 4)) {
1096 cmd_gpex(&cmdbuf[5]);
1099 else if (!strncasecmp(cmdbuf, "SPEX", 4)) {
1100 cmd_spex(&cmdbuf[5]);
1103 else if (!strncasecmp(cmdbuf, "CONF", 4)) {
1104 cmd_conf(&cmdbuf[5]);
1107 #ifdef DEBUG_MEMORY_LEAKS
1108 else if (!strncasecmp(cmdbuf, "LEAK", 4)) {
1113 else if (!DLoader_Exec_Cmd(cmdbuf))
1115 cprintf("%d Unrecognized or unsupported command.\n",
1119 } while(strncasecmp(cmdbuf, "QUIT", 4));
1121 cleanup(EXIT_NORMAL);