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 message list we might have in memory */
109 if (CC->msglist != NULL) phree(CC->msglist);
111 /* Now get rid of the session and context */
112 lprintf(7, "cleanup_stuff() calling RemoveContext(%d)\n", CC->cs_pid);
115 /* While we still have an extra thread with no user attached to it,
116 * take the opportunity to do some housekeeping before exiting.
123 * set_wtmpsupp() - alter the session listing
125 void set_wtmpsupp(char *newtext)
127 strncpy(CC->cs_room,newtext,sizeof CC->cs_room);
128 CC->cs_room[sizeof CC->cs_room - 1] = 0;
129 time(&CC->cs_lastupdt);
131 /* Run any routines registered by loadable modules */
132 PerformSessionHooks(EVT_NEWROOM);
137 * call set_wtmpsupp() with the name of the current room, modified a bit...
139 void set_wtmpsupp_to_current_room() {
140 if (CC->quickroom.QRflags & QR_PRIVATE) {
141 set_wtmpsupp("<private room>");
143 else if (CC->quickroom.QRflags & QR_MAILBOX) {
144 set_wtmpsupp(&CC->quickroom.QRname[11]);
147 set_wtmpsupp(CC->quickroom.QRname);
154 * cmd_info() - tell the client about this server
156 void cmd_info(void) {
157 cprintf("%d Server info:\n",LISTING_FOLLOWS);
158 cprintf("%d\n",CC->cs_pid);
159 cprintf("%s\n",config.c_nodename);
160 cprintf("%s\n",config.c_humannode);
161 cprintf("%s\n",config.c_fqdn);
162 cprintf("%s\n",CITADEL);
163 cprintf("%d\n",REV_LEVEL);
164 cprintf("%s\n",config.c_bbs_city);
165 cprintf("%s\n",config.c_sysadm);
166 cprintf("%d\n",SERVER_TYPE);
167 cprintf("%s\n",config.c_moreprompt);
168 cprintf("1\n"); /* 1 = yes, this system supports floors */
169 cprintf("1\n"); /* 1 = we support the extended paging options */
173 void cmd_rchg(char *argbuf)
175 char newroomname[256]; /* set to 256 to prevent buffer overruns <dme>*/
177 extract(newroomname, argbuf, 0);
178 newroomname[ROOMNAMELEN] = 0;
179 if (strlen(newroomname) > 0) {
180 strncpy(CC->fake_roomname, newroomname, ROOMNAMELEN);
181 CC->fake_roomname[ROOMNAMELEN - 1] = 0;
184 strcpy(CC->fake_roomname, "");
186 cprintf("%d OK\n", OK);
189 void cmd_hchg(char *newhostname)
191 if ((newhostname) && (newhostname[0]))
193 memset(CC->fake_hostname, 0, 25);
194 strncpy(CC->fake_hostname, newhostname, 24);
197 strcpy(CC->fake_hostname, "");
198 cprintf("%d OK\n",OK);
201 void cmd_uchg(char *newusername)
203 if (CC->usersupp.axlevel < 6)
205 cprintf("%d You must be an Aide to use UCHG.\n",
206 ERROR+HIGHER_ACCESS_REQUIRED);
209 if ((newusername) && (newusername[0]))
211 CC->cs_flags &= ~CS_STEALTH;
212 memset(CC->fake_username, 0, 32);
213 if (strncasecmp(newusername, CC->curr_user, strlen(CC->curr_user)))
214 strncpy(CC->fake_username, newusername, 31);
218 CC->fake_username[0] = '\0';
219 CC->cs_flags |= CS_STEALTH;
225 * returns an asterisk if there are any express messages waiting,
228 char check_express(void) {
229 if (CC->FirstExpressMessage == NULL) {
243 cprintf("%d %ld\n", OK, tv);
247 * check a hostname against the public_clients file
249 int is_public_client(char *where)
254 if (!strcasecmp(where,"localhost")) return(1);
255 if (!strcasecmp(where,config.c_fqdn)) return(1);
257 fp = fopen("public_clients","r");
258 if (fp == NULL) return(0);
260 while (fgets(buf,256,fp)!=NULL) {
261 while (isspace((buf[strlen(buf)-1])))
262 buf[strlen(buf)-1] = 0;
263 if (!strcasecmp(buf,where)) {
275 * the client is identifying itself to the server
277 void cmd_iden(char *argbuf)
285 if (num_parms(argbuf)<4) {
286 cprintf("%d usage error\n",ERROR);
290 dev_code = extract_int(argbuf,0);
291 cli_code = extract_int(argbuf,1);
292 rev_level = extract_int(argbuf,2);
293 extract(desc,argbuf,3);
295 strncpy(from_host,config.c_fqdn,sizeof from_host);
296 from_host[sizeof from_host - 1] = 0;
297 if (num_parms(argbuf)>=5) extract(from_host,argbuf,4);
299 CC->cs_clientdev = dev_code;
300 CC->cs_clienttyp = cli_code;
301 CC->cs_clientver = rev_level;
302 strncpy(CC->cs_clientname,desc,31);
303 CC->cs_clientname[31] = 0;
305 if ((strlen(from_host)>0) &&
306 (is_public_client(CC->cs_host))) {
307 strncpy(CC->cs_host,from_host,24);
310 set_wtmpsupp_to_current_room();
312 syslog(LOG_NOTICE,"client %d/%d/%01d.%02d (%s)\n",
318 cprintf("%d Ok\n",OK);
323 * enter or exit "stealth mode"
325 void cmd_stel(char *cmdbuf)
329 requested_mode = extract_int(cmdbuf,0);
330 if (requested_mode !=0) requested_mode = 1;
332 if (!CC->logged_in) {
333 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
337 if (CC->usersupp.axlevel < 6) {
338 cprintf("%d You must be an Aide to use stealth mode.\n",
339 ERROR+HIGHER_ACCESS_REQUIRED);
343 if (CC->cs_flags & CS_STEALTH) {
344 if (requested_mode == 0)
345 CC->cs_flags = CC->cs_flags-CS_STEALTH;
348 if (requested_mode == 1)
349 CC->cs_flags = CC->cs_flags|CS_STEALTH;
352 set_wtmpsupp_to_current_room();
353 cprintf("%d Ok\n",OK);
360 * display system messages or help
362 void cmd_mesg(char *mname)
369 extract(buf,mname,0);
374 strcpy(dirs[0],"messages");
375 strcpy(dirs[1],"help");
376 mesg_locate(targ,buf,2,dirs);
381 if (strlen(targ)==0) {
382 cprintf("%d '%s' not found.\n",ERROR,mname);
386 mfp = fopen(targ,"r");
388 cprintf("%d Cannot open '%s': %s\n",
389 ERROR,targ,strerror(errno));
392 cprintf("%d %s\n",LISTING_FOLLOWS,buf);
394 while (fgets(buf,255,mfp)!=NULL) {
395 buf[strlen(buf)-1] = 0;
406 * enter system messages or help
408 void cmd_emsg(char *mname)
416 if (CC->usersupp.axlevel < 6) {
417 cprintf("%d You must be an Aide to edit system messages.\n",
418 ERROR+HIGHER_ACCESS_REQUIRED);
422 extract(buf,mname,0);
423 for (a=0; a<strlen(buf); ++a) { /* security measure */
424 if (buf[a] == '/') buf[a] = '.';
429 strcpy(dirs[0],"messages");
430 strcpy(dirs[1],"help");
431 mesg_locate(targ,buf,2,dirs);
435 if (strlen(targ)==0) {
436 snprintf(targ, sizeof targ, "./help/%s", buf);
439 mfp = fopen(targ,"w");
441 cprintf("%d Cannot open '%s': %s\n",
442 ERROR,targ,strerror(errno));
445 cprintf("%d %s\n", SEND_LISTING, targ);
447 while (client_gets(buf), strcmp(buf, "000")) {
448 fprintf(mfp, "%s\n", buf);
458 void cmd_rwho(void) {
459 struct CitContext *cptr;
462 char un[40], room[40], host[40], flags[5];
464 aide = CC->usersupp.axlevel >= 6;
465 cprintf("%d\n",LISTING_FOLLOWS);
467 for (cptr = ContextList; cptr != NULL; cptr = cptr->next)
472 if (cptr->cs_flags & CS_POSTING)
477 if (cptr->fake_username[0])
479 strcpy(un, cptr->fake_username);
483 strcpy(un, cptr->curr_user);
485 if (cptr->fake_hostname[0])
487 strcpy(host, cptr->fake_hostname);
491 strcpy(host, cptr->cs_host);
493 if (cptr->fake_roomname[0])
495 strcpy(room, cptr->fake_roomname);
499 strcpy(room, cptr->cs_room);
502 if ((aide) && (spoofed))
505 if ((cptr->cs_flags & CS_STEALTH) && (aide))
508 if (((cptr->cs_flags&CS_STEALTH)==0) || (aide))
510 cprintf("%d|%s|%s|%s|%s|%ld|%s|%s\n",
511 cptr->cs_pid, un, room,
512 host, cptr->cs_clientname,
513 (long)(cptr->lastidle),
514 cptr->lastcmdname, flags);
516 if ((spoofed) && (aide))
518 cprintf("%d|%s|%s|%s|%s|%ld|%s|%s\n",
519 cptr->cs_pid, cptr->curr_user, cptr->cs_room,
520 cptr->cs_host, cptr->cs_clientname,
521 (long)(cptr->lastidle),
522 cptr->lastcmdname, flags);
531 * Terminate another running session
533 void cmd_term(char *cmdbuf)
536 struct CitContext *ccptr;
537 int session_to_kill = 0;
539 if (!CC->logged_in) {
540 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
544 if (CC->usersupp.axlevel < 6) {
545 cprintf("%d You must be an Aide to terminate sessions.\n",
546 ERROR+HIGHER_ACCESS_REQUIRED);
550 session_num = extract_int(cmdbuf, 0);
551 if (session_num == CC->cs_pid) {
552 cprintf("%d You can't kill your own session.\n", ERROR);
556 lprintf(9, "Locating session to kill\n");
557 begin_critical_section(S_SESSION_TABLE);
558 for (ccptr = ContextList; ccptr != NULL; ccptr = ccptr->next) {
559 if (session_num == ccptr->cs_pid) {
560 session_to_kill = ccptr->cs_pid;
563 end_critical_section(S_SESSION_TABLE);
564 lprintf(9, "session_to_kill == %d\n", session_to_kill);
566 if (session_to_kill > 0) {
567 lprintf(9, "calling kill_session()\n");
568 kill_session(session_to_kill);
569 cprintf("%d Session terminated.\n", OK);
572 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 num_sessions = session_count();
703 if ((config.c_maxsessions > 0)&&(num_sessions > 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 memset(cmdbuf, 0, 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,"MSG4",4)) {
833 cmd_msg4(&cmdbuf[5]);
836 else if (!strncasecmp(cmdbuf,"OPNA",4)) {
837 cmd_opna(&cmdbuf[5]);
840 else if (!strncasecmp(cmdbuf,"INFO",4)) {
844 else if (!strncasecmp(cmdbuf,"SLRP",4)) {
845 cmd_slrp(&cmdbuf[5]);
848 else if (!strncasecmp(cmdbuf,"INVT",4)) {
849 cmd_invt_kick(&cmdbuf[5],1);
852 else if (!strncasecmp(cmdbuf,"KICK",4)) {
853 cmd_invt_kick(&cmdbuf[5],0);
856 else if (!strncasecmp(cmdbuf,"GETR",4)) {
860 else if (!strncasecmp(cmdbuf,"SETR",4)) {
861 cmd_setr(&cmdbuf[5]);
864 else if (!strncasecmp(cmdbuf,"GETA",4)) {
868 else if (!strncasecmp(cmdbuf,"SETA",4)) {
869 cmd_seta(&cmdbuf[5]);
872 else if (!strncasecmp(cmdbuf,"ENT0",4)) {
873 cmd_ent0(&cmdbuf[5]);
876 else if (!strncasecmp(cmdbuf,"ENT3",4)) {
877 cmd_ent3(&cmdbuf[5]);
880 else if (!strncasecmp(cmdbuf,"RINF",4)) {
884 else if (!strncasecmp(cmdbuf,"DELE",4)) {
885 cmd_dele(&cmdbuf[5]);
888 else if (!strncasecmp(cmdbuf,"KILL",4)) {
889 cmd_kill(&cmdbuf[5]);
892 else if (!strncasecmp(cmdbuf,"CRE8",4)) {
893 cmd_cre8(&cmdbuf[5]);
896 else if (!strncasecmp(cmdbuf,"MOVE",4)) {
897 cmd_move(&cmdbuf[5]);
900 else if (!strncasecmp(cmdbuf,"FORG",4)) {
904 else if (!strncasecmp(cmdbuf,"MESG",4)) {
905 cmd_mesg(&cmdbuf[5]);
908 else if (!strncasecmp(cmdbuf,"EMSG",4)) {
909 cmd_emsg(&cmdbuf[5]);
912 else if (!strncasecmp(cmdbuf,"GNUR",4)) {
916 else if (!strncasecmp(cmdbuf,"GREG",4)) {
917 cmd_greg(&cmdbuf[5]);
920 else if (!strncasecmp(cmdbuf,"VALI",4)) {
921 cmd_vali(&cmdbuf[5]);
924 else if (!strncasecmp(cmdbuf,"EINF",4)) {
925 cmd_einf(&cmdbuf[5]);
928 else if (!strncasecmp(cmdbuf,"LIST",4)) {
932 else if (!strncasecmp(cmdbuf,"REGI",4)) {
936 else if (!strncasecmp(cmdbuf,"CHEK",4)) {
940 else if (!strncasecmp(cmdbuf,"DELF",4)) {
941 cmd_delf(&cmdbuf[5]);
944 else if (!strncasecmp(cmdbuf,"MOVF",4)) {
945 cmd_movf(&cmdbuf[5]);
948 else if (!strncasecmp(cmdbuf,"NETF",4)) {
949 cmd_netf(&cmdbuf[5]);
952 else if (!strncasecmp(cmdbuf,"RWHO",4)) {
956 else if (!strncasecmp(cmdbuf,"OPEN",4)) {
957 cmd_open(&cmdbuf[5]);
960 else if (!strncasecmp(cmdbuf,"CLOS",4)) {
964 else if (!strncasecmp(cmdbuf,"UOPN",4)) {
965 cmd_uopn(&cmdbuf[5]);
968 else if (!strncasecmp(cmdbuf,"UCLS",4)) {
969 cmd_ucls(&cmdbuf[5]);
972 else if (!strncasecmp(cmdbuf,"READ",4)) {
973 cmd_read(&cmdbuf[5]);
976 else if (!strncasecmp(cmdbuf,"WRIT",4)) {
977 cmd_writ(&cmdbuf[5]);
980 else if (!strncasecmp(cmdbuf,"QUSR",4)) {
981 cmd_qusr(&cmdbuf[5]);
984 else if (!strncasecmp(cmdbuf,"ECHO",4)) {
985 cmd_echo(&cmdbuf[5]);
988 else if (!strncasecmp(cmdbuf,"OIMG",4)) {
989 cmd_oimg(&cmdbuf[5]);
992 else if (!strncasecmp(cmdbuf,"MORE",4)) {
996 else if (!strncasecmp(cmdbuf,"NETP",4)) {
997 cmd_netp(&cmdbuf[5]);
1000 else if (!strncasecmp(cmdbuf,"NDOP",4)) {
1001 cmd_ndop(&cmdbuf[5]);
1004 else if (!strncasecmp(cmdbuf,"NUOP",4)) {
1005 cmd_nuop(&cmdbuf[5]);
1008 else if (!strncasecmp(cmdbuf,"LFLR",4)) {
1012 else if (!strncasecmp(cmdbuf,"CFLR",4)) {
1013 cmd_cflr(&cmdbuf[5]);
1016 else if (!strncasecmp(cmdbuf,"KFLR",4)) {
1017 cmd_kflr(&cmdbuf[5]);
1020 else if (!strncasecmp(cmdbuf,"EFLR",4)) {
1021 cmd_eflr(&cmdbuf[5]);
1024 else if (!strncasecmp(cmdbuf,"IDEN",4)) {
1025 cmd_iden(&cmdbuf[5]);
1028 else if (!strncasecmp(cmdbuf,"IPGM",4)) {
1029 cmd_ipgm(&cmdbuf[5]);
1032 else if (!strncasecmp(cmdbuf,"EBIO",4)) {
1036 else if (!strncasecmp(cmdbuf,"RBIO",4)) {
1037 cmd_rbio(&cmdbuf[5]);
1040 else if (!strncasecmp(cmdbuf,"LBIO",4)) {
1044 else if (!strncasecmp(cmdbuf,"STEL",4)) {
1045 cmd_stel(&cmdbuf[5]);
1048 else if (!strncasecmp(cmdbuf,"TERM",4)) {
1049 cmd_term(&cmdbuf[5]);
1052 else if (!strncasecmp(cmdbuf,"DOWN",4)) {
1056 else if (!strncasecmp(cmdbuf,"SCDN",4)) {
1057 cmd_scdn(&cmdbuf[5]);
1060 else if (!strncasecmp(cmdbuf, "NSET", 4)) {
1061 cmd_nset(&cmdbuf[5]);
1064 else if (!strncasecmp(cmdbuf, "UIMG", 4)) {
1065 cmd_uimg(&cmdbuf[5]);
1068 else if (!strncasecmp(cmdbuf, "UCHG", 4)) {
1069 cmd_uchg(&cmdbuf[5]);
1072 else if (!strncasecmp(cmdbuf, "TIME", 4)) {
1076 else if (!strncasecmp(cmdbuf, "HCHG", 4)) {
1077 cmd_hchg(&cmdbuf[5]);
1080 else if (!strncasecmp(cmdbuf, "RCHG", 4)) {
1081 cmd_rchg(&cmdbuf[5]);
1084 else if (!strncasecmp(cmdbuf, "AGUP", 4)) {
1085 cmd_agup(&cmdbuf[5]);
1088 else if (!strncasecmp(cmdbuf, "ASUP", 4)) {
1089 cmd_asup(&cmdbuf[5]);
1092 else if (!strncasecmp(cmdbuf, "GPEX", 4)) {
1093 cmd_gpex(&cmdbuf[5]);
1096 else if (!strncasecmp(cmdbuf, "SPEX", 4)) {
1097 cmd_spex(&cmdbuf[5]);
1100 else if (!strncasecmp(cmdbuf, "CONF", 4)) {
1101 cmd_conf(&cmdbuf[5]);
1104 #ifdef DEBUG_MEMORY_LEAKS
1105 else if (!strncasecmp(cmdbuf, "LEAK", 4)) {
1110 else if (!DLoader_Exec_Cmd(cmdbuf))
1112 cprintf("%d Unrecognized or unsupported command.\n",
1116 } while(strncasecmp(cmdbuf, "QUIT", 4));
1118 cleanup(EXIT_NORMAL);