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)
93 struct ExpressMessage *emptr;
95 lprintf(9, "cleanup_stuff() called\n");
97 lprintf(7, "Calling logout(%d)\n", CC->cs_pid);
100 rec_log(CL_TERMINATE,CC->curr_user);
102 lprintf(3, "citserver[%3d]: ended.\n",CC->cs_pid);
104 /* Run any cleanup routines registered by loadable modules */
105 PerformSessionHooks(EVT_STOP);
107 syslog(LOG_NOTICE,"session %d ended", CC->cs_pid);
109 /* Deallocate any unsent express messages */
110 begin_critical_section(S_SESSION_TABLE);
111 while (CC->FirstExpressMessage != NULL) {
112 emptr = CC->FirstExpressMessage;
113 CC->FirstExpressMessage = CC->FirstExpressMessage->next;
116 end_critical_section(S_SESSION_TABLE);
118 /* Deallocate any message list we might have in memory */
119 if (CC->msglist != NULL) free(CC->msglist);
121 /* Now get rid of the session and context */
122 lprintf(7, "cleanup_stuff() calling RemoveContext(%d)\n", CC->cs_pid);
125 /* While we still have an extra thread with no user attached to it,
126 * take the opportunity to do some housekeeping before exiting.
133 * set_wtmpsupp() - alter the session listing
135 void set_wtmpsupp(char *newtext)
137 strncpy(CC->cs_room,newtext,sizeof CC->cs_room);
138 CC->cs_room[sizeof CC->cs_room - 1] = 0;
139 time(&CC->cs_lastupdt);
141 /* Run any routines registered by loadable modules */
142 PerformSessionHooks(EVT_NEWROOM);
147 * call set_wtmpsupp() with the name of the current room, modified a bit...
149 void set_wtmpsupp_to_current_room() {
150 if (CC->quickroom.QRflags & QR_PRIVATE) {
151 set_wtmpsupp("<private room>");
153 else if (CC->quickroom.QRflags & QR_MAILBOX) {
154 set_wtmpsupp(&CC->quickroom.QRname[11]);
157 set_wtmpsupp(CC->quickroom.QRname);
164 * cmd_info() - tell the client about this server
166 void cmd_info(void) {
167 cprintf("%d Server info:\n",LISTING_FOLLOWS);
168 cprintf("%d\n",CC->cs_pid);
169 cprintf("%s\n",config.c_nodename);
170 cprintf("%s\n",config.c_humannode);
171 cprintf("%s\n",config.c_fqdn);
172 cprintf("%s\n",CITADEL);
173 cprintf("%d\n",REV_LEVEL);
174 cprintf("%s\n",config.c_bbs_city);
175 cprintf("%s\n",config.c_sysadm);
176 cprintf("%d\n",SERVER_TYPE);
177 cprintf("%s\n",config.c_moreprompt);
178 cprintf("1\n"); /* 1 = yes, this system supports floors */
182 void cmd_rchg(char *argbuf)
184 char newroomname[ROOMNAMELEN];
186 extract(newroomname, argbuf, 0);
187 if (strlen(newroomname) > 0) {
188 strncpy(CC->fake_roomname, newroomname, ROOMNAMELEN);
189 CC->fake_roomname[ROOMNAMELEN - 1] = 0;
192 strcpy(CC->fake_roomname, "");
194 cprintf("%d OK\n", OK);
197 void cmd_hchg(char *newhostname)
199 if ((newhostname) && (newhostname[0]))
201 bzero(CC->fake_hostname, 25);
202 strncpy(CC->fake_hostname, newhostname, 24);
205 strcpy(CC->fake_hostname, "");
206 cprintf("%d OK\n",OK);
209 void cmd_uchg(char *newusername)
211 if (CC->usersupp.axlevel < 6)
213 cprintf("%d You must be an Aide to use UCHG.\n",
214 ERROR+HIGHER_ACCESS_REQUIRED);
217 if ((newusername) && (newusername[0]))
219 CC->cs_flags &= ~CS_STEALTH;
220 bzero(CC->fake_username, 32);
221 if (strncasecmp(newusername, CC->curr_user, strlen(CC->curr_user)))
222 strncpy(CC->fake_username, newusername, 31);
226 CC->fake_username[0] = '\0';
227 CC->cs_flags |= CS_STEALTH;
233 * returns an asterisk if there are any express messages waiting,
236 char check_express(void) {
237 if (CC->FirstExpressMessage == NULL) {
251 cprintf("%d %ld\n", OK, tv);
255 * check a hostname against the public_clients file
257 int is_public_client(char *where)
262 if (!strcasecmp(where,"localhost")) return(1);
263 if (!strcasecmp(where,config.c_fqdn)) return(1);
265 fp = fopen("public_clients","r");
266 if (fp == NULL) return(0);
268 while (fgets(buf,256,fp)!=NULL) {
269 while (isspace((buf[strlen(buf)-1])))
270 buf[strlen(buf)-1] = 0;
271 if (!strcasecmp(buf,where)) {
283 * the client is identifying itself to the server
285 void cmd_iden(char *argbuf)
293 if (num_parms(argbuf)<4) {
294 cprintf("%d usage error\n",ERROR);
298 dev_code = extract_int(argbuf,0);
299 cli_code = extract_int(argbuf,1);
300 rev_level = extract_int(argbuf,2);
301 extract(desc,argbuf,3);
303 strncpy(from_host,config.c_fqdn,sizeof from_host);
304 from_host[sizeof from_host - 1] = 0;
305 if (num_parms(argbuf)>=5) extract(from_host,argbuf,4);
307 CC->cs_clientdev = dev_code;
308 CC->cs_clienttyp = cli_code;
309 CC->cs_clientver = rev_level;
310 strncpy(CC->cs_clientname,desc,31);
311 CC->cs_clientname[31] = 0;
313 if ((strlen(from_host)>0) &&
314 (is_public_client(CC->cs_host))) {
315 strncpy(CC->cs_host,from_host,24);
318 set_wtmpsupp_to_current_room();
320 syslog(LOG_NOTICE,"client %d/%d/%01d.%02d (%s)\n",
326 cprintf("%d Ok\n",OK);
331 * enter or exit "stealth mode"
333 void cmd_stel(char *cmdbuf)
337 requested_mode = extract_int(cmdbuf,0);
338 if (requested_mode !=0) requested_mode = 1;
340 if (!CC->logged_in) {
341 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
345 if (CC->usersupp.axlevel < 6) {
346 cprintf("%d You must be an Aide to use stealth mode.\n",
347 ERROR+HIGHER_ACCESS_REQUIRED);
351 if (CC->cs_flags & CS_STEALTH) {
352 if (requested_mode == 0)
353 CC->cs_flags = CC->cs_flags-CS_STEALTH;
356 if (requested_mode == 1)
357 CC->cs_flags = CC->cs_flags|CS_STEALTH;
360 set_wtmpsupp_to_current_room();
361 cprintf("%d Ok\n",OK);
368 * display system messages or help
370 void cmd_mesg(char *mname)
377 extract(buf,mname,0);
382 strcpy(dirs[0],"messages");
383 strcpy(dirs[1],"help");
384 mesg_locate(targ,buf,2,dirs);
389 if (strlen(targ)==0) {
390 cprintf("%d '%s' not found.\n",ERROR,mname);
394 mfp = fopen(targ,"r");
396 cprintf("%d Cannot open '%s': %s\n",
397 ERROR,targ,strerror(errno));
400 cprintf("%d %s\n",LISTING_FOLLOWS,buf);
402 while (fgets(buf,255,mfp)!=NULL) {
403 buf[strlen(buf)-1] = 0;
414 * enter system messages or help
416 void cmd_emsg(char *mname)
424 if (CC->usersupp.axlevel < 6) {
425 cprintf("%d You must be an Aide to edit system messages.\n",
426 ERROR+HIGHER_ACCESS_REQUIRED);
430 extract(buf,mname,0);
431 for (a=0; a<strlen(buf); ++a) { /* security measure */
432 if (buf[a] == '/') buf[a] = '.';
437 strcpy(dirs[0],"messages");
438 strcpy(dirs[1],"help");
439 mesg_locate(targ,buf,2,dirs);
443 if (strlen(targ)==0) {
444 snprintf(targ, sizeof targ, "./help/%s", buf);
447 mfp = fopen(targ,"w");
449 cprintf("%d Cannot open '%s': %s\n",
450 ERROR,targ,strerror(errno));
453 cprintf("%d %s\n", SEND_LISTING, targ);
455 while (client_gets(buf), strcmp(buf, "000")) {
456 fprintf(mfp, "%s\n", buf);
466 void cmd_rwho(void) {
467 struct CitContext *cptr;
470 char un[40], room[40], host[40], flags[5];
472 aide = CC->usersupp.axlevel >= 6;
473 cprintf("%d\n",LISTING_FOLLOWS);
475 for (cptr = ContextList; cptr != NULL; cptr = cptr->next)
480 if (cptr->cs_flags & CS_POSTING)
485 if (cptr->fake_username[0])
487 strcpy(un, cptr->fake_username);
491 strcpy(un, cptr->curr_user);
493 if (cptr->fake_hostname[0])
495 strcpy(host, cptr->fake_hostname);
499 strcpy(host, cptr->cs_host);
501 if (cptr->fake_roomname[0])
503 strcpy(room, cptr->fake_roomname);
507 strcpy(room, cptr->cs_room);
510 if ((aide) && (spoofed))
513 if ((cptr->cs_flags & CS_STEALTH) && (aide))
516 if (((cptr->cs_flags&CS_STEALTH)==0) || (aide))
518 cprintf("%d|%s|%s|%s|%s|%ld|%s|%s\n",
519 cptr->cs_pid, un, room,
520 host, cptr->cs_clientname,
521 (long)(cptr->lastidle),
522 cptr->lastcmdname, flags);
524 if ((spoofed) && (aide))
526 cprintf("%d|%s|%s|%s|%s|%ld|%s|%s\n",
527 cptr->cs_pid, cptr->curr_user, cptr->cs_room,
528 cptr->cs_host, cptr->cs_clientname,
529 (long)(cptr->lastidle),
530 cptr->lastcmdname, flags);
539 * Terminate another running session
541 void cmd_term(char *cmdbuf)
544 struct CitContext *ccptr;
545 int session_to_kill = 0;
547 if (!CC->logged_in) {
548 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
552 if (CC->usersupp.axlevel < 6) {
553 cprintf("%d You must be an Aide to terminate sessions.\n",
554 ERROR+HIGHER_ACCESS_REQUIRED);
558 session_num = extract_int(cmdbuf, 0);
559 if (session_num == CC->cs_pid) {
560 cprintf("%d You can't kill your own session.\n", ERROR);
564 begin_critical_section(S_SESSION_TABLE);
565 for (ccptr = ContextList; ccptr != NULL; ccptr = ccptr->next) {
566 if (session_num == ccptr->cs_pid) {
567 session_to_kill = ccptr->cs_pid;
570 end_critical_section(S_SESSION_TABLE);
572 if (session_to_kill > 0) {
573 kill_session(ccptr->cs_pid);
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->FirstExpressMessage = 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 bzero(cmdbuf, 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,"INFO",4)) {
841 else if (!strncasecmp(cmdbuf,"SLRP",4)) {
842 cmd_slrp(&cmdbuf[5]);
845 else if (!strncasecmp(cmdbuf,"INVT",4)) {
846 cmd_invt_kick(&cmdbuf[5],1);
849 else if (!strncasecmp(cmdbuf,"KICK",4)) {
850 cmd_invt_kick(&cmdbuf[5],0);
853 else if (!strncasecmp(cmdbuf,"GETR",4)) {
857 else if (!strncasecmp(cmdbuf,"SETR",4)) {
858 cmd_setr(&cmdbuf[5]);
861 else if (!strncasecmp(cmdbuf,"GETA",4)) {
865 else if (!strncasecmp(cmdbuf,"SETA",4)) {
866 cmd_seta(&cmdbuf[5]);
869 else if (!strncasecmp(cmdbuf,"ENT0",4)) {
870 cmd_ent0(&cmdbuf[5]);
873 else if (!strncasecmp(cmdbuf,"ENT3",4)) {
874 cmd_ent3(&cmdbuf[5]);
877 else if (!strncasecmp(cmdbuf,"RINF",4)) {
881 else if (!strncasecmp(cmdbuf,"DELE",4)) {
882 cmd_dele(&cmdbuf[5]);
885 else if (!strncasecmp(cmdbuf,"KILL",4)) {
886 cmd_kill(&cmdbuf[5]);
889 else if (!strncasecmp(cmdbuf,"CRE8",4)) {
890 cmd_cre8(&cmdbuf[5]);
893 else if (!strncasecmp(cmdbuf,"MOVE",4)) {
894 cmd_move(&cmdbuf[5]);
897 else if (!strncasecmp(cmdbuf,"FORG",4)) {
901 else if (!strncasecmp(cmdbuf,"MESG",4)) {
902 cmd_mesg(&cmdbuf[5]);
905 else if (!strncasecmp(cmdbuf,"EMSG",4)) {
906 cmd_emsg(&cmdbuf[5]);
909 else if (!strncasecmp(cmdbuf,"GNUR",4)) {
913 else if (!strncasecmp(cmdbuf,"GREG",4)) {
914 cmd_greg(&cmdbuf[5]);
917 else if (!strncasecmp(cmdbuf,"VALI",4)) {
918 cmd_vali(&cmdbuf[5]);
921 else if (!strncasecmp(cmdbuf,"EINF",4)) {
922 cmd_einf(&cmdbuf[5]);
925 else if (!strncasecmp(cmdbuf,"LIST",4)) {
929 else if (!strncasecmp(cmdbuf,"REGI",4)) {
933 else if (!strncasecmp(cmdbuf,"CHEK",4)) {
937 else if (!strncasecmp(cmdbuf,"DELF",4)) {
938 cmd_delf(&cmdbuf[5]);
941 else if (!strncasecmp(cmdbuf,"MOVF",4)) {
942 cmd_movf(&cmdbuf[5]);
945 else if (!strncasecmp(cmdbuf,"NETF",4)) {
946 cmd_netf(&cmdbuf[5]);
949 else if (!strncasecmp(cmdbuf,"RWHO",4)) {
953 else if (!strncasecmp(cmdbuf,"OPEN",4)) {
954 cmd_open(&cmdbuf[5]);
957 else if (!strncasecmp(cmdbuf,"CLOS",4)) {
961 else if (!strncasecmp(cmdbuf,"UOPN",4)) {
962 cmd_uopn(&cmdbuf[5]);
965 else if (!strncasecmp(cmdbuf,"UCLS",4)) {
966 cmd_ucls(&cmdbuf[5]);
969 else if (!strncasecmp(cmdbuf,"READ",4)) {
970 cmd_read(&cmdbuf[5]);
973 else if (!strncasecmp(cmdbuf,"WRIT",4)) {
974 cmd_writ(&cmdbuf[5]);
977 else if (!strncasecmp(cmdbuf,"QUSR",4)) {
978 cmd_qusr(&cmdbuf[5]);
981 else if (!strncasecmp(cmdbuf,"ECHO",4)) {
982 cmd_echo(&cmdbuf[5]);
985 else if (!strncasecmp(cmdbuf,"OIMG",4)) {
986 cmd_oimg(&cmdbuf[5]);
989 else if (!strncasecmp(cmdbuf,"MORE",4)) {
993 else if (!strncasecmp(cmdbuf,"NETP",4)) {
994 cmd_netp(&cmdbuf[5]);
997 else if (!strncasecmp(cmdbuf,"NDOP",4)) {
998 cmd_ndop(&cmdbuf[5]);
1001 else if (!strncasecmp(cmdbuf,"NUOP",4)) {
1002 cmd_nuop(&cmdbuf[5]);
1005 else if (!strncasecmp(cmdbuf,"LFLR",4)) {
1009 else if (!strncasecmp(cmdbuf,"CFLR",4)) {
1010 cmd_cflr(&cmdbuf[5]);
1013 else if (!strncasecmp(cmdbuf,"KFLR",4)) {
1014 cmd_kflr(&cmdbuf[5]);
1017 else if (!strncasecmp(cmdbuf,"EFLR",4)) {
1018 cmd_eflr(&cmdbuf[5]);
1021 else if (!strncasecmp(cmdbuf,"IDEN",4)) {
1022 cmd_iden(&cmdbuf[5]);
1025 else if (!strncasecmp(cmdbuf,"IPGM",4)) {
1026 cmd_ipgm(&cmdbuf[5]);
1029 else if (!strncasecmp(cmdbuf,"EBIO",4)) {
1033 else if (!strncasecmp(cmdbuf,"RBIO",4)) {
1034 cmd_rbio(&cmdbuf[5]);
1037 else if (!strncasecmp(cmdbuf,"LBIO",4)) {
1041 else if (!strncasecmp(cmdbuf,"STEL",4)) {
1042 cmd_stel(&cmdbuf[5]);
1045 else if (!strncasecmp(cmdbuf,"TERM",4)) {
1046 cmd_term(&cmdbuf[5]);
1049 else if (!strncasecmp(cmdbuf,"DOWN",4)) {
1053 else if (!strncasecmp(cmdbuf,"SCDN",4)) {
1054 cmd_scdn(&cmdbuf[5]);
1057 else if (!strncasecmp(cmdbuf, "NSET", 4)) {
1058 cmd_nset(&cmdbuf[5]);
1061 else if (!strncasecmp(cmdbuf, "UIMG", 4)) {
1062 cmd_uimg(&cmdbuf[5]);
1065 else if (!strncasecmp(cmdbuf, "UCHG", 4)) {
1066 cmd_uchg(&cmdbuf[5]);
1069 else if (!strncasecmp(cmdbuf, "TIME", 4)) {
1073 else if (!strncasecmp(cmdbuf, "HCHG", 4)) {
1074 cmd_hchg(&cmdbuf[5]);
1077 else if (!strncasecmp(cmdbuf, "RCHG", 4)) {
1078 cmd_rchg(&cmdbuf[5]);
1081 else if (!strncasecmp(cmdbuf, "AGUP", 4)) {
1082 cmd_agup(&cmdbuf[5]);
1085 else if (!strncasecmp(cmdbuf, "ASUP", 4)) {
1086 cmd_asup(&cmdbuf[5]);
1089 else if (!strncasecmp(cmdbuf, "GPEX", 4)) {
1090 cmd_gpex(&cmdbuf[5]);
1093 else if (!strncasecmp(cmdbuf, "SPEX", 4)) {
1094 cmd_spex(&cmdbuf[5]);
1097 else if (!strncasecmp(cmdbuf, "CONF", 4)) {
1098 cmd_conf(&cmdbuf[5]);
1101 else if (!DLoader_Exec_Cmd(cmdbuf))
1103 cprintf("%d Unrecognized or unsupported command.\n",
1107 } while(strncasecmp(cmdbuf, "QUIT", 4));
1109 cleanup(EXIT_NORMAL);