17 #include "sysdep_decls.h"
18 #include "citserver.h"
21 #include "housekeeping.h"
26 #include "locate_host.h"
29 #include "dynloader.h"
34 struct CitContext *ContextList = NULL;
35 int ScheduledShutdown = 0;
38 * Various things that need to be initialized at startup
40 void master_startup(void) {
41 lprintf(7, "Opening databases\n");
44 lprintf(7, "Checking floor reference counts\n");
47 lprintf(7, "Creating base rooms (if necessary)\n");
48 create_room(BASEROOM, 0, "", 0);
49 create_room(AIDEROOM, 4, "", 0);
50 create_room(config.c_twitroom, 0, "", 0);
54 * Cleanup routine to be called when the server is shutting down.
56 void master_cleanup(void) {
57 struct CleanupFunctionHook *fcn;
59 /* Cancel all running sessions */
60 lprintf(7, "Cancelling running sessions...\n");
61 while (ContextList != NULL) {
62 kill_session(ContextList->cs_pid);
65 /* Run any cleanup routines registered by loadable modules */
66 for (fcn = CleanupHookTable; fcn != NULL; fcn = fcn->next) {
67 (*fcn->h_function_pointer)();
71 lprintf(7, "Closing databases\n");
74 /* Do system-dependent stuff */
75 sysdep_master_cleanup();
78 lprintf(3, "citserver: exiting.\n");
79 fflush(stdout); fflush(stderr);
85 * Gracefully terminate the session and thread.
86 * (This is called as a cleanup handler by the thread library.)
88 * All NON-system-dependent stuff is done in this function.
89 * System-dependent session/thread cleanup is in cleanup() in sysdep.c
91 void cleanup_stuff(void *arg)
94 lprintf(9, "cleanup_stuff() called\n");
96 lprintf(7, "Calling logout(%d)\n", CC->cs_pid);
99 rec_log(CL_TERMINATE,CC->curr_user);
101 lprintf(3, "citserver[%3d]: ended.\n",CC->cs_pid);
103 /* Run any cleanup routines registered by loadable modules */
104 PerformSessionHooks(EVT_STOP);
106 syslog(LOG_NOTICE,"session %d ended", CC->cs_pid);
108 /* Deallocate any unsent express messages */
109 begin_critical_section(S_SESSION_TABLE);
110 if (CC->ExpressMessages != NULL) phree(CC->ExpressMessages);
111 end_critical_section(S_SESSION_TABLE);
113 /* Deallocate any message list we might have in memory */
114 if (CC->msglist != NULL) phree(CC->msglist);
116 /* Now get rid of the session and context */
117 lprintf(7, "cleanup_stuff() calling RemoveContext(%d)\n", CC->cs_pid);
120 /* While we still have an extra thread with no user attached to it,
121 * take the opportunity to do some housekeeping before exiting.
128 * set_wtmpsupp() - alter the session listing
130 void set_wtmpsupp(char *newtext)
132 strncpy(CC->cs_room,newtext,sizeof CC->cs_room);
133 CC->cs_room[sizeof CC->cs_room - 1] = 0;
134 time(&CC->cs_lastupdt);
136 /* Run any routines registered by loadable modules */
137 PerformSessionHooks(EVT_NEWROOM);
142 * call set_wtmpsupp() with the name of the current room, modified a bit...
144 void set_wtmpsupp_to_current_room() {
145 if (CC->quickroom.QRflags & QR_PRIVATE) {
146 set_wtmpsupp("<private room>");
148 else if (CC->quickroom.QRflags & QR_MAILBOX) {
149 set_wtmpsupp(&CC->quickroom.QRname[11]);
152 set_wtmpsupp(CC->quickroom.QRname);
159 * cmd_info() - tell the client about this server
161 void cmd_info(void) {
162 cprintf("%d Server info:\n",LISTING_FOLLOWS);
163 cprintf("%d\n",CC->cs_pid);
164 cprintf("%s\n",config.c_nodename);
165 cprintf("%s\n",config.c_humannode);
166 cprintf("%s\n",config.c_fqdn);
167 cprintf("%s\n",CITADEL);
168 cprintf("%d\n",REV_LEVEL);
169 cprintf("%s\n",config.c_bbs_city);
170 cprintf("%s\n",config.c_sysadm);
171 cprintf("%d\n",SERVER_TYPE);
172 cprintf("%s\n",config.c_moreprompt);
173 cprintf("1\n"); /* 1 = yes, this system supports floors */
174 cprintf("1\n"); /* 1 = we support the extended paging options */
178 void cmd_rchg(char *argbuf)
180 char newroomname[256]; /* set to 256 to prevent buffer overruns <dme>*/
182 extract(newroomname, argbuf, 0);
183 newroomname[ROOMNAMELEN] = 0;
184 if (strlen(newroomname) > 0) {
185 strncpy(CC->fake_roomname, newroomname, ROOMNAMELEN);
186 CC->fake_roomname[ROOMNAMELEN - 1] = 0;
189 strcpy(CC->fake_roomname, "");
191 cprintf("%d OK\n", OK);
194 void cmd_hchg(char *newhostname)
196 if ((newhostname) && (newhostname[0]))
198 memset(CC->fake_hostname, 0, 25);
199 strncpy(CC->fake_hostname, newhostname, 24);
202 strcpy(CC->fake_hostname, "");
203 cprintf("%d OK\n",OK);
206 void cmd_uchg(char *newusername)
208 if (CC->usersupp.axlevel < 6)
210 cprintf("%d You must be an Aide to use UCHG.\n",
211 ERROR+HIGHER_ACCESS_REQUIRED);
214 if ((newusername) && (newusername[0]))
216 CC->cs_flags &= ~CS_STEALTH;
217 memset(CC->fake_username, 0, 32);
218 if (strncasecmp(newusername, CC->curr_user, strlen(CC->curr_user)))
219 strncpy(CC->fake_username, newusername, 31);
223 CC->fake_username[0] = '\0';
224 CC->cs_flags |= CS_STEALTH;
230 * returns an asterisk if there are any express messages waiting,
233 char check_express(void) {
234 if (CC->ExpressMessages == NULL) {
248 cprintf("%d %ld\n", OK, tv);
252 * check a hostname against the public_clients file
254 int is_public_client(char *where)
259 if (!strcasecmp(where,"localhost")) return(1);
260 if (!strcasecmp(where,config.c_fqdn)) return(1);
262 fp = fopen("public_clients","r");
263 if (fp == NULL) return(0);
265 while (fgets(buf,256,fp)!=NULL) {
266 while (isspace((buf[strlen(buf)-1])))
267 buf[strlen(buf)-1] = 0;
268 if (!strcasecmp(buf,where)) {
280 * the client is identifying itself to the server
282 void cmd_iden(char *argbuf)
290 if (num_parms(argbuf)<4) {
291 cprintf("%d usage error\n",ERROR);
295 dev_code = extract_int(argbuf,0);
296 cli_code = extract_int(argbuf,1);
297 rev_level = extract_int(argbuf,2);
298 extract(desc,argbuf,3);
300 strncpy(from_host,config.c_fqdn,sizeof from_host);
301 from_host[sizeof from_host - 1] = 0;
302 if (num_parms(argbuf)>=5) extract(from_host,argbuf,4);
304 CC->cs_clientdev = dev_code;
305 CC->cs_clienttyp = cli_code;
306 CC->cs_clientver = rev_level;
307 strncpy(CC->cs_clientname,desc,31);
308 CC->cs_clientname[31] = 0;
310 if ((strlen(from_host)>0) &&
311 (is_public_client(CC->cs_host))) {
312 strncpy(CC->cs_host,from_host,24);
315 set_wtmpsupp_to_current_room();
317 syslog(LOG_NOTICE,"client %d/%d/%01d.%02d (%s)\n",
323 cprintf("%d Ok\n",OK);
328 * enter or exit "stealth mode"
330 void cmd_stel(char *cmdbuf)
334 requested_mode = extract_int(cmdbuf,0);
335 if (requested_mode !=0) requested_mode = 1;
337 if (!CC->logged_in) {
338 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
342 if (CC->usersupp.axlevel < 6) {
343 cprintf("%d You must be an Aide to use stealth mode.\n",
344 ERROR+HIGHER_ACCESS_REQUIRED);
348 if (CC->cs_flags & CS_STEALTH) {
349 if (requested_mode == 0)
350 CC->cs_flags = CC->cs_flags-CS_STEALTH;
353 if (requested_mode == 1)
354 CC->cs_flags = CC->cs_flags|CS_STEALTH;
357 set_wtmpsupp_to_current_room();
358 cprintf("%d Ok\n",OK);
365 * display system messages or help
367 void cmd_mesg(char *mname)
374 extract(buf,mname,0);
379 strcpy(dirs[0],"messages");
380 strcpy(dirs[1],"help");
381 mesg_locate(targ,buf,2,dirs);
386 if (strlen(targ)==0) {
387 cprintf("%d '%s' not found.\n",ERROR,mname);
391 mfp = fopen(targ,"r");
393 cprintf("%d Cannot open '%s': %s\n",
394 ERROR,targ,strerror(errno));
397 cprintf("%d %s\n",LISTING_FOLLOWS,buf);
399 while (fgets(buf,255,mfp)!=NULL) {
400 buf[strlen(buf)-1] = 0;
411 * enter system messages or help
413 void cmd_emsg(char *mname)
421 if (CC->usersupp.axlevel < 6) {
422 cprintf("%d You must be an Aide to edit system messages.\n",
423 ERROR+HIGHER_ACCESS_REQUIRED);
427 extract(buf,mname,0);
428 for (a=0; a<strlen(buf); ++a) { /* security measure */
429 if (buf[a] == '/') buf[a] = '.';
434 strcpy(dirs[0],"messages");
435 strcpy(dirs[1],"help");
436 mesg_locate(targ,buf,2,dirs);
440 if (strlen(targ)==0) {
441 snprintf(targ, sizeof targ, "./help/%s", buf);
444 mfp = fopen(targ,"w");
446 cprintf("%d Cannot open '%s': %s\n",
447 ERROR,targ,strerror(errno));
450 cprintf("%d %s\n", SEND_LISTING, targ);
452 while (client_gets(buf), strcmp(buf, "000")) {
453 fprintf(mfp, "%s\n", buf);
463 void cmd_rwho(void) {
464 struct CitContext *cptr;
467 char un[40], room[40], host[40], flags[5];
469 aide = CC->usersupp.axlevel >= 6;
470 cprintf("%d\n",LISTING_FOLLOWS);
472 for (cptr = ContextList; cptr != NULL; cptr = cptr->next)
477 if (cptr->cs_flags & CS_POSTING)
482 if (cptr->fake_username[0])
484 strcpy(un, cptr->fake_username);
488 strcpy(un, cptr->curr_user);
490 if (cptr->fake_hostname[0])
492 strcpy(host, cptr->fake_hostname);
496 strcpy(host, cptr->cs_host);
498 if (cptr->fake_roomname[0])
500 strcpy(room, cptr->fake_roomname);
504 strcpy(room, cptr->cs_room);
507 if ((aide) && (spoofed))
510 if ((cptr->cs_flags & CS_STEALTH) && (aide))
513 if (((cptr->cs_flags&CS_STEALTH)==0) || (aide))
515 cprintf("%d|%s|%s|%s|%s|%ld|%s|%s\n",
516 cptr->cs_pid, un, room,
517 host, cptr->cs_clientname,
518 (long)(cptr->lastidle),
519 cptr->lastcmdname, flags);
521 if ((spoofed) && (aide))
523 cprintf("%d|%s|%s|%s|%s|%ld|%s|%s\n",
524 cptr->cs_pid, cptr->curr_user, cptr->cs_room,
525 cptr->cs_host, cptr->cs_clientname,
526 (long)(cptr->lastidle),
527 cptr->lastcmdname, flags);
536 * Terminate another running session
538 void cmd_term(char *cmdbuf)
541 struct CitContext *ccptr;
542 int session_to_kill = 0;
544 if (!CC->logged_in) {
545 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
549 if (CC->usersupp.axlevel < 6) {
550 cprintf("%d You must be an Aide to terminate sessions.\n",
551 ERROR+HIGHER_ACCESS_REQUIRED);
555 session_num = extract_int(cmdbuf, 0);
556 if (session_num == CC->cs_pid) {
557 cprintf("%d You can't kill your own session.\n", ERROR);
561 lprintf(9, "Locating session to kill\n");
562 begin_critical_section(S_SESSION_TABLE);
563 for (ccptr = ContextList; ccptr != NULL; ccptr = ccptr->next) {
564 if (session_num == ccptr->cs_pid) {
565 session_to_kill = ccptr->cs_pid;
568 end_critical_section(S_SESSION_TABLE);
569 lprintf(9, "session_to_kill == %d\n", session_to_kill);
571 if (session_to_kill > 0) {
572 lprintf(9, "calling kill_session()\n");
573 kill_session(session_to_kill);
574 cprintf("%d Session terminated.\n", OK);
577 cprintf("%d No such session.\n", ERROR);
586 * get the paginator prompt
588 void cmd_more(void) {
589 cprintf("%d %s\n",OK,config.c_moreprompt);
595 void cmd_echo(char *etext)
597 cprintf("%d %s\n",OK,etext);
603 * identify as internal program
605 void cmd_ipgm(char *argbuf)
609 secret = extract_int(argbuf, 0);
610 if (secret == config.c_ipgm_secret) {
611 CC->internal_pgm = 1;
612 strcpy(CC->curr_user, "<internal program>");
613 CC->cs_flags = CC->cs_flags|CS_STEALTH;
614 cprintf("%d Authenticated as an internal program.\n",OK);
617 cprintf("%d Authentication failed.\n",ERROR);
623 * Shut down the server
625 void cmd_down(void) {
626 if (!CC->logged_in) {
627 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
631 if (CC->usersupp.axlevel < 6) {
632 cprintf("%d You must be an Aide to shut down the server.\n",
633 ERROR+HIGHER_ACCESS_REQUIRED);
637 cprintf("%d Shutting down server. Goodbye.\n", OK);
642 * Schedule or cancel a server shutdown
644 void cmd_scdn(char *argbuf)
648 if (!CC->logged_in) {
649 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
653 if (CC->usersupp.axlevel < 6) {
654 cprintf("%d You must be an Aide to schedule a shutdown.\n",
655 ERROR+HIGHER_ACCESS_REQUIRED);
659 new_state = extract_int(argbuf, 0);
660 if ((new_state == 0) || (new_state == 1)) {
661 ScheduledShutdown = new_state;
663 cprintf("%d %d\n", OK, ScheduledShutdown);
670 void *context_loop(struct CitContext *con)
676 * Wedge our way into the context table.
681 * Initialize some variables specific to our context.
684 CC->internal_pgm = 0;
685 CC->download_fp = NULL;
686 CC->upload_fp = NULL;
687 CC->cs_pid = con->client_socket; /* not necessarily portable */
688 CC->ExpressMessages = NULL;
693 strcpy(CC->lastcmdname, " ");
694 strcpy(CC->cs_clientname, "(unknown)");
695 strcpy(CC->curr_user,"");
696 strcpy(CC->net_node,"");
697 snprintf(CC->temp, sizeof CC->temp, "/tmp/CitServer.%d.%d", getpid(), CC->cs_pid);
698 strcpy(CC->cs_room, "");
699 strncpy(CC->cs_host, config.c_fqdn, sizeof CC->cs_host);
700 CC->cs_host[sizeof CC->cs_host - 1] = 0;
701 locate_host(CC->cs_host);
703 CC->upload_type = UPL_FILE;
706 num_sessions = session_count();
708 if ((config.c_maxsessions > 0)&&(num_sessions > config.c_maxsessions))
711 if (CC->nologin==1) {
712 cprintf("%d %s: Too many users are already online (maximum is %d)\n",
713 ERROR+MAX_SESSIONS_EXCEEDED,
714 config.c_nodename,config.c_maxsessions);
717 cprintf("%d %s Citadel/UX server ready.\n",OK,config.c_nodename);
720 lprintf(3, "citserver[%3d]: started.\n", CC->cs_pid);
722 /* Run any session startup routines registered by loadable modules */
723 PerformSessionHooks(EVT_START);
725 rec_log(CL_CONNECT, "");
729 memset(cmdbuf, 0, sizeof cmdbuf); /* Clear it, just in case */
730 if (client_gets(cmdbuf) < 1) cleanup(EXIT_NULL);
731 lprintf(5, "citserver[%3d]: %s\n", CC->cs_pid, cmdbuf);
734 * Let other clients see the last command we executed, but
735 * exclude NOOP because that would be boring.
737 if (strncasecmp(cmdbuf, "NOOP", 4)) {
738 strcpy(CC->lastcmdname, " ");
739 strncpy(CC->lastcmdname, cmdbuf, 4);
743 if ((strncasecmp(cmdbuf, "ENT0", 4)) && (strncasecmp(cmdbuf, "MESG", 4)) && (strncasecmp(cmdbuf, "MSGS", 4)))
745 CC->cs_flags &= ~CS_POSTING;
749 * This loop recognizes all server commands.
752 if (!strncasecmp(cmdbuf,"NOOP",4)) {
753 cprintf("%d%cok\n",OK,check_express());
756 else if (!strncasecmp(cmdbuf,"QUIT",4)) {
757 cprintf("%d Goodbye.\n",OK);
760 else if (!strncasecmp(cmdbuf,"LOUT",4)) {
761 if (CC->logged_in) logout(CC);
762 cprintf("%d logged out.\n",OK);
765 else if (!strncasecmp(cmdbuf,"USER",4)) {
766 cmd_user(&cmdbuf[5]);
769 else if (!strncasecmp(cmdbuf,"PASS",4)) {
770 cmd_pass(&cmdbuf[5]);
773 else if (!strncasecmp(cmdbuf,"NEWU",4)) {
774 cmd_newu(&cmdbuf[5]);
777 else if (!strncasecmp(cmdbuf,"SETP",4)) {
778 cmd_setp(&cmdbuf[5]);
781 else if (!strncasecmp(cmdbuf,"LRMS",4)) {
782 cmd_lrms(&cmdbuf[5]);
785 else if (!strncasecmp(cmdbuf,"LKRA",4)) {
786 cmd_lkra(&cmdbuf[5]);
789 else if (!strncasecmp(cmdbuf,"LKRN",4)) {
790 cmd_lkrn(&cmdbuf[5]);
793 else if (!strncasecmp(cmdbuf,"LKRO",4)) {
794 cmd_lkro(&cmdbuf[5]);
797 else if (!strncasecmp(cmdbuf,"LZRM",4)) {
798 cmd_lzrm(&cmdbuf[5]);
801 else if (!strncasecmp(cmdbuf,"GETU",4)) {
805 else if (!strncasecmp(cmdbuf,"SETU",4)) {
806 cmd_setu(&cmdbuf[5]);
809 else if (!strncasecmp(cmdbuf,"GOTO",4)) {
810 cmd_goto(&cmdbuf[5]);
813 else if (!strncasecmp(cmdbuf,"MSGS",4)) {
814 cmd_msgs(&cmdbuf[5]);
817 else if (!strncasecmp(cmdbuf,"WHOK",4)) {
821 else if (!strncasecmp(cmdbuf,"RDIR",4)) {
825 else if (!strncasecmp(cmdbuf,"MSG0",4)) {
826 cmd_msg0(&cmdbuf[5]);
829 else if (!strncasecmp(cmdbuf,"MSG2",4)) {
830 cmd_msg2(&cmdbuf[5]);
833 else if (!strncasecmp(cmdbuf,"MSG3",4)) {
834 cmd_msg3(&cmdbuf[5]);
837 else if (!strncasecmp(cmdbuf,"MSG4",4)) {
838 cmd_msg4(&cmdbuf[5]);
841 else if (!strncasecmp(cmdbuf,"OPNA",4)) {
842 cmd_opna(&cmdbuf[5]);
845 else if (!strncasecmp(cmdbuf,"INFO",4)) {
849 else if (!strncasecmp(cmdbuf,"SLRP",4)) {
850 cmd_slrp(&cmdbuf[5]);
853 else if (!strncasecmp(cmdbuf,"INVT",4)) {
854 cmd_invt_kick(&cmdbuf[5],1);
857 else if (!strncasecmp(cmdbuf,"KICK",4)) {
858 cmd_invt_kick(&cmdbuf[5],0);
861 else if (!strncasecmp(cmdbuf,"GETR",4)) {
865 else if (!strncasecmp(cmdbuf,"SETR",4)) {
866 cmd_setr(&cmdbuf[5]);
869 else if (!strncasecmp(cmdbuf,"GETA",4)) {
873 else if (!strncasecmp(cmdbuf,"SETA",4)) {
874 cmd_seta(&cmdbuf[5]);
877 else if (!strncasecmp(cmdbuf,"ENT0",4)) {
878 cmd_ent0(&cmdbuf[5]);
881 else if (!strncasecmp(cmdbuf,"ENT3",4)) {
882 cmd_ent3(&cmdbuf[5]);
885 else if (!strncasecmp(cmdbuf,"RINF",4)) {
889 else if (!strncasecmp(cmdbuf,"DELE",4)) {
890 cmd_dele(&cmdbuf[5]);
893 else if (!strncasecmp(cmdbuf,"KILL",4)) {
894 cmd_kill(&cmdbuf[5]);
897 else if (!strncasecmp(cmdbuf,"CRE8",4)) {
898 cmd_cre8(&cmdbuf[5]);
901 else if (!strncasecmp(cmdbuf,"MOVE",4)) {
902 cmd_move(&cmdbuf[5]);
905 else if (!strncasecmp(cmdbuf,"FORG",4)) {
909 else if (!strncasecmp(cmdbuf,"MESG",4)) {
910 cmd_mesg(&cmdbuf[5]);
913 else if (!strncasecmp(cmdbuf,"EMSG",4)) {
914 cmd_emsg(&cmdbuf[5]);
917 else if (!strncasecmp(cmdbuf,"GNUR",4)) {
921 else if (!strncasecmp(cmdbuf,"GREG",4)) {
922 cmd_greg(&cmdbuf[5]);
925 else if (!strncasecmp(cmdbuf,"VALI",4)) {
926 cmd_vali(&cmdbuf[5]);
929 else if (!strncasecmp(cmdbuf,"EINF",4)) {
930 cmd_einf(&cmdbuf[5]);
933 else if (!strncasecmp(cmdbuf,"LIST",4)) {
937 else if (!strncasecmp(cmdbuf,"REGI",4)) {
941 else if (!strncasecmp(cmdbuf,"CHEK",4)) {
945 else if (!strncasecmp(cmdbuf,"DELF",4)) {
946 cmd_delf(&cmdbuf[5]);
949 else if (!strncasecmp(cmdbuf,"MOVF",4)) {
950 cmd_movf(&cmdbuf[5]);
953 else if (!strncasecmp(cmdbuf,"NETF",4)) {
954 cmd_netf(&cmdbuf[5]);
957 else if (!strncasecmp(cmdbuf,"RWHO",4)) {
961 else if (!strncasecmp(cmdbuf,"OPEN",4)) {
962 cmd_open(&cmdbuf[5]);
965 else if (!strncasecmp(cmdbuf,"CLOS",4)) {
969 else if (!strncasecmp(cmdbuf,"UOPN",4)) {
970 cmd_uopn(&cmdbuf[5]);
973 else if (!strncasecmp(cmdbuf,"UCLS",4)) {
974 cmd_ucls(&cmdbuf[5]);
977 else if (!strncasecmp(cmdbuf,"READ",4)) {
978 cmd_read(&cmdbuf[5]);
981 else if (!strncasecmp(cmdbuf,"WRIT",4)) {
982 cmd_writ(&cmdbuf[5]);
985 else if (!strncasecmp(cmdbuf,"QUSR",4)) {
986 cmd_qusr(&cmdbuf[5]);
989 else if (!strncasecmp(cmdbuf,"ECHO",4)) {
990 cmd_echo(&cmdbuf[5]);
993 else if (!strncasecmp(cmdbuf,"OIMG",4)) {
994 cmd_oimg(&cmdbuf[5]);
997 else if (!strncasecmp(cmdbuf,"MORE",4)) {
1001 else if (!strncasecmp(cmdbuf,"NETP",4)) {
1002 cmd_netp(&cmdbuf[5]);
1005 else if (!strncasecmp(cmdbuf,"NDOP",4)) {
1006 cmd_ndop(&cmdbuf[5]);
1009 else if (!strncasecmp(cmdbuf,"NUOP",4)) {
1010 cmd_nuop(&cmdbuf[5]);
1013 else if (!strncasecmp(cmdbuf,"LFLR",4)) {
1017 else if (!strncasecmp(cmdbuf,"CFLR",4)) {
1018 cmd_cflr(&cmdbuf[5]);
1021 else if (!strncasecmp(cmdbuf,"KFLR",4)) {
1022 cmd_kflr(&cmdbuf[5]);
1025 else if (!strncasecmp(cmdbuf,"EFLR",4)) {
1026 cmd_eflr(&cmdbuf[5]);
1029 else if (!strncasecmp(cmdbuf,"IDEN",4)) {
1030 cmd_iden(&cmdbuf[5]);
1033 else if (!strncasecmp(cmdbuf,"IPGM",4)) {
1034 cmd_ipgm(&cmdbuf[5]);
1037 else if (!strncasecmp(cmdbuf,"EBIO",4)) {
1041 else if (!strncasecmp(cmdbuf,"RBIO",4)) {
1042 cmd_rbio(&cmdbuf[5]);
1045 else if (!strncasecmp(cmdbuf,"LBIO",4)) {
1049 else if (!strncasecmp(cmdbuf,"STEL",4)) {
1050 cmd_stel(&cmdbuf[5]);
1053 else if (!strncasecmp(cmdbuf,"TERM",4)) {
1054 cmd_term(&cmdbuf[5]);
1057 else if (!strncasecmp(cmdbuf,"DOWN",4)) {
1061 else if (!strncasecmp(cmdbuf,"SCDN",4)) {
1062 cmd_scdn(&cmdbuf[5]);
1065 else if (!strncasecmp(cmdbuf, "NSET", 4)) {
1066 cmd_nset(&cmdbuf[5]);
1069 else if (!strncasecmp(cmdbuf, "UIMG", 4)) {
1070 cmd_uimg(&cmdbuf[5]);
1073 else if (!strncasecmp(cmdbuf, "UCHG", 4)) {
1074 cmd_uchg(&cmdbuf[5]);
1077 else if (!strncasecmp(cmdbuf, "TIME", 4)) {
1081 else if (!strncasecmp(cmdbuf, "HCHG", 4)) {
1082 cmd_hchg(&cmdbuf[5]);
1085 else if (!strncasecmp(cmdbuf, "RCHG", 4)) {
1086 cmd_rchg(&cmdbuf[5]);
1089 else if (!strncasecmp(cmdbuf, "AGUP", 4)) {
1090 cmd_agup(&cmdbuf[5]);
1093 else if (!strncasecmp(cmdbuf, "ASUP", 4)) {
1094 cmd_asup(&cmdbuf[5]);
1097 else if (!strncasecmp(cmdbuf, "GPEX", 4)) {
1098 cmd_gpex(&cmdbuf[5]);
1101 else if (!strncasecmp(cmdbuf, "SPEX", 4)) {
1102 cmd_spex(&cmdbuf[5]);
1105 else if (!strncasecmp(cmdbuf, "CONF", 4)) {
1106 cmd_conf(&cmdbuf[5]);
1109 #ifdef DEBUG_MEMORY_LEAKS
1110 else if (!strncasecmp(cmdbuf, "LEAK", 4)) {
1115 else if (!DLoader_Exec_Cmd(cmdbuf))
1117 cprintf("%d Unrecognized or unsupported command.\n",
1121 } while(strncasecmp(cmdbuf, "QUIT", 4));
1123 cleanup(EXIT_NORMAL);