15 #include "sysdep_decls.h"
16 #include "citserver.h"
19 #include "housekeeping.h"
24 #include "locate_host.h"
27 #include "dynloader.h"
29 struct CitContext *ContextList = NULL;
30 int ScheduledShutdown = 0;
33 * Various things that need to be initialized at startup
35 void master_startup(void) {
36 lprintf(7, "Opening databases\n");
39 lprintf(7, "Checking floor reference counts\n");
45 * Cleanup routine to be called when the server is shutting down.
47 void master_cleanup(void) {
48 struct CleanupFunctionHook *fcn;
50 /* Cancel all running sessions */
51 lprintf(7, "Cancelling running sessions...\n");
52 while (ContextList != NULL) {
53 kill_session(ContextList->cs_pid);
56 /* Run any cleanup routines registered by loadable modules */
57 for (fcn = CleanupHookTable; fcn != NULL; fcn = fcn->next) {
58 (*fcn->h_function_pointer)();
62 lprintf(7, "Closing databases\n");
65 /* Do system-dependent stuff */
66 sysdep_master_cleanup();
69 lprintf(3, "citserver: exiting.\n");
75 * Gracefully terminate the session and thread.
76 * (This is called as a cleanup handler by the thread library.)
78 * All NON-system-dependent stuff is done in this function.
79 * System-dependent session/thread cleanup is in cleanup() in sysdep.c
81 void cleanup_stuff(void *arg)
83 struct ExpressMessage *emptr;
84 struct SessionFunctionHook *fcn;
86 lprintf(9, "cleanup_stuff() called\n");
88 lprintf(7, "Calling logout(%d)\n", CC->cs_pid);
91 rec_log(CL_TERMINATE,CC->curr_user);
93 lprintf(3, "citserver[%3d]: ended.\n",CC->cs_pid);
95 /* Run any cleanup routines registered by loadable modules */
96 for (fcn = SessionHookTable; fcn != NULL; fcn = fcn->next) {
97 if (fcn->startstop == 0) {
98 (*fcn->h_function_pointer)(CC->cs_pid);
102 syslog(LOG_NOTICE,"session %d ended", CC->cs_pid);
104 /* Deallocate any unsent express messages */
105 begin_critical_section(S_SESSION_TABLE);
106 while (CC->FirstExpressMessage != NULL) {
107 emptr = CC->FirstExpressMessage;
108 CC->FirstExpressMessage = CC->FirstExpressMessage->next;
111 end_critical_section(S_SESSION_TABLE);
113 /* Deallocate any message list we might have in memory */
114 if (CC->msglist != NULL) free(CC->msglist);
116 /* Now get rid of the session and context */
117 lprintf(7, "cleanup_stuff() is 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 struct NewRoomFunctionHook *fcn;
134 strncpy(CC->cs_room,newtext,19);
136 time(&CC->cs_lastupdt);
138 /* Run any routines registered by loadable modules */
139 for (fcn = NewRoomHookTable; fcn != NULL; fcn = fcn->next) {
140 (*fcn->h_function_pointer)(CC->cs_room);
146 * cmd_info() - tell the client about this server
148 void cmd_info(void) {
149 cprintf("%d Server info:\n",LISTING_FOLLOWS);
150 cprintf("%d\n",CC->cs_pid);
151 cprintf("%s\n",config.c_nodename);
152 cprintf("%s\n",config.c_humannode);
153 cprintf("%s\n",config.c_fqdn);
154 cprintf("%s\n",CITADEL);
155 cprintf("%d\n",REV_LEVEL);
156 cprintf("%s\n",config.c_bbs_city);
157 cprintf("%s\n",config.c_sysadm);
158 cprintf("%d\n",SERVER_TYPE);
159 cprintf("%s\n",config.c_moreprompt);
160 cprintf("1\n"); /* 1 = yes, this system supports floors */
164 void cmd_rchg(char *newroomname)
166 if ((newroomname) && (newroomname[0]))
168 bzero(CC->fake_roomname, 20);
169 strncpy(CC->fake_roomname, newroomname, 19);
172 CC->fake_roomname[0] = '\0';
176 void cmd_hchg(char *newhostname)
178 if ((newhostname) && (newhostname[0]))
180 bzero(CC->fake_hostname, 25);
181 strncpy(CC->fake_hostname, newhostname, 24);
184 CC->fake_hostname[0] = '\0';
188 void cmd_uchg(char *newusername)
190 if (CC->usersupp.axlevel < 6)
192 cprintf("%d You must be an Aide to use UCHG.\n",
193 ERROR+HIGHER_ACCESS_REQUIRED);
196 if ((newusername) && (newusername[0]))
198 CC->cs_flags &= ~CS_STEALTH;
199 bzero(CC->fake_username, 32);
200 if (strncasecmp(newusername, CC->curr_user, strlen(CC->curr_user)))
201 strncpy(CC->fake_username, newusername, 31);
205 CC->fake_username[0] = '\0';
206 CC->cs_flags |= CS_STEALTH;
212 * returns an asterisk if there are any express messages waiting,
215 char check_express(void) {
216 if (CC->FirstExpressMessage == NULL) {
230 cprintf("%d %ld\n", OK, tv);
234 * check a hostname against the public_clients file
236 int is_public_client(char *where)
241 if (!strcasecmp(where,"localhost")) return(1);
242 if (!strcasecmp(where,config.c_fqdn)) return(1);
244 fp = fopen("public_clients","r");
245 if (fp == NULL) return(0);
247 while (fgets(buf,256,fp)!=NULL) {
248 while (isspace((buf[strlen(buf)-1])))
249 buf[strlen(buf)-1] = 0;
250 if (!strcasecmp(buf,where)) {
262 * the client is identifying itself to the server
264 void cmd_iden(char *argbuf)
272 if (num_parms(argbuf)<4) {
273 cprintf("%d usage error\n",ERROR);
277 dev_code = extract_int(argbuf,0);
278 cli_code = extract_int(argbuf,1);
279 rev_level = extract_int(argbuf,2);
280 extract(desc,argbuf,3);
282 strcpy(from_host,config.c_fqdn);
283 if (num_parms(argbuf)>=5) extract(from_host,argbuf,4);
285 CC->cs_clientdev = dev_code;
286 CC->cs_clienttyp = cli_code;
287 CC->cs_clientver = rev_level;
288 strncpy(CC->cs_clientname,desc,31);
289 CC->cs_clientname[31] = 0;
291 if ((strlen(from_host)>0) &&
292 (is_public_client(CC->cs_host))) {
293 strncpy(CC->cs_host,from_host,24);
296 set_wtmpsupp(CC->quickroom.QRname);
298 syslog(LOG_NOTICE,"client %d/%d/%01d.%02d (%s)\n",
304 cprintf("%d Ok\n",OK);
309 * enter or exit "stealth mode"
311 void cmd_stel(char *cmdbuf)
315 requested_mode = extract_int(cmdbuf,0);
316 if (requested_mode !=0) requested_mode = 1;
318 if (!CC->logged_in) {
319 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
323 if (CC->usersupp.axlevel < 6) {
324 cprintf("%d You must be an Aide to use stealth mode.\n",
325 ERROR+HIGHER_ACCESS_REQUIRED);
329 if (CC->cs_flags & CS_STEALTH) {
330 if (requested_mode == 0)
331 CC->cs_flags = CC->cs_flags-CS_STEALTH;
334 if (requested_mode == 1)
335 CC->cs_flags = CC->cs_flags|CS_STEALTH;
338 set_wtmpsupp(CC->quickroom.QRname);
339 cprintf("%d Ok\n",OK);
346 * display system messages or help
348 void cmd_mesg(char *mname)
355 extract(buf,mname,0);
360 strcpy(dirs[0],"messages");
361 strcpy(dirs[1],"help");
362 mesg_locate(targ,buf,2,dirs);
367 if (strlen(targ)==0) {
368 cprintf("%d '%s' not found.\n",ERROR,mname);
372 mfp = fopen(targ,"r");
374 cprintf("%d Cannot open '%s': %s\n",
375 ERROR,targ,strerror(errno));
378 cprintf("%d %s\n",LISTING_FOLLOWS,buf);
380 while (fgets(buf,255,mfp)!=NULL) {
381 buf[strlen(buf)-1] = 0;
392 * enter system messages or help
394 void cmd_emsg(char *mname)
402 if (CC->usersupp.axlevel < 6) {
403 cprintf("%d You must be an Aide to edit system messages.\n",
404 ERROR+HIGHER_ACCESS_REQUIRED);
408 extract(buf,mname,0);
409 for (a=0; a<strlen(buf); ++a) { /* security measure */
410 if (buf[a] == '/') buf[a] = '.';
415 strcpy(dirs[0],"messages");
416 strcpy(dirs[1],"help");
417 mesg_locate(targ,buf,2,dirs);
421 if (strlen(targ)==0) {
422 sprintf(targ, "./help/%s", buf);
425 mfp = fopen(targ,"w");
427 cprintf("%d Cannot open '%s': %s\n",
428 ERROR,targ,strerror(errno));
431 cprintf("%d %s\n", SEND_LISTING, targ);
433 while (client_gets(buf), strcmp(buf, "000")) {
434 fprintf(mfp, "%s\n", buf);
444 void cmd_rwho(void) {
445 struct CitContext *cptr;
448 char un[40], room[40], host[40], flags[5];
450 aide = CC->usersupp.axlevel >= 6;
451 cprintf("%d\n",LISTING_FOLLOWS);
453 for (cptr = ContextList; cptr != NULL; cptr = cptr->next)
458 if (cptr->cs_flags & CS_POSTING)
463 if (cptr->fake_username[0])
465 strcpy(un, cptr->fake_username);
469 strcpy(un, cptr->curr_user);
471 if (cptr->fake_hostname[0])
473 strcpy(host, cptr->fake_hostname);
477 strcpy(host, cptr->cs_host);
479 if (cptr->fake_roomname[0])
481 strcpy(room, cptr->fake_roomname);
485 strcpy(room, cptr->cs_room);
488 if ((aide) && (spoofed))
491 if ((cptr->cs_flags & CS_STEALTH) && (aide))
494 if (((cptr->cs_flags&CS_STEALTH)==0) || (aide))
496 cprintf("%d|%s|%s|%s|%s|%ld|%s|%s\n",
497 cptr->cs_pid, un, room,
498 host, cptr->cs_clientname,
499 (long)(cptr->lastidle),
500 cptr->lastcmdname, flags);
502 if ((spoofed) && (aide))
504 cprintf("%d|%s|%s|%s|%s|%ld|%s|%s\n",
505 cptr->cs_pid, cptr->curr_user, cptr->cs_room,
506 cptr->cs_host, cptr->cs_clientname,
507 (long)(cptr->lastidle),
508 cptr->lastcmdname, flags);
517 * Terminate another running session
519 void cmd_term(char *cmdbuf)
522 struct CitContext *ccptr;
524 if (!CC->logged_in) {
525 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
529 if (CC->usersupp.axlevel < 6) {
530 cprintf("%d You must be an Aide to terminate sessions.\n",
531 ERROR+HIGHER_ACCESS_REQUIRED);
535 session_num = extract_int(cmdbuf, 0);
536 if (session_num == CC->cs_pid) {
537 cprintf("%d You can't kill your own session.\n", ERROR);
541 for (ccptr = ContextList; ccptr != NULL; ccptr = ccptr->next) {
542 if (session_num == ccptr->cs_pid) {
543 kill_session(ccptr->cs_pid);
544 cprintf("%d Session terminated.\n", OK);
549 cprintf("%d No such session.\n", ERROR);
557 * get the paginator prompt
559 void cmd_more(void) {
560 cprintf("%d %s\n",OK,config.c_moreprompt);
566 void cmd_echo(char *etext)
568 cprintf("%d %s\n",OK,etext);
574 * identify as internal program
576 void cmd_ipgm(char *argbuf)
580 secret = extract_int(argbuf, 0);
581 if (secret == config.c_ipgm_secret) {
582 CC->internal_pgm = 1;
583 strcpy(CC->curr_user, "<internal program>");
584 CC->cs_flags = CC->cs_flags|CS_STEALTH;
585 cprintf("%d Authenticated as an internal program.\n",OK);
588 cprintf("%d Authentication failed.\n",ERROR);
594 * Shut down the server
596 void cmd_down(void) {
597 if (!CC->logged_in) {
598 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
602 if (CC->usersupp.axlevel < 6) {
603 cprintf("%d You must be an Aide to shut down the server.\n",
604 ERROR+HIGHER_ACCESS_REQUIRED);
608 cprintf("%d Shutting down server. Goodbye.\n", OK);
613 * Schedule or cancel a server shutdown
615 void cmd_scdn(char *argbuf)
619 if (!CC->logged_in) {
620 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
624 if (CC->usersupp.axlevel < 6) {
625 cprintf("%d You must be an Aide to schedule a shutdown.\n",
626 ERROR+HIGHER_ACCESS_REQUIRED);
630 new_state = extract_int(argbuf, 0);
631 if ((new_state == 0) || (new_state == 1)) {
632 ScheduledShutdown = new_state;
634 cprintf("%d %d\n", OK, ScheduledShutdown);
639 * Run a server extension (FIX FIX FIX initial hack; polish this up)
641 void cmd_extn(char *argbuf) {
642 char ExtensionName[256];
650 extract(ExtensionName, argbuf, 0);
651 is_ipgm = extract_int(argbuf, 1);
654 lprintf(9, "fork() returned %d\n", pid);
656 cprintf("%d fork failed: %s\n",
657 ERROR + INTERNAL_ERROR,
663 sprintf(portstr, "%d", config.c_port_number);
666 sprintf(ipgm, "%d", config.c_ipgm_secret);
670 sprintf(sess, "%d", CC->cs_pid);
672 execlp(ExtensionName, ExtensionName,
673 "localhost", /* server address */
674 portstr, /* port number */
675 ipgm, /* ipgm secret */
676 CC->usersupp.fullname, /* user name */
677 CC->usersupp.password, /* password */
678 CC->quickroom.QRname, /* current room */
679 sess, /* assoc session id */
682 lprintf(9, "exec() failed: %s\n", strerror(errno));
686 cprintf("%d Ok\n", OK);
696 void *context_loop(struct CitContext *con)
700 struct SessionFunctionHook *fcn;
703 * Wedge our way into the context table.
708 * Initialize some variables specific to our context.
712 CC->internal_pgm = 0;
713 CC->download_fp = NULL;
714 CC->upload_fp = NULL;
715 CC->cs_pid = con->client_socket; /* not necessarily portable */
716 CC->FirstExpressMessage = NULL;
721 strcpy(CC->lastcmdname, " ");
722 strcpy(CC->cs_clientname, "(unknown)");
723 strcpy(CC->curr_user,"");
724 strcpy(CC->net_node,"");
725 sprintf(CC->temp,"/tmp/CitServer.%d.%d", getpid(), CC->cs_pid);
726 strcpy(CC->cs_room, "");
727 strcpy(CC->cs_host, config.c_fqdn);
728 locate_host(CC->cs_host);
730 CC->upload_type = UPL_FILE;
733 session_num = session_count();
735 if ((config.c_maxsessions > 0)&&(session_num >= config.c_maxsessions))
738 if (CC->nologin==1) {
739 cprintf("%d %s: Too many users are already online (maximum is %d)\n",
740 ERROR+MAX_SESSIONS_EXCEEDED,
741 config.c_nodename,config.c_maxsessions);
744 cprintf("%d %s Citadel/UX server ready.\n",OK,config.c_nodename);
747 lprintf(3, "citserver[%3d]: started.\n", CC->cs_pid);
749 /* Run any session startup routines registered by loadable modules */
750 for (fcn = SessionHookTable; fcn != NULL; fcn = fcn->next) {
751 if (fcn->startstop == 1) {
752 (*fcn->h_function_pointer)(CC->cs_pid);
756 rec_log(CL_CONNECT, "");
760 if (client_gets(cmdbuf) < 1) cleanup(EXIT_NULL);
761 lprintf(5, "citserver[%3d]: %s\n", CC->cs_pid, cmdbuf);
762 /* hook_command_received(CC->cs_pid, cmdbuf); FIX */
765 * Let other clients see the last command we executed, but
766 * exclude NOOP because that would be boring.
768 if (strncasecmp(cmdbuf, "NOOP", 4)) {
769 strcpy(CC->lastcmdname, " ");
770 strncpy(CC->lastcmdname, cmdbuf, 4);
774 if ((strncasecmp(cmdbuf, "ENT0", 4)) && (strncasecmp(cmdbuf, "MESG", 4)) && (strncasecmp(cmdbuf, "MSGS", 4)))
776 CC->cs_flags &= ~CS_POSTING;
780 * This loop recognizes all server commands.
783 if (!strncasecmp(cmdbuf,"NOOP",4)) {
784 cprintf("%d%cok\n",OK,check_express());
787 else if (!strncasecmp(cmdbuf,"QUIT",4)) {
788 cprintf("%d Goodbye.\n",OK);
791 else if (!strncasecmp(cmdbuf,"LOUT",4)) {
792 if (CC->logged_in) logout(CC);
793 cprintf("%d logged out.\n",OK);
796 else if (!strncasecmp(cmdbuf,"USER",4)) {
797 cmd_user(&cmdbuf[5]);
800 else if (!strncasecmp(cmdbuf,"PASS",4)) {
801 cmd_pass(&cmdbuf[5]);
804 else if (!strncasecmp(cmdbuf,"NEWU",4)) {
805 cmd_newu(&cmdbuf[5]);
808 else if (!strncasecmp(cmdbuf,"SETP",4)) {
809 cmd_setp(&cmdbuf[5]);
812 else if (!strncasecmp(cmdbuf,"LRMS",4)) {
813 cmd_lrms(&cmdbuf[5]);
816 else if (!strncasecmp(cmdbuf,"LKRA",4)) {
817 cmd_lkra(&cmdbuf[5]);
820 else if (!strncasecmp(cmdbuf,"LKRN",4)) {
821 cmd_lkrn(&cmdbuf[5]);
824 else if (!strncasecmp(cmdbuf,"LKRO",4)) {
825 cmd_lkro(&cmdbuf[5]);
828 else if (!strncasecmp(cmdbuf,"LZRM",4)) {
829 cmd_lzrm(&cmdbuf[5]);
832 else if (!strncasecmp(cmdbuf,"GETU",4)) {
836 else if (!strncasecmp(cmdbuf,"SETU",4)) {
837 cmd_setu(&cmdbuf[5]);
840 else if (!strncasecmp(cmdbuf,"GOTO",4)) {
841 cmd_goto(&cmdbuf[5]);
844 else if (!strncasecmp(cmdbuf,"MSGS",4)) {
845 cmd_msgs(&cmdbuf[5]);
848 else if (!strncasecmp(cmdbuf,"WHOK",4)) {
852 else if (!strncasecmp(cmdbuf,"RDIR",4)) {
856 else if (!strncasecmp(cmdbuf,"MSG0",4)) {
857 cmd_msg0(&cmdbuf[5]);
860 else if (!strncasecmp(cmdbuf,"MSG2",4)) {
861 cmd_msg2(&cmdbuf[5]);
864 else if (!strncasecmp(cmdbuf,"MSG3",4)) {
865 cmd_msg3(&cmdbuf[5]);
868 else if (!strncasecmp(cmdbuf,"INFO",4)) {
872 else if (!strncasecmp(cmdbuf,"SLRP",4)) {
873 cmd_slrp(&cmdbuf[5]);
876 else if (!strncasecmp(cmdbuf,"INVT",4)) {
877 cmd_invt_kick(&cmdbuf[5],1);
880 else if (!strncasecmp(cmdbuf,"KICK",4)) {
881 cmd_invt_kick(&cmdbuf[5],0);
884 else if (!strncasecmp(cmdbuf,"GETR",4)) {
888 else if (!strncasecmp(cmdbuf,"SETR",4)) {
889 cmd_setr(&cmdbuf[5]);
892 else if (!strncasecmp(cmdbuf,"GETA",4)) {
896 else if (!strncasecmp(cmdbuf,"SETA",4)) {
897 cmd_seta(&cmdbuf[5]);
900 else if (!strncasecmp(cmdbuf,"ENT0",4)) {
901 cmd_ent0(&cmdbuf[5]);
904 else if (!strncasecmp(cmdbuf,"ENT3",4)) {
905 cmd_ent3(&cmdbuf[5]);
908 else if (!strncasecmp(cmdbuf,"RINF",4)) {
912 else if (!strncasecmp(cmdbuf,"DELE",4)) {
913 cmd_dele(&cmdbuf[5]);
916 else if (!strncasecmp(cmdbuf,"KILL",4)) {
917 cmd_kill(&cmdbuf[5]);
920 else if (!strncasecmp(cmdbuf,"CRE8",4)) {
921 cmd_cre8(&cmdbuf[5]);
924 else if (!strncasecmp(cmdbuf,"MOVE",4)) {
925 cmd_move(&cmdbuf[5]);
928 else if (!strncasecmp(cmdbuf,"FORG",4)) {
932 else if (!strncasecmp(cmdbuf,"MESG",4)) {
933 cmd_mesg(&cmdbuf[5]);
936 else if (!strncasecmp(cmdbuf,"EMSG",4)) {
937 cmd_emsg(&cmdbuf[5]);
940 else if (!strncasecmp(cmdbuf,"GNUR",4)) {
944 else if (!strncasecmp(cmdbuf,"GREG",4)) {
945 cmd_greg(&cmdbuf[5]);
948 else if (!strncasecmp(cmdbuf,"VALI",4)) {
949 cmd_vali(&cmdbuf[5]);
952 else if (!strncasecmp(cmdbuf,"EINF",4)) {
953 cmd_einf(&cmdbuf[5]);
956 else if (!strncasecmp(cmdbuf,"LIST",4)) {
960 else if (!strncasecmp(cmdbuf,"REGI",4)) {
964 else if (!strncasecmp(cmdbuf,"CHEK",4)) {
968 else if (!strncasecmp(cmdbuf,"DELF",4)) {
969 cmd_delf(&cmdbuf[5]);
972 else if (!strncasecmp(cmdbuf,"MOVF",4)) {
973 cmd_movf(&cmdbuf[5]);
976 else if (!strncasecmp(cmdbuf,"NETF",4)) {
977 cmd_netf(&cmdbuf[5]);
980 else if (!strncasecmp(cmdbuf,"RWHO",4)) {
984 else if (!strncasecmp(cmdbuf,"OPEN",4)) {
985 cmd_open(&cmdbuf[5]);
988 else if (!strncasecmp(cmdbuf,"CLOS",4)) {
992 else if (!strncasecmp(cmdbuf,"UOPN",4)) {
993 cmd_uopn(&cmdbuf[5]);
996 else if (!strncasecmp(cmdbuf,"UCLS",4)) {
997 cmd_ucls(&cmdbuf[5]);
1000 else if (!strncasecmp(cmdbuf,"READ",4)) {
1001 cmd_read(&cmdbuf[5]);
1004 else if (!strncasecmp(cmdbuf,"WRIT",4)) {
1005 cmd_writ(&cmdbuf[5]);
1008 else if (!strncasecmp(cmdbuf,"QUSR",4)) {
1009 cmd_qusr(&cmdbuf[5]);
1012 else if (!strncasecmp(cmdbuf,"ECHO",4)) {
1013 cmd_echo(&cmdbuf[5]);
1016 else if (!strncasecmp(cmdbuf,"OIMG",4)) {
1017 cmd_oimg(&cmdbuf[5]);
1020 else if (!strncasecmp(cmdbuf,"MORE",4)) {
1024 else if (!strncasecmp(cmdbuf,"NETP",4)) {
1025 cmd_netp(&cmdbuf[5]);
1028 else if (!strncasecmp(cmdbuf,"NDOP",4)) {
1029 cmd_ndop(&cmdbuf[5]);
1032 else if (!strncasecmp(cmdbuf,"NUOP",4)) {
1033 cmd_nuop(&cmdbuf[5]);
1036 else if (!strncasecmp(cmdbuf,"LFLR",4)) {
1040 else if (!strncasecmp(cmdbuf,"CFLR",4)) {
1041 cmd_cflr(&cmdbuf[5]);
1044 else if (!strncasecmp(cmdbuf,"KFLR",4)) {
1045 cmd_kflr(&cmdbuf[5]);
1048 else if (!strncasecmp(cmdbuf,"EFLR",4)) {
1049 cmd_eflr(&cmdbuf[5]);
1052 else if (!strncasecmp(cmdbuf,"IDEN",4)) {
1053 cmd_iden(&cmdbuf[5]);
1056 else if (!strncasecmp(cmdbuf,"IPGM",4)) {
1057 cmd_ipgm(&cmdbuf[5]);
1060 else if (!strncasecmp(cmdbuf,"EBIO",4)) {
1064 else if (!strncasecmp(cmdbuf,"RBIO",4)) {
1065 cmd_rbio(&cmdbuf[5]);
1068 else if (!strncasecmp(cmdbuf,"LBIO",4)) {
1072 else if (!strncasecmp(cmdbuf,"STEL",4)) {
1073 cmd_stel(&cmdbuf[5]);
1076 else if (!strncasecmp(cmdbuf,"TERM",4)) {
1077 cmd_term(&cmdbuf[5]);
1080 else if (!strncasecmp(cmdbuf,"DOWN",4)) {
1084 else if (!strncasecmp(cmdbuf,"SCDN",4)) {
1085 cmd_scdn(&cmdbuf[5]);
1088 else if (!strncasecmp(cmdbuf, "NSET", 4)) {
1089 cmd_nset(&cmdbuf[5]);
1092 else if (!strncasecmp(cmdbuf, "UIMG", 4)) {
1093 cmd_uimg(&cmdbuf[5]);
1096 else if (!strncasecmp(cmdbuf, "UCHG", 4)) {
1097 cmd_uchg(&cmdbuf[5]);
1100 else if (!strncasecmp(cmdbuf, "TIME", 4)) {
1104 else if (!strncasecmp(cmdbuf, "HCHG", 4)) {
1105 cmd_hchg(&cmdbuf[5]);
1108 else if (!strncasecmp(cmdbuf, "RCHG", 4)) {
1109 cmd_rchg(&cmdbuf[5]);
1112 else if (!strncasecmp(cmdbuf, "EXTN", 4)) {
1113 cmd_extn(&cmdbuf[5]);
1116 else if (!strncasecmp(cmdbuf, "AGUP", 4)) {
1117 cmd_agup(&cmdbuf[5]);
1120 else if (!strncasecmp(cmdbuf, "ASUP", 4)) {
1121 cmd_asup(&cmdbuf[5]);
1124 else if (!DLoader_Exec_Cmd(cmdbuf))
1126 cprintf("%d Unrecognized or unsupported command.\n",
1130 } while(strncasecmp(cmdbuf, "QUIT", 4));
1132 cleanup(EXIT_NORMAL);