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 *argbuf)
186 char newroomname[ROOMNAMELEN];
188 extract(newroomname, argbuf, 0);
189 if (strlen(newroomname) > 0) {
190 strncpy(CC->fake_roomname, newroomname, ROOMNAMELEN);
191 CC->fake_roomname[ROOMNAMELEN - 1] = 0;
194 strcpy(CC->fake_roomname, "");
196 cprintf("%d OK\n", OK);
199 void cmd_hchg(char *newhostname)
201 if ((newhostname) && (newhostname[0]))
203 bzero(CC->fake_hostname, 25);
204 strncpy(CC->fake_hostname, newhostname, 24);
207 strcpy(CC->fake_hostname, "");
208 cprintf("%d OK\n",OK);
211 void cmd_uchg(char *newusername)
213 if (CC->usersupp.axlevel < 6)
215 cprintf("%d You must be an Aide to use UCHG.\n",
216 ERROR+HIGHER_ACCESS_REQUIRED);
219 if ((newusername) && (newusername[0]))
221 CC->cs_flags &= ~CS_STEALTH;
222 bzero(CC->fake_username, 32);
223 if (strncasecmp(newusername, CC->curr_user, strlen(CC->curr_user)))
224 strncpy(CC->fake_username, newusername, 31);
228 CC->fake_username[0] = '\0';
229 CC->cs_flags |= CS_STEALTH;
235 * returns an asterisk if there are any express messages waiting,
238 char check_express(void) {
239 if (CC->FirstExpressMessage == NULL) {
253 cprintf("%d %ld\n", OK, tv);
257 * check a hostname against the public_clients file
259 int is_public_client(char *where)
264 if (!strcasecmp(where,"localhost")) return(1);
265 if (!strcasecmp(where,config.c_fqdn)) return(1);
267 fp = fopen("public_clients","r");
268 if (fp == NULL) return(0);
270 while (fgets(buf,256,fp)!=NULL) {
271 while (isspace((buf[strlen(buf)-1])))
272 buf[strlen(buf)-1] = 0;
273 if (!strcasecmp(buf,where)) {
285 * the client is identifying itself to the server
287 void cmd_iden(char *argbuf)
295 if (num_parms(argbuf)<4) {
296 cprintf("%d usage error\n",ERROR);
300 dev_code = extract_int(argbuf,0);
301 cli_code = extract_int(argbuf,1);
302 rev_level = extract_int(argbuf,2);
303 extract(desc,argbuf,3);
305 strncpy(from_host,config.c_fqdn,sizeof from_host);
306 from_host[sizeof from_host - 1] = 0;
307 if (num_parms(argbuf)>=5) extract(from_host,argbuf,4);
309 CC->cs_clientdev = dev_code;
310 CC->cs_clienttyp = cli_code;
311 CC->cs_clientver = rev_level;
312 strncpy(CC->cs_clientname,desc,31);
313 CC->cs_clientname[31] = 0;
315 if ((strlen(from_host)>0) &&
316 (is_public_client(CC->cs_host))) {
317 strncpy(CC->cs_host,from_host,24);
320 set_wtmpsupp_to_current_room();
322 syslog(LOG_NOTICE,"client %d/%d/%01d.%02d (%s)\n",
328 cprintf("%d Ok\n",OK);
333 * enter or exit "stealth mode"
335 void cmd_stel(char *cmdbuf)
339 requested_mode = extract_int(cmdbuf,0);
340 if (requested_mode !=0) requested_mode = 1;
342 if (!CC->logged_in) {
343 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
347 if (CC->usersupp.axlevel < 6) {
348 cprintf("%d You must be an Aide to use stealth mode.\n",
349 ERROR+HIGHER_ACCESS_REQUIRED);
353 if (CC->cs_flags & CS_STEALTH) {
354 if (requested_mode == 0)
355 CC->cs_flags = CC->cs_flags-CS_STEALTH;
358 if (requested_mode == 1)
359 CC->cs_flags = CC->cs_flags|CS_STEALTH;
362 set_wtmpsupp_to_current_room();
363 cprintf("%d Ok\n",OK);
370 * display system messages or help
372 void cmd_mesg(char *mname)
379 extract(buf,mname,0);
384 strcpy(dirs[0],"messages");
385 strcpy(dirs[1],"help");
386 mesg_locate(targ,buf,2,dirs);
391 if (strlen(targ)==0) {
392 cprintf("%d '%s' not found.\n",ERROR,mname);
396 mfp = fopen(targ,"r");
398 cprintf("%d Cannot open '%s': %s\n",
399 ERROR,targ,strerror(errno));
402 cprintf("%d %s\n",LISTING_FOLLOWS,buf);
404 while (fgets(buf,255,mfp)!=NULL) {
405 buf[strlen(buf)-1] = 0;
416 * enter system messages or help
418 void cmd_emsg(char *mname)
426 if (CC->usersupp.axlevel < 6) {
427 cprintf("%d You must be an Aide to edit system messages.\n",
428 ERROR+HIGHER_ACCESS_REQUIRED);
432 extract(buf,mname,0);
433 for (a=0; a<strlen(buf); ++a) { /* security measure */
434 if (buf[a] == '/') buf[a] = '.';
439 strcpy(dirs[0],"messages");
440 strcpy(dirs[1],"help");
441 mesg_locate(targ,buf,2,dirs);
445 if (strlen(targ)==0) {
446 snprintf(targ, sizeof targ, "./help/%s", buf);
449 mfp = fopen(targ,"w");
451 cprintf("%d Cannot open '%s': %s\n",
452 ERROR,targ,strerror(errno));
455 cprintf("%d %s\n", SEND_LISTING, targ);
457 while (client_gets(buf), strcmp(buf, "000")) {
458 fprintf(mfp, "%s\n", buf);
468 void cmd_rwho(void) {
469 struct CitContext *cptr;
472 char un[40], room[40], host[40], flags[5];
474 aide = CC->usersupp.axlevel >= 6;
475 cprintf("%d\n",LISTING_FOLLOWS);
477 for (cptr = ContextList; cptr != NULL; cptr = cptr->next)
482 if (cptr->cs_flags & CS_POSTING)
487 if (cptr->fake_username[0])
489 strcpy(un, cptr->fake_username);
493 strcpy(un, cptr->curr_user);
495 if (cptr->fake_hostname[0])
497 strcpy(host, cptr->fake_hostname);
501 strcpy(host, cptr->cs_host);
503 if (cptr->fake_roomname[0])
505 strcpy(room, cptr->fake_roomname);
509 strcpy(room, cptr->cs_room);
512 if ((aide) && (spoofed))
515 if ((cptr->cs_flags & CS_STEALTH) && (aide))
518 if (((cptr->cs_flags&CS_STEALTH)==0) || (aide))
520 cprintf("%d|%s|%s|%s|%s|%ld|%s|%s\n",
521 cptr->cs_pid, un, room,
522 host, cptr->cs_clientname,
523 (long)(cptr->lastidle),
524 cptr->lastcmdname, flags);
526 if ((spoofed) && (aide))
528 cprintf("%d|%s|%s|%s|%s|%ld|%s|%s\n",
529 cptr->cs_pid, cptr->curr_user, cptr->cs_room,
530 cptr->cs_host, cptr->cs_clientname,
531 (long)(cptr->lastidle),
532 cptr->lastcmdname, flags);
541 * Terminate another running session
543 void cmd_term(char *cmdbuf)
546 struct CitContext *ccptr;
548 if (!CC->logged_in) {
549 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
553 if (CC->usersupp.axlevel < 6) {
554 cprintf("%d You must be an Aide to terminate sessions.\n",
555 ERROR+HIGHER_ACCESS_REQUIRED);
559 session_num = extract_int(cmdbuf, 0);
560 if (session_num == CC->cs_pid) {
561 cprintf("%d You can't kill your own session.\n", ERROR);
565 for (ccptr = ContextList; ccptr != NULL; ccptr = ccptr->next) {
566 if (session_num == ccptr->cs_pid) {
567 kill_session(ccptr->cs_pid);
568 cprintf("%d Session terminated.\n", OK);
573 cprintf("%d No such session.\n", ERROR);
581 * get the paginator prompt
583 void cmd_more(void) {
584 cprintf("%d %s\n",OK,config.c_moreprompt);
590 void cmd_echo(char *etext)
592 cprintf("%d %s\n",OK,etext);
598 * identify as internal program
600 void cmd_ipgm(char *argbuf)
604 secret = extract_int(argbuf, 0);
605 if (secret == config.c_ipgm_secret) {
606 CC->internal_pgm = 1;
607 strcpy(CC->curr_user, "<internal program>");
608 CC->cs_flags = CC->cs_flags|CS_STEALTH;
609 cprintf("%d Authenticated as an internal program.\n",OK);
612 cprintf("%d Authentication failed.\n",ERROR);
618 * Shut down the server
620 void cmd_down(void) {
621 if (!CC->logged_in) {
622 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
626 if (CC->usersupp.axlevel < 6) {
627 cprintf("%d You must be an Aide to shut down the server.\n",
628 ERROR+HIGHER_ACCESS_REQUIRED);
632 cprintf("%d Shutting down server. Goodbye.\n", OK);
637 * Schedule or cancel a server shutdown
639 void cmd_scdn(char *argbuf)
643 if (!CC->logged_in) {
644 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
648 if (CC->usersupp.axlevel < 6) {
649 cprintf("%d You must be an Aide to schedule a shutdown.\n",
650 ERROR+HIGHER_ACCESS_REQUIRED);
654 new_state = extract_int(argbuf, 0);
655 if ((new_state == 0) || (new_state == 1)) {
656 ScheduledShutdown = new_state;
658 cprintf("%d %d\n", OK, ScheduledShutdown);
665 void *context_loop(struct CitContext *con)
671 * Wedge our way into the context table.
676 * Initialize some variables specific to our context.
679 CC->internal_pgm = 0;
680 CC->download_fp = NULL;
681 CC->upload_fp = NULL;
682 CC->cs_pid = con->client_socket; /* not necessarily portable */
683 CC->FirstExpressMessage = NULL;
688 strcpy(CC->lastcmdname, " ");
689 strcpy(CC->cs_clientname, "(unknown)");
690 strcpy(CC->curr_user,"");
691 strcpy(CC->net_node,"");
692 snprintf(CC->temp, sizeof CC->temp, "/tmp/CitServer.%d.%d", getpid(), CC->cs_pid);
693 strcpy(CC->cs_room, "");
694 strncpy(CC->cs_host, config.c_fqdn, sizeof CC->cs_host);
695 CC->cs_host[sizeof CC->cs_host - 1] = 0;
696 locate_host(CC->cs_host);
698 CC->upload_type = UPL_FILE;
701 session_num = session_count();
703 if ((config.c_maxsessions > 0)&&(session_num > config.c_maxsessions))
706 if (CC->nologin==1) {
707 cprintf("%d %s: Too many users are already online (maximum is %d)\n",
708 ERROR+MAX_SESSIONS_EXCEEDED,
709 config.c_nodename,config.c_maxsessions);
712 cprintf("%d %s Citadel/UX server ready.\n",OK,config.c_nodename);
715 lprintf(3, "citserver[%3d]: started.\n", CC->cs_pid);
717 /* Run any session startup routines registered by loadable modules */
718 PerformSessionHooks(EVT_START);
720 rec_log(CL_CONNECT, "");
724 bzero(cmdbuf, sizeof cmdbuf); /* Clear it, just in case */
725 if (client_gets(cmdbuf) < 1) cleanup(EXIT_NULL);
726 lprintf(5, "citserver[%3d]: %s\n", CC->cs_pid, cmdbuf);
729 * Let other clients see the last command we executed, but
730 * exclude NOOP because that would be boring.
732 if (strncasecmp(cmdbuf, "NOOP", 4)) {
733 strcpy(CC->lastcmdname, " ");
734 strncpy(CC->lastcmdname, cmdbuf, 4);
738 if ((strncasecmp(cmdbuf, "ENT0", 4)) && (strncasecmp(cmdbuf, "MESG", 4)) && (strncasecmp(cmdbuf, "MSGS", 4)))
740 CC->cs_flags &= ~CS_POSTING;
744 * This loop recognizes all server commands.
747 if (!strncasecmp(cmdbuf,"NOOP",4)) {
748 cprintf("%d%cok\n",OK,check_express());
751 else if (!strncasecmp(cmdbuf,"QUIT",4)) {
752 cprintf("%d Goodbye.\n",OK);
755 else if (!strncasecmp(cmdbuf,"LOUT",4)) {
756 if (CC->logged_in) logout(CC);
757 cprintf("%d logged out.\n",OK);
760 else if (!strncasecmp(cmdbuf,"USER",4)) {
761 cmd_user(&cmdbuf[5]);
764 else if (!strncasecmp(cmdbuf,"PASS",4)) {
765 cmd_pass(&cmdbuf[5]);
768 else if (!strncasecmp(cmdbuf,"NEWU",4)) {
769 cmd_newu(&cmdbuf[5]);
772 else if (!strncasecmp(cmdbuf,"SETP",4)) {
773 cmd_setp(&cmdbuf[5]);
776 else if (!strncasecmp(cmdbuf,"LRMS",4)) {
777 cmd_lrms(&cmdbuf[5]);
780 else if (!strncasecmp(cmdbuf,"LKRA",4)) {
781 cmd_lkra(&cmdbuf[5]);
784 else if (!strncasecmp(cmdbuf,"LKRN",4)) {
785 cmd_lkrn(&cmdbuf[5]);
788 else if (!strncasecmp(cmdbuf,"LKRO",4)) {
789 cmd_lkro(&cmdbuf[5]);
792 else if (!strncasecmp(cmdbuf,"LZRM",4)) {
793 cmd_lzrm(&cmdbuf[5]);
796 else if (!strncasecmp(cmdbuf,"GETU",4)) {
800 else if (!strncasecmp(cmdbuf,"SETU",4)) {
801 cmd_setu(&cmdbuf[5]);
804 else if (!strncasecmp(cmdbuf,"GOTO",4)) {
805 cmd_goto(&cmdbuf[5]);
808 else if (!strncasecmp(cmdbuf,"MSGS",4)) {
809 cmd_msgs(&cmdbuf[5]);
812 else if (!strncasecmp(cmdbuf,"WHOK",4)) {
816 else if (!strncasecmp(cmdbuf,"RDIR",4)) {
820 else if (!strncasecmp(cmdbuf,"MSG0",4)) {
821 cmd_msg0(&cmdbuf[5]);
824 else if (!strncasecmp(cmdbuf,"MSG2",4)) {
825 cmd_msg2(&cmdbuf[5]);
828 else if (!strncasecmp(cmdbuf,"MSG3",4)) {
829 cmd_msg3(&cmdbuf[5]);
832 else if (!strncasecmp(cmdbuf,"INFO",4)) {
836 else if (!strncasecmp(cmdbuf,"SLRP",4)) {
837 cmd_slrp(&cmdbuf[5]);
840 else if (!strncasecmp(cmdbuf,"INVT",4)) {
841 cmd_invt_kick(&cmdbuf[5],1);
844 else if (!strncasecmp(cmdbuf,"KICK",4)) {
845 cmd_invt_kick(&cmdbuf[5],0);
848 else if (!strncasecmp(cmdbuf,"GETR",4)) {
852 else if (!strncasecmp(cmdbuf,"SETR",4)) {
853 cmd_setr(&cmdbuf[5]);
856 else if (!strncasecmp(cmdbuf,"GETA",4)) {
860 else if (!strncasecmp(cmdbuf,"SETA",4)) {
861 cmd_seta(&cmdbuf[5]);
864 else if (!strncasecmp(cmdbuf,"ENT0",4)) {
865 cmd_ent0(&cmdbuf[5]);
868 else if (!strncasecmp(cmdbuf,"ENT3",4)) {
869 cmd_ent3(&cmdbuf[5]);
872 else if (!strncasecmp(cmdbuf,"RINF",4)) {
876 else if (!strncasecmp(cmdbuf,"DELE",4)) {
877 cmd_dele(&cmdbuf[5]);
880 else if (!strncasecmp(cmdbuf,"KILL",4)) {
881 cmd_kill(&cmdbuf[5]);
884 else if (!strncasecmp(cmdbuf,"CRE8",4)) {
885 cmd_cre8(&cmdbuf[5]);
888 else if (!strncasecmp(cmdbuf,"MOVE",4)) {
889 cmd_move(&cmdbuf[5]);
892 else if (!strncasecmp(cmdbuf,"FORG",4)) {
896 else if (!strncasecmp(cmdbuf,"MESG",4)) {
897 cmd_mesg(&cmdbuf[5]);
900 else if (!strncasecmp(cmdbuf,"EMSG",4)) {
901 cmd_emsg(&cmdbuf[5]);
904 else if (!strncasecmp(cmdbuf,"GNUR",4)) {
908 else if (!strncasecmp(cmdbuf,"GREG",4)) {
909 cmd_greg(&cmdbuf[5]);
912 else if (!strncasecmp(cmdbuf,"VALI",4)) {
913 cmd_vali(&cmdbuf[5]);
916 else if (!strncasecmp(cmdbuf,"EINF",4)) {
917 cmd_einf(&cmdbuf[5]);
920 else if (!strncasecmp(cmdbuf,"LIST",4)) {
924 else if (!strncasecmp(cmdbuf,"REGI",4)) {
928 else if (!strncasecmp(cmdbuf,"CHEK",4)) {
932 else if (!strncasecmp(cmdbuf,"DELF",4)) {
933 cmd_delf(&cmdbuf[5]);
936 else if (!strncasecmp(cmdbuf,"MOVF",4)) {
937 cmd_movf(&cmdbuf[5]);
940 else if (!strncasecmp(cmdbuf,"NETF",4)) {
941 cmd_netf(&cmdbuf[5]);
944 else if (!strncasecmp(cmdbuf,"RWHO",4)) {
948 else if (!strncasecmp(cmdbuf,"OPEN",4)) {
949 cmd_open(&cmdbuf[5]);
952 else if (!strncasecmp(cmdbuf,"CLOS",4)) {
956 else if (!strncasecmp(cmdbuf,"UOPN",4)) {
957 cmd_uopn(&cmdbuf[5]);
960 else if (!strncasecmp(cmdbuf,"UCLS",4)) {
961 cmd_ucls(&cmdbuf[5]);
964 else if (!strncasecmp(cmdbuf,"READ",4)) {
965 cmd_read(&cmdbuf[5]);
968 else if (!strncasecmp(cmdbuf,"WRIT",4)) {
969 cmd_writ(&cmdbuf[5]);
972 else if (!strncasecmp(cmdbuf,"QUSR",4)) {
973 cmd_qusr(&cmdbuf[5]);
976 else if (!strncasecmp(cmdbuf,"ECHO",4)) {
977 cmd_echo(&cmdbuf[5]);
980 else if (!strncasecmp(cmdbuf,"OIMG",4)) {
981 cmd_oimg(&cmdbuf[5]);
984 else if (!strncasecmp(cmdbuf,"MORE",4)) {
988 else if (!strncasecmp(cmdbuf,"NETP",4)) {
989 cmd_netp(&cmdbuf[5]);
992 else if (!strncasecmp(cmdbuf,"NDOP",4)) {
993 cmd_ndop(&cmdbuf[5]);
996 else if (!strncasecmp(cmdbuf,"NUOP",4)) {
997 cmd_nuop(&cmdbuf[5]);
1000 else if (!strncasecmp(cmdbuf,"LFLR",4)) {
1004 else if (!strncasecmp(cmdbuf,"CFLR",4)) {
1005 cmd_cflr(&cmdbuf[5]);
1008 else if (!strncasecmp(cmdbuf,"KFLR",4)) {
1009 cmd_kflr(&cmdbuf[5]);
1012 else if (!strncasecmp(cmdbuf,"EFLR",4)) {
1013 cmd_eflr(&cmdbuf[5]);
1016 else if (!strncasecmp(cmdbuf,"IDEN",4)) {
1017 cmd_iden(&cmdbuf[5]);
1020 else if (!strncasecmp(cmdbuf,"IPGM",4)) {
1021 cmd_ipgm(&cmdbuf[5]);
1024 else if (!strncasecmp(cmdbuf,"EBIO",4)) {
1028 else if (!strncasecmp(cmdbuf,"RBIO",4)) {
1029 cmd_rbio(&cmdbuf[5]);
1032 else if (!strncasecmp(cmdbuf,"LBIO",4)) {
1036 else if (!strncasecmp(cmdbuf,"STEL",4)) {
1037 cmd_stel(&cmdbuf[5]);
1040 else if (!strncasecmp(cmdbuf,"TERM",4)) {
1041 cmd_term(&cmdbuf[5]);
1044 else if (!strncasecmp(cmdbuf,"DOWN",4)) {
1048 else if (!strncasecmp(cmdbuf,"SCDN",4)) {
1049 cmd_scdn(&cmdbuf[5]);
1052 else if (!strncasecmp(cmdbuf, "NSET", 4)) {
1053 cmd_nset(&cmdbuf[5]);
1056 else if (!strncasecmp(cmdbuf, "UIMG", 4)) {
1057 cmd_uimg(&cmdbuf[5]);
1060 else if (!strncasecmp(cmdbuf, "UCHG", 4)) {
1061 cmd_uchg(&cmdbuf[5]);
1064 else if (!strncasecmp(cmdbuf, "TIME", 4)) {
1068 else if (!strncasecmp(cmdbuf, "HCHG", 4)) {
1069 cmd_hchg(&cmdbuf[5]);
1072 else if (!strncasecmp(cmdbuf, "RCHG", 4)) {
1073 cmd_rchg(&cmdbuf[5]);
1076 else if (!strncasecmp(cmdbuf, "AGUP", 4)) {
1077 cmd_agup(&cmdbuf[5]);
1080 else if (!strncasecmp(cmdbuf, "ASUP", 4)) {
1081 cmd_asup(&cmdbuf[5]);
1084 else if (!strncasecmp(cmdbuf, "GPEX", 4)) {
1085 cmd_gpex(&cmdbuf[5]);
1088 else if (!strncasecmp(cmdbuf, "SPEX", 4)) {
1089 cmd_spex(&cmdbuf[5]);
1092 else if (!strncasecmp(cmdbuf, "CONF", 4)) {
1093 cmd_conf(&cmdbuf[5]);
1096 else if (!DLoader_Exec_Cmd(cmdbuf))
1098 cprintf("%d Unrecognized or unsupported command.\n",
1102 } while(strncasecmp(cmdbuf, "QUIT", 4));
1104 cleanup(EXIT_NORMAL);