17 #include "sysdep_decls.h"
18 #include "citserver.h"
21 #include "housekeeping.h"
26 #include "locate_host.h"
29 #include "dynloader.h"
33 struct CitContext *ContextList = NULL;
34 int ScheduledShutdown = 0;
37 * Various things that need to be initialized at startup
39 void master_startup(void) {
40 lprintf(7, "Opening databases\n");
43 lprintf(7, "Checking floor reference counts\n");
46 lprintf(7, "Creating base rooms (if necessary)\n");
47 create_room(BASEROOM, 0, "", 0);
48 create_room(AIDEROOM, 4, "", 0);
49 create_room(config.c_twitroom, 0, "", 0);
53 * Cleanup routine to be called when the server is shutting down.
55 void master_cleanup(void) {
56 struct CleanupFunctionHook *fcn;
58 /* Cancel all running sessions */
59 lprintf(7, "Cancelling running sessions...\n");
60 while (ContextList != NULL) {
61 kill_session(ContextList->cs_pid);
64 /* Run any cleanup routines registered by loadable modules */
65 for (fcn = CleanupHookTable; fcn != NULL; fcn = fcn->next) {
66 (*fcn->h_function_pointer)();
70 lprintf(7, "Closing databases\n");
73 /* Do system-dependent stuff */
74 sysdep_master_cleanup();
77 lprintf(3, "citserver: exiting.\n");
78 fflush(stdout); fflush(stderr);
84 * Gracefully terminate the session and thread.
85 * (This is called as a cleanup handler by the thread library.)
87 * All NON-system-dependent stuff is done in this function.
88 * System-dependent session/thread cleanup is in cleanup() in sysdep.c
90 void cleanup_stuff(void *arg)
92 struct ExpressMessage *emptr;
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 while (CC->FirstExpressMessage != NULL) {
111 emptr = CC->FirstExpressMessage;
112 CC->FirstExpressMessage = CC->FirstExpressMessage->next;
115 end_critical_section(S_SESSION_TABLE);
117 /* Deallocate any message list we might have in memory */
118 if (CC->msglist != NULL) free(CC->msglist);
120 /* Purge any stale user/room relationships */
121 PurgeStaleRelationships();
123 /* Now get rid of the session and context */
124 lprintf(7, "cleanup_stuff() calling RemoveContext(%d)\n", CC->cs_pid);
127 /* While we still have an extra thread with no user attached to it,
128 * take the opportunity to do some housekeeping before exiting.
135 * set_wtmpsupp() - alter the session listing
137 void set_wtmpsupp(char *newtext)
139 strncpy(CC->cs_room,newtext,sizeof CC->cs_room);
140 CC->cs_room[sizeof CC->cs_room - 1] = 0;
141 time(&CC->cs_lastupdt);
143 /* Run any routines registered by loadable modules */
144 PerformSessionHooks(EVT_NEWROOM);
149 * call set_wtmpsupp() with the name of the current room, modified a bit...
151 void set_wtmpsupp_to_current_room() {
152 if (CC->quickroom.QRflags & QR_PRIVATE) {
153 set_wtmpsupp("<private room>");
155 else if (CC->quickroom.QRflags & QR_MAILBOX) {
156 set_wtmpsupp(&CC->quickroom.QRname[11]);
159 set_wtmpsupp(CC->quickroom.QRname);
166 * cmd_info() - tell the client about this server
168 void cmd_info(void) {
169 cprintf("%d Server info:\n",LISTING_FOLLOWS);
170 cprintf("%d\n",CC->cs_pid);
171 cprintf("%s\n",config.c_nodename);
172 cprintf("%s\n",config.c_humannode);
173 cprintf("%s\n",config.c_fqdn);
174 cprintf("%s\n",CITADEL);
175 cprintf("%d\n",REV_LEVEL);
176 cprintf("%s\n",config.c_bbs_city);
177 cprintf("%s\n",config.c_sysadm);
178 cprintf("%d\n",SERVER_TYPE);
179 cprintf("%s\n",config.c_moreprompt);
180 cprintf("1\n"); /* 1 = yes, this system supports floors */
184 void cmd_rchg(char *newroomname)
186 if ((newroomname) && (newroomname[0]))
188 bzero(CC->fake_roomname, ROOMNAMELEN);
189 strncpy(CC->fake_roomname, newroomname, ROOMNAMELEN-1);
192 strcpy(CC->fake_roomname, "");
193 cprintf("%d OK\n",OK);
196 void cmd_hchg(char *newhostname)
198 if ((newhostname) && (newhostname[0]))
200 bzero(CC->fake_hostname, 25);
201 strncpy(CC->fake_hostname, newhostname, 24);
204 strcpy(CC->fake_hostname, "");
205 cprintf("%d OK\n",OK);
208 void cmd_uchg(char *newusername)
210 if (CC->usersupp.axlevel < 6)
212 cprintf("%d You must be an Aide to use UCHG.\n",
213 ERROR+HIGHER_ACCESS_REQUIRED);
216 if ((newusername) && (newusername[0]))
218 CC->cs_flags &= ~CS_STEALTH;
219 bzero(CC->fake_username, 32);
220 if (strncasecmp(newusername, CC->curr_user, strlen(CC->curr_user)))
221 strncpy(CC->fake_username, newusername, 31);
225 CC->fake_username[0] = '\0';
226 CC->cs_flags |= CS_STEALTH;
232 * returns an asterisk if there are any express messages waiting,
235 char check_express(void) {
236 if (CC->FirstExpressMessage == NULL) {
250 cprintf("%d %ld\n", OK, tv);
254 * check a hostname against the public_clients file
256 int is_public_client(char *where)
261 if (!strcasecmp(where,"localhost")) return(1);
262 if (!strcasecmp(where,config.c_fqdn)) return(1);
264 fp = fopen("public_clients","r");
265 if (fp == NULL) return(0);
267 while (fgets(buf,256,fp)!=NULL) {
268 while (isspace((buf[strlen(buf)-1])))
269 buf[strlen(buf)-1] = 0;
270 if (!strcasecmp(buf,where)) {
282 * the client is identifying itself to the server
284 void cmd_iden(char *argbuf)
292 if (num_parms(argbuf)<4) {
293 cprintf("%d usage error\n",ERROR);
297 dev_code = extract_int(argbuf,0);
298 cli_code = extract_int(argbuf,1);
299 rev_level = extract_int(argbuf,2);
300 extract(desc,argbuf,3);
302 strncpy(from_host,config.c_fqdn,sizeof from_host);
303 from_host[sizeof from_host - 1] = 0;
304 if (num_parms(argbuf)>=5) extract(from_host,argbuf,4);
306 CC->cs_clientdev = dev_code;
307 CC->cs_clienttyp = cli_code;
308 CC->cs_clientver = rev_level;
309 strncpy(CC->cs_clientname,desc,31);
310 CC->cs_clientname[31] = 0;
312 if ((strlen(from_host)>0) &&
313 (is_public_client(CC->cs_host))) {
314 strncpy(CC->cs_host,from_host,24);
317 set_wtmpsupp_to_current_room();
319 syslog(LOG_NOTICE,"client %d/%d/%01d.%02d (%s)\n",
325 cprintf("%d Ok\n",OK);
330 * enter or exit "stealth mode"
332 void cmd_stel(char *cmdbuf)
336 requested_mode = extract_int(cmdbuf,0);
337 if (requested_mode !=0) requested_mode = 1;
339 if (!CC->logged_in) {
340 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
344 if (CC->usersupp.axlevel < 6) {
345 cprintf("%d You must be an Aide to use stealth mode.\n",
346 ERROR+HIGHER_ACCESS_REQUIRED);
350 if (CC->cs_flags & CS_STEALTH) {
351 if (requested_mode == 0)
352 CC->cs_flags = CC->cs_flags-CS_STEALTH;
355 if (requested_mode == 1)
356 CC->cs_flags = CC->cs_flags|CS_STEALTH;
359 set_wtmpsupp_to_current_room();
360 cprintf("%d Ok\n",OK);
367 * display system messages or help
369 void cmd_mesg(char *mname)
376 extract(buf,mname,0);
381 strcpy(dirs[0],"messages");
382 strcpy(dirs[1],"help");
383 mesg_locate(targ,buf,2,dirs);
388 if (strlen(targ)==0) {
389 cprintf("%d '%s' not found.\n",ERROR,mname);
393 mfp = fopen(targ,"r");
395 cprintf("%d Cannot open '%s': %s\n",
396 ERROR,targ,strerror(errno));
399 cprintf("%d %s\n",LISTING_FOLLOWS,buf);
401 while (fgets(buf,255,mfp)!=NULL) {
402 buf[strlen(buf)-1] = 0;
413 * enter system messages or help
415 void cmd_emsg(char *mname)
423 if (CC->usersupp.axlevel < 6) {
424 cprintf("%d You must be an Aide to edit system messages.\n",
425 ERROR+HIGHER_ACCESS_REQUIRED);
429 extract(buf,mname,0);
430 for (a=0; a<strlen(buf); ++a) { /* security measure */
431 if (buf[a] == '/') buf[a] = '.';
436 strcpy(dirs[0],"messages");
437 strcpy(dirs[1],"help");
438 mesg_locate(targ,buf,2,dirs);
442 if (strlen(targ)==0) {
443 snprintf(targ, sizeof targ, "./help/%s", buf);
446 mfp = fopen(targ,"w");
448 cprintf("%d Cannot open '%s': %s\n",
449 ERROR,targ,strerror(errno));
452 cprintf("%d %s\n", SEND_LISTING, targ);
454 while (client_gets(buf), strcmp(buf, "000")) {
455 fprintf(mfp, "%s\n", buf);
465 void cmd_rwho(void) {
466 struct CitContext *cptr;
469 char un[40], room[40], host[40], flags[5];
471 aide = CC->usersupp.axlevel >= 6;
472 cprintf("%d\n",LISTING_FOLLOWS);
474 for (cptr = ContextList; cptr != NULL; cptr = cptr->next)
479 if (cptr->cs_flags & CS_POSTING)
484 if (cptr->fake_username[0])
486 strcpy(un, cptr->fake_username);
490 strcpy(un, cptr->curr_user);
492 if (cptr->fake_hostname[0])
494 strcpy(host, cptr->fake_hostname);
498 strcpy(host, cptr->cs_host);
500 if (cptr->fake_roomname[0])
502 strcpy(room, cptr->fake_roomname);
506 strcpy(room, cptr->cs_room);
509 if ((aide) && (spoofed))
512 if ((cptr->cs_flags & CS_STEALTH) && (aide))
515 if (((cptr->cs_flags&CS_STEALTH)==0) || (aide))
517 cprintf("%d|%s|%s|%s|%s|%ld|%s|%s\n",
518 cptr->cs_pid, un, room,
519 host, cptr->cs_clientname,
520 (long)(cptr->lastidle),
521 cptr->lastcmdname, flags);
523 if ((spoofed) && (aide))
525 cprintf("%d|%s|%s|%s|%s|%ld|%s|%s\n",
526 cptr->cs_pid, cptr->curr_user, cptr->cs_room,
527 cptr->cs_host, cptr->cs_clientname,
528 (long)(cptr->lastidle),
529 cptr->lastcmdname, flags);
538 * Terminate another running session
540 void cmd_term(char *cmdbuf)
543 struct CitContext *ccptr;
545 if (!CC->logged_in) {
546 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
550 if (CC->usersupp.axlevel < 6) {
551 cprintf("%d You must be an Aide to terminate sessions.\n",
552 ERROR+HIGHER_ACCESS_REQUIRED);
556 session_num = extract_int(cmdbuf, 0);
557 if (session_num == CC->cs_pid) {
558 cprintf("%d You can't kill your own session.\n", ERROR);
562 for (ccptr = ContextList; ccptr != NULL; ccptr = ccptr->next) {
563 if (session_num == ccptr->cs_pid) {
564 kill_session(ccptr->cs_pid);
565 cprintf("%d Session terminated.\n", OK);
570 cprintf("%d No such session.\n", ERROR);
578 * get the paginator prompt
580 void cmd_more(void) {
581 cprintf("%d %s\n",OK,config.c_moreprompt);
587 void cmd_echo(char *etext)
589 cprintf("%d %s\n",OK,etext);
595 * identify as internal program
597 void cmd_ipgm(char *argbuf)
601 secret = extract_int(argbuf, 0);
602 if (secret == config.c_ipgm_secret) {
603 CC->internal_pgm = 1;
604 strcpy(CC->curr_user, "<internal program>");
605 CC->cs_flags = CC->cs_flags|CS_STEALTH;
606 cprintf("%d Authenticated as an internal program.\n",OK);
609 cprintf("%d Authentication failed.\n",ERROR);
615 * Shut down the server
617 void cmd_down(void) {
618 if (!CC->logged_in) {
619 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
623 if (CC->usersupp.axlevel < 6) {
624 cprintf("%d You must be an Aide to shut down the server.\n",
625 ERROR+HIGHER_ACCESS_REQUIRED);
629 cprintf("%d Shutting down server. Goodbye.\n", OK);
634 * Schedule or cancel a server shutdown
636 void cmd_scdn(char *argbuf)
640 if (!CC->logged_in) {
641 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
645 if (CC->usersupp.axlevel < 6) {
646 cprintf("%d You must be an Aide to schedule a shutdown.\n",
647 ERROR+HIGHER_ACCESS_REQUIRED);
651 new_state = extract_int(argbuf, 0);
652 if ((new_state == 0) || (new_state == 1)) {
653 ScheduledShutdown = new_state;
655 cprintf("%d %d\n", OK, ScheduledShutdown);
662 void *context_loop(struct CitContext *con)
668 * Wedge our way into the context table.
673 * Initialize some variables specific to our context.
676 CC->internal_pgm = 0;
677 CC->download_fp = NULL;
678 CC->upload_fp = NULL;
679 CC->cs_pid = con->client_socket; /* not necessarily portable */
680 CC->FirstExpressMessage = NULL;
685 strcpy(CC->lastcmdname, " ");
686 strcpy(CC->cs_clientname, "(unknown)");
687 strcpy(CC->curr_user,"");
688 strcpy(CC->net_node,"");
689 snprintf(CC->temp, sizeof CC->temp, "/tmp/CitServer.%d.%d", getpid(), CC->cs_pid);
690 strcpy(CC->cs_room, "");
691 strncpy(CC->cs_host, config.c_fqdn, sizeof CC->cs_host);
692 CC->cs_host[sizeof CC->cs_host - 1] = 0;
693 locate_host(CC->cs_host);
695 CC->upload_type = UPL_FILE;
698 session_num = session_count();
700 if ((config.c_maxsessions > 0)&&(session_num >= config.c_maxsessions))
703 if (CC->nologin==1) {
704 cprintf("%d %s: Too many users are already online (maximum is %d)\n",
705 ERROR+MAX_SESSIONS_EXCEEDED,
706 config.c_nodename,config.c_maxsessions);
709 cprintf("%d %s Citadel/UX server ready.\n",OK,config.c_nodename);
712 lprintf(3, "citserver[%3d]: started.\n", CC->cs_pid);
714 /* Run any session startup routines registered by loadable modules */
715 PerformSessionHooks(EVT_START);
717 rec_log(CL_CONNECT, "");
721 bzero(cmdbuf, sizeof cmdbuf); /* Clear it, just in case */
722 if (client_gets(cmdbuf) < 1) cleanup(EXIT_NULL);
723 lprintf(5, "citserver[%3d]: %s\n", CC->cs_pid, cmdbuf);
726 * Let other clients see the last command we executed, but
727 * exclude NOOP because that would be boring.
729 if (strncasecmp(cmdbuf, "NOOP", 4)) {
730 strcpy(CC->lastcmdname, " ");
731 strncpy(CC->lastcmdname, cmdbuf, 4);
735 if ((strncasecmp(cmdbuf, "ENT0", 4)) && (strncasecmp(cmdbuf, "MESG", 4)) && (strncasecmp(cmdbuf, "MSGS", 4)))
737 CC->cs_flags &= ~CS_POSTING;
741 * This loop recognizes all server commands.
744 if (!strncasecmp(cmdbuf,"NOOP",4)) {
745 cprintf("%d%cok\n",OK,check_express());
748 else if (!strncasecmp(cmdbuf,"QUIT",4)) {
749 cprintf("%d Goodbye.\n",OK);
752 else if (!strncasecmp(cmdbuf,"LOUT",4)) {
753 if (CC->logged_in) logout(CC);
754 cprintf("%d logged out.\n",OK);
757 else if (!strncasecmp(cmdbuf,"USER",4)) {
758 cmd_user(&cmdbuf[5]);
761 else if (!strncasecmp(cmdbuf,"PASS",4)) {
762 cmd_pass(&cmdbuf[5]);
765 else if (!strncasecmp(cmdbuf,"NEWU",4)) {
766 cmd_newu(&cmdbuf[5]);
769 else if (!strncasecmp(cmdbuf,"SETP",4)) {
770 cmd_setp(&cmdbuf[5]);
773 else if (!strncasecmp(cmdbuf,"LRMS",4)) {
774 cmd_lrms(&cmdbuf[5]);
777 else if (!strncasecmp(cmdbuf,"LKRA",4)) {
778 cmd_lkra(&cmdbuf[5]);
781 else if (!strncasecmp(cmdbuf,"LKRN",4)) {
782 cmd_lkrn(&cmdbuf[5]);
785 else if (!strncasecmp(cmdbuf,"LKRO",4)) {
786 cmd_lkro(&cmdbuf[5]);
789 else if (!strncasecmp(cmdbuf,"LZRM",4)) {
790 cmd_lzrm(&cmdbuf[5]);
793 else if (!strncasecmp(cmdbuf,"GETU",4)) {
797 else if (!strncasecmp(cmdbuf,"SETU",4)) {
798 cmd_setu(&cmdbuf[5]);
801 else if (!strncasecmp(cmdbuf,"GOTO",4)) {
802 cmd_goto(&cmdbuf[5]);
805 else if (!strncasecmp(cmdbuf,"MSGS",4)) {
806 cmd_msgs(&cmdbuf[5]);
809 else if (!strncasecmp(cmdbuf,"WHOK",4)) {
813 else if (!strncasecmp(cmdbuf,"RDIR",4)) {
817 else if (!strncasecmp(cmdbuf,"MSG0",4)) {
818 cmd_msg0(&cmdbuf[5]);
821 else if (!strncasecmp(cmdbuf,"MSG2",4)) {
822 cmd_msg2(&cmdbuf[5]);
825 else if (!strncasecmp(cmdbuf,"MSG3",4)) {
826 cmd_msg3(&cmdbuf[5]);
829 else if (!strncasecmp(cmdbuf,"INFO",4)) {
833 else if (!strncasecmp(cmdbuf,"SLRP",4)) {
834 cmd_slrp(&cmdbuf[5]);
837 else if (!strncasecmp(cmdbuf,"INVT",4)) {
838 cmd_invt_kick(&cmdbuf[5],1);
841 else if (!strncasecmp(cmdbuf,"KICK",4)) {
842 cmd_invt_kick(&cmdbuf[5],0);
845 else if (!strncasecmp(cmdbuf,"GETR",4)) {
849 else if (!strncasecmp(cmdbuf,"SETR",4)) {
850 cmd_setr(&cmdbuf[5]);
853 else if (!strncasecmp(cmdbuf,"GETA",4)) {
857 else if (!strncasecmp(cmdbuf,"SETA",4)) {
858 cmd_seta(&cmdbuf[5]);
861 else if (!strncasecmp(cmdbuf,"ENT0",4)) {
862 cmd_ent0(&cmdbuf[5]);
865 else if (!strncasecmp(cmdbuf,"ENT3",4)) {
866 cmd_ent3(&cmdbuf[5]);
869 else if (!strncasecmp(cmdbuf,"RINF",4)) {
873 else if (!strncasecmp(cmdbuf,"DELE",4)) {
874 cmd_dele(&cmdbuf[5]);
877 else if (!strncasecmp(cmdbuf,"KILL",4)) {
878 cmd_kill(&cmdbuf[5]);
881 else if (!strncasecmp(cmdbuf,"CRE8",4)) {
882 cmd_cre8(&cmdbuf[5]);
885 else if (!strncasecmp(cmdbuf,"MOVE",4)) {
886 cmd_move(&cmdbuf[5]);
889 else if (!strncasecmp(cmdbuf,"FORG",4)) {
893 else if (!strncasecmp(cmdbuf,"MESG",4)) {
894 cmd_mesg(&cmdbuf[5]);
897 else if (!strncasecmp(cmdbuf,"EMSG",4)) {
898 cmd_emsg(&cmdbuf[5]);
901 else if (!strncasecmp(cmdbuf,"GNUR",4)) {
905 else if (!strncasecmp(cmdbuf,"GREG",4)) {
906 cmd_greg(&cmdbuf[5]);
909 else if (!strncasecmp(cmdbuf,"VALI",4)) {
910 cmd_vali(&cmdbuf[5]);
913 else if (!strncasecmp(cmdbuf,"EINF",4)) {
914 cmd_einf(&cmdbuf[5]);
917 else if (!strncasecmp(cmdbuf,"LIST",4)) {
921 else if (!strncasecmp(cmdbuf,"REGI",4)) {
925 else if (!strncasecmp(cmdbuf,"CHEK",4)) {
929 else if (!strncasecmp(cmdbuf,"DELF",4)) {
930 cmd_delf(&cmdbuf[5]);
933 else if (!strncasecmp(cmdbuf,"MOVF",4)) {
934 cmd_movf(&cmdbuf[5]);
937 else if (!strncasecmp(cmdbuf,"NETF",4)) {
938 cmd_netf(&cmdbuf[5]);
941 else if (!strncasecmp(cmdbuf,"RWHO",4)) {
945 else if (!strncasecmp(cmdbuf,"OPEN",4)) {
946 cmd_open(&cmdbuf[5]);
949 else if (!strncasecmp(cmdbuf,"CLOS",4)) {
953 else if (!strncasecmp(cmdbuf,"UOPN",4)) {
954 cmd_uopn(&cmdbuf[5]);
957 else if (!strncasecmp(cmdbuf,"UCLS",4)) {
958 cmd_ucls(&cmdbuf[5]);
961 else if (!strncasecmp(cmdbuf,"READ",4)) {
962 cmd_read(&cmdbuf[5]);
965 else if (!strncasecmp(cmdbuf,"WRIT",4)) {
966 cmd_writ(&cmdbuf[5]);
969 else if (!strncasecmp(cmdbuf,"QUSR",4)) {
970 cmd_qusr(&cmdbuf[5]);
973 else if (!strncasecmp(cmdbuf,"ECHO",4)) {
974 cmd_echo(&cmdbuf[5]);
977 else if (!strncasecmp(cmdbuf,"OIMG",4)) {
978 cmd_oimg(&cmdbuf[5]);
981 else if (!strncasecmp(cmdbuf,"MORE",4)) {
985 else if (!strncasecmp(cmdbuf,"NETP",4)) {
986 cmd_netp(&cmdbuf[5]);
989 else if (!strncasecmp(cmdbuf,"NDOP",4)) {
990 cmd_ndop(&cmdbuf[5]);
993 else if (!strncasecmp(cmdbuf,"NUOP",4)) {
994 cmd_nuop(&cmdbuf[5]);
997 else if (!strncasecmp(cmdbuf,"LFLR",4)) {
1001 else if (!strncasecmp(cmdbuf,"CFLR",4)) {
1002 cmd_cflr(&cmdbuf[5]);
1005 else if (!strncasecmp(cmdbuf,"KFLR",4)) {
1006 cmd_kflr(&cmdbuf[5]);
1009 else if (!strncasecmp(cmdbuf,"EFLR",4)) {
1010 cmd_eflr(&cmdbuf[5]);
1013 else if (!strncasecmp(cmdbuf,"IDEN",4)) {
1014 cmd_iden(&cmdbuf[5]);
1017 else if (!strncasecmp(cmdbuf,"IPGM",4)) {
1018 cmd_ipgm(&cmdbuf[5]);
1021 else if (!strncasecmp(cmdbuf,"EBIO",4)) {
1025 else if (!strncasecmp(cmdbuf,"RBIO",4)) {
1026 cmd_rbio(&cmdbuf[5]);
1029 else if (!strncasecmp(cmdbuf,"LBIO",4)) {
1033 else if (!strncasecmp(cmdbuf,"STEL",4)) {
1034 cmd_stel(&cmdbuf[5]);
1037 else if (!strncasecmp(cmdbuf,"TERM",4)) {
1038 cmd_term(&cmdbuf[5]);
1041 else if (!strncasecmp(cmdbuf,"DOWN",4)) {
1045 else if (!strncasecmp(cmdbuf,"SCDN",4)) {
1046 cmd_scdn(&cmdbuf[5]);
1049 else if (!strncasecmp(cmdbuf, "NSET", 4)) {
1050 cmd_nset(&cmdbuf[5]);
1053 else if (!strncasecmp(cmdbuf, "UIMG", 4)) {
1054 cmd_uimg(&cmdbuf[5]);
1057 else if (!strncasecmp(cmdbuf, "UCHG", 4)) {
1058 cmd_uchg(&cmdbuf[5]);
1061 else if (!strncasecmp(cmdbuf, "TIME", 4)) {
1065 else if (!strncasecmp(cmdbuf, "HCHG", 4)) {
1066 cmd_hchg(&cmdbuf[5]);
1069 else if (!strncasecmp(cmdbuf, "RCHG", 4)) {
1070 cmd_rchg(&cmdbuf[5]);
1073 else if (!strncasecmp(cmdbuf, "AGUP", 4)) {
1074 cmd_agup(&cmdbuf[5]);
1077 else if (!strncasecmp(cmdbuf, "ASUP", 4)) {
1078 cmd_asup(&cmdbuf[5]);
1081 else if (!strncasecmp(cmdbuf, "GPEX", 4)) {
1082 cmd_gpex(&cmdbuf[5]);
1085 else if (!strncasecmp(cmdbuf, "SPEX", 4)) {
1086 cmd_spex(&cmdbuf[5]);
1089 else if (!strncasecmp(cmdbuf, "CONF", 4)) {
1090 cmd_conf(&cmdbuf[5]);
1093 else if (!DLoader_Exec_Cmd(cmdbuf))
1095 cprintf("%d Unrecognized or unsupported command.\n",
1099 } while(strncasecmp(cmdbuf, "QUIT", 4));
1101 cleanup(EXIT_NORMAL);