19 #include <sys/socket.h>
20 #include <netinet/in.h>
21 #include <arpa/inet.h>
24 #include "sysdep_decls.h"
25 #include "citserver.h"
28 #include "housekeeping.h"
33 #include "locate_host.h"
36 #include "dynloader.h"
41 struct CitContext *ContextList = NULL;
42 int ScheduledShutdown = 0;
45 * Various things that need to be initialized at startup
47 void master_startup(void) {
48 lprintf(7, "Opening databases\n");
51 lprintf(7, "Checking floor reference counts\n");
54 lprintf(7, "Creating base rooms (if necessary)\n");
55 create_room(BASEROOM, 0, "", 0);
56 create_room(AIDEROOM, 4, "", 0);
57 create_room(config.c_twitroom, 0, "", 0);
61 * Cleanup routine to be called when the server is shutting down.
63 void master_cleanup(void) {
64 struct CleanupFunctionHook *fcn;
66 /* Cancel all running sessions */
67 lprintf(7, "Cancelling running sessions...\n");
68 while (ContextList != NULL) {
69 kill_session(ContextList->cs_pid);
72 /* Run any cleanup routines registered by loadable modules */
73 for (fcn = CleanupHookTable; fcn != NULL; fcn = fcn->next) {
74 (*fcn->h_function_pointer)();
78 lprintf(7, "Closing databases\n");
81 /* Do system-dependent stuff */
82 sysdep_master_cleanup();
85 lprintf(3, "citserver: exiting.\n");
86 fflush(stdout); fflush(stderr);
92 * Gracefully terminate the session and thread.
93 * (This is called as a cleanup handler by the thread library.)
95 * All NON-system-dependent stuff is done in this function.
96 * System-dependent session/thread cleanup is in cleanup() in sysdep.c
98 void cleanup_stuff(void *arg)
101 lprintf(9, "cleanup_stuff() called\n");
103 lprintf(7, "Calling logout(%d)\n", CC->cs_pid);
106 rec_log(CL_TERMINATE,CC->curr_user);
108 lprintf(3, "citserver[%3d]: ended.\n",CC->cs_pid);
110 /* Run any cleanup routines registered by loadable modules */
111 PerformSessionHooks(EVT_STOP);
113 syslog(LOG_NOTICE,"session %d ended", CC->cs_pid);
115 /* Deallocate any message list we might have in memory */
116 if (CC->msglist != NULL) phree(CC->msglist);
118 /* Now get rid of the session and context */
119 lprintf(7, "cleanup_stuff() calling RemoveContext(%d)\n", CC->cs_pid);
122 /* While we still have an extra thread with no user attached to it,
123 * take the opportunity to do some housekeeping before exiting.
130 * set_wtmpsupp() - alter the session listing
132 void set_wtmpsupp(char *newtext)
134 strncpy(CC->cs_room,newtext,sizeof CC->cs_room);
135 CC->cs_room[sizeof CC->cs_room - 1] = 0;
136 time(&CC->cs_lastupdt);
138 /* Run any routines registered by loadable modules */
139 PerformSessionHooks(EVT_NEWROOM);
144 * call set_wtmpsupp() with the name of the current room, modified a bit...
146 void set_wtmpsupp_to_current_room() {
147 if (CC->quickroom.QRflags & QR_PRIVATE) {
148 set_wtmpsupp("<private room>");
150 else if (CC->quickroom.QRflags & QR_MAILBOX) {
151 set_wtmpsupp(&CC->quickroom.QRname[11]);
154 set_wtmpsupp(CC->quickroom.QRname);
161 * cmd_info() - tell the client about this server
163 void cmd_info(void) {
164 cprintf("%d Server info:\n",LISTING_FOLLOWS);
165 cprintf("%d\n",CC->cs_pid);
166 cprintf("%s\n",config.c_nodename);
167 cprintf("%s\n",config.c_humannode);
168 cprintf("%s\n",config.c_fqdn);
169 cprintf("%s\n",CITADEL);
170 cprintf("%d\n",REV_LEVEL);
171 cprintf("%s\n",config.c_bbs_city);
172 cprintf("%s\n",config.c_sysadm);
173 cprintf("%d\n",SERVER_TYPE);
174 cprintf("%s\n",config.c_moreprompt);
175 cprintf("1\n"); /* 1 = yes, this system supports floors */
176 cprintf("1\n"); /* 1 = we support the extended paging options */
180 void cmd_rchg(char *argbuf)
182 char newroomname[256]; /* set to 256 to prevent buffer overruns <dme>*/
184 extract(newroomname, argbuf, 0);
185 newroomname[ROOMNAMELEN] = 0;
186 if (strlen(newroomname) > 0) {
187 strncpy(CC->fake_roomname, newroomname, ROOMNAMELEN);
188 CC->fake_roomname[ROOMNAMELEN - 1] = 0;
191 strcpy(CC->fake_roomname, "");
193 cprintf("%d OK\n", OK);
196 void cmd_hchg(char *newhostname)
198 if ((newhostname) && (newhostname[0]))
200 memset(CC->fake_hostname, 0, 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 memset(CC->fake_username, 0, 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 whether two hostnames match.
255 * "Realname" should be an actual name of a client that is trying to connect;
256 * "testname" should be the value we are comparing it with. The idea is that we
257 * want to compare with both the abbreviated and fully-qualified versions of
258 * "testname;" some people define "localhost" as "localhost.foo.com," etc.
260 static int hostnames_match(const char *realname, const char *testname) {
263 if (!strcasecmp(realname, testname))
266 if ((he = gethostbyname(testname)) != NULL)
267 if (!strcasecmp(realname, he->h_name))
274 * check a hostname against the public_clients file
276 int is_public_client(char *where)
281 if (hostnames_match(where,"localhost")) return(1);
282 if (hostnames_match(where,config.c_fqdn)) return(1);
284 fp = fopen("public_clients","r");
285 if (fp == NULL) return(0);
287 while (fgets(buf,256,fp)!=NULL) {
288 while (isspace((buf[strlen(buf)-1])))
289 buf[strlen(buf)-1] = 0;
290 if (hostnames_match(where,buf)) {
302 * the client is identifying itself to the server
304 void cmd_iden(char *argbuf)
314 if (num_parms(argbuf)<4) {
315 cprintf("%d usage error\n",ERROR);
319 dev_code = extract_int(argbuf,0);
320 cli_code = extract_int(argbuf,1);
321 rev_level = extract_int(argbuf,2);
322 extract(desc,argbuf,3);
324 strncpy(from_host,config.c_fqdn,sizeof from_host);
325 from_host[sizeof from_host - 1] = 0;
326 if (num_parms(argbuf)>=5) extract(from_host,argbuf,4);
328 CC->cs_clientdev = dev_code;
329 CC->cs_clienttyp = cli_code;
330 CC->cs_clientver = rev_level;
331 strncpy(CC->cs_clientname,desc,31);
332 CC->cs_clientname[31] = 0;
334 if ((strlen(from_host)>0) &&
335 (is_public_client(CC->cs_host))) {
336 if (inet_aton(from_host, &addr) &&
337 (he = gethostbyaddr((char*)&addr, sizeof addr, AF_INET)) !=
339 strncpy(CC->cs_host,he->h_name,24);
341 strncpy(CC->cs_host,from_host,24);
344 set_wtmpsupp_to_current_room();
346 syslog(LOG_NOTICE,"client %d/%d/%01d.%02d (%s)\n",
352 cprintf("%d Ok\n",OK);
357 * enter or exit "stealth mode"
359 void cmd_stel(char *cmdbuf)
363 requested_mode = extract_int(cmdbuf,0);
364 if (requested_mode !=0) requested_mode = 1;
366 if (!CC->logged_in) {
367 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
371 if (CC->usersupp.axlevel < 6) {
372 cprintf("%d You must be an Aide to use stealth mode.\n",
373 ERROR+HIGHER_ACCESS_REQUIRED);
377 if (CC->cs_flags & CS_STEALTH) {
378 if (requested_mode == 0)
379 CC->cs_flags = CC->cs_flags-CS_STEALTH;
382 if (requested_mode == 1)
383 CC->cs_flags = CC->cs_flags|CS_STEALTH;
386 set_wtmpsupp_to_current_room();
387 cprintf("%d Ok\n",OK);
394 * display system messages or help
396 void cmd_mesg(char *mname)
403 extract(buf,mname,0);
408 strcpy(dirs[0],"messages");
409 strcpy(dirs[1],"help");
410 mesg_locate(targ,buf,2,dirs);
415 if (strlen(targ)==0) {
416 cprintf("%d '%s' not found.\n",ERROR,mname);
420 mfp = fopen(targ,"r");
422 cprintf("%d Cannot open '%s': %s\n",
423 ERROR,targ,strerror(errno));
426 cprintf("%d %s\n",LISTING_FOLLOWS,buf);
428 while (fgets(buf,255,mfp)!=NULL) {
429 buf[strlen(buf)-1] = 0;
440 * enter system messages or help
442 void cmd_emsg(char *mname)
450 if (CC->usersupp.axlevel < 6) {
451 cprintf("%d You must be an Aide to edit system messages.\n",
452 ERROR+HIGHER_ACCESS_REQUIRED);
456 extract(buf,mname,0);
457 for (a=0; a<strlen(buf); ++a) { /* security measure */
458 if (buf[a] == '/') buf[a] = '.';
463 strcpy(dirs[0],"messages");
464 strcpy(dirs[1],"help");
465 mesg_locate(targ,buf,2,dirs);
469 if (strlen(targ)==0) {
470 snprintf(targ, sizeof targ, "./help/%s", buf);
473 mfp = fopen(targ,"w");
475 cprintf("%d Cannot open '%s': %s\n",
476 ERROR,targ,strerror(errno));
479 cprintf("%d %s\n", SEND_LISTING, targ);
481 while (client_gets(buf), strcmp(buf, "000")) {
482 fprintf(mfp, "%s\n", buf);
492 void cmd_rwho(void) {
493 struct CitContext *cptr;
496 char un[40], room[40], host[40], flags[5];
498 aide = CC->usersupp.axlevel >= 6;
499 cprintf("%d\n",LISTING_FOLLOWS);
501 for (cptr = ContextList; cptr != NULL; cptr = cptr->next)
506 if (cptr->cs_flags & CS_POSTING)
511 if (cptr->fake_username[0])
513 strcpy(un, cptr->fake_username);
517 strcpy(un, cptr->curr_user);
519 if (cptr->fake_hostname[0])
521 strcpy(host, cptr->fake_hostname);
525 strcpy(host, cptr->cs_host);
527 if (cptr->fake_roomname[0])
529 strcpy(room, cptr->fake_roomname);
533 strcpy(room, cptr->cs_room);
536 if ((aide) && (spoofed))
539 if ((cptr->cs_flags & CS_STEALTH) && (aide))
542 if (((cptr->cs_flags&CS_STEALTH)==0) || (aide))
544 cprintf("%d|%s|%s|%s|%s|%ld|%s|%s\n",
545 cptr->cs_pid, un, room,
546 host, cptr->cs_clientname,
547 (long)(cptr->lastidle),
548 cptr->lastcmdname, flags);
550 if ((spoofed) && (aide))
552 cprintf("%d|%s|%s|%s|%s|%ld|%s|%s\n",
553 cptr->cs_pid, cptr->curr_user, cptr->cs_room,
554 cptr->cs_host, cptr->cs_clientname,
555 (long)(cptr->lastidle),
556 cptr->lastcmdname, flags);
565 * Terminate another running session
567 void cmd_term(char *cmdbuf)
570 struct CitContext *ccptr;
571 int session_to_kill = 0;
573 if (!CC->logged_in) {
574 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
578 if (CC->usersupp.axlevel < 6) {
579 cprintf("%d You must be an Aide to terminate sessions.\n",
580 ERROR+HIGHER_ACCESS_REQUIRED);
584 session_num = extract_int(cmdbuf, 0);
585 if (session_num == CC->cs_pid) {
586 cprintf("%d You can't kill your own session.\n", ERROR);
590 lprintf(9, "Locating session to kill\n");
591 begin_critical_section(S_SESSION_TABLE);
592 for (ccptr = ContextList; ccptr != NULL; ccptr = ccptr->next) {
593 if (session_num == ccptr->cs_pid) {
594 session_to_kill = ccptr->cs_pid;
597 end_critical_section(S_SESSION_TABLE);
598 lprintf(9, "session_to_kill == %d\n", session_to_kill);
600 if (session_to_kill > 0) {
601 lprintf(9, "calling kill_session()\n");
602 kill_session(session_to_kill);
603 cprintf("%d Session terminated.\n", OK);
606 cprintf("%d No such session.\n", ERROR);
615 * get the paginator prompt
617 void cmd_more(void) {
618 cprintf("%d %s\n",OK,config.c_moreprompt);
624 void cmd_echo(char *etext)
626 cprintf("%d %s\n",OK,etext);
632 * identify as internal program
634 void cmd_ipgm(char *argbuf)
638 secret = extract_int(argbuf, 0);
639 if (secret == config.c_ipgm_secret) {
640 CC->internal_pgm = 1;
641 strcpy(CC->curr_user, "<internal program>");
642 CC->cs_flags = CC->cs_flags|CS_STEALTH;
643 cprintf("%d Authenticated as an internal program.\n",OK);
646 cprintf("%d Authentication failed.\n",ERROR);
652 * Shut down the server
654 void cmd_down(void) {
655 if (!CC->logged_in) {
656 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
660 if (CC->usersupp.axlevel < 6) {
661 cprintf("%d You must be an Aide to shut down the server.\n",
662 ERROR+HIGHER_ACCESS_REQUIRED);
666 cprintf("%d Shutting down server. Goodbye.\n", OK);
671 * Schedule or cancel a server shutdown
673 void cmd_scdn(char *argbuf)
677 if (!CC->logged_in) {
678 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
682 if (CC->usersupp.axlevel < 6) {
683 cprintf("%d You must be an Aide to schedule a shutdown.\n",
684 ERROR+HIGHER_ACCESS_REQUIRED);
688 new_state = extract_int(argbuf, 0);
689 if ((new_state == 0) || (new_state == 1)) {
690 ScheduledShutdown = new_state;
692 cprintf("%d %d\n", OK, ScheduledShutdown);
699 void *context_loop(struct CitContext *con)
705 * Wedge our way into the context table.
710 * Initialize some variables specific to our context.
713 CC->internal_pgm = 0;
714 CC->download_fp = NULL;
715 CC->upload_fp = NULL;
716 CC->cs_pid = con->client_socket; /* not necessarily portable */
717 CC->FirstExpressMessage = NULL;
722 strcpy(CC->lastcmdname, " ");
723 strcpy(CC->cs_clientname, "(unknown)");
724 strcpy(CC->curr_user,"(not logged in)");
725 strcpy(CC->net_node,"");
726 snprintf(CC->temp, sizeof CC->temp, "/tmp/CitServer.%d.%d", getpid(), CC->cs_pid);
727 strcpy(CC->cs_room, "(no room)");
728 strncpy(CC->cs_host, config.c_fqdn, sizeof CC->cs_host);
729 CC->cs_host[sizeof CC->cs_host - 1] = 0;
730 locate_host(CC->cs_host);
732 CC->upload_type = UPL_FILE;
735 num_sessions = session_count();
737 if ((config.c_maxsessions > 0)&&(num_sessions > config.c_maxsessions))
740 if (CC->nologin==1) {
741 cprintf("%d %s: Too many users are already online (maximum is %d)\n",
742 ERROR+MAX_SESSIONS_EXCEEDED,
743 config.c_nodename,config.c_maxsessions);
746 cprintf("%d %s Citadel/UX server ready.\n",OK,config.c_nodename);
749 lprintf(3, "citserver[%3d]: started.\n", CC->cs_pid);
751 /* Run any session startup routines registered by loadable modules */
752 PerformSessionHooks(EVT_START);
754 rec_log(CL_CONNECT, "");
758 memset(cmdbuf, 0, sizeof cmdbuf); /* Clear it, just in case */
759 if (client_gets(cmdbuf) < 1) cleanup(EXIT_NULL);
760 lprintf(5, "citserver[%3d]: %s\n", CC->cs_pid, cmdbuf);
763 * Let other clients see the last command we executed, but
764 * exclude NOOP because that would be boring.
766 if (strncasecmp(cmdbuf, "NOOP", 4)) {
767 strcpy(CC->lastcmdname, " ");
768 strncpy(CC->lastcmdname, cmdbuf, 4);
772 if ((strncasecmp(cmdbuf, "ENT0", 4)) && (strncasecmp(cmdbuf, "MESG", 4)) && (strncasecmp(cmdbuf, "MSGS", 4)))
774 CC->cs_flags &= ~CS_POSTING;
778 * This loop recognizes all server commands.
781 if (!strncasecmp(cmdbuf,"NOOP",4)) {
782 cprintf("%d%cok\n",OK,check_express());
785 else if (!strncasecmp(cmdbuf,"QUIT",4)) {
786 cprintf("%d Goodbye.\n",OK);
789 else if (!strncasecmp(cmdbuf,"LOUT",4)) {
790 if (CC->logged_in) logout(CC);
791 cprintf("%d logged out.\n",OK);
794 else if (!strncasecmp(cmdbuf,"USER",4)) {
795 cmd_user(&cmdbuf[5]);
798 else if (!strncasecmp(cmdbuf,"PASS",4)) {
799 cmd_pass(&cmdbuf[5]);
802 else if (!strncasecmp(cmdbuf,"NEWU",4)) {
803 cmd_newu(&cmdbuf[5]);
806 else if (!strncasecmp(cmdbuf,"SETP",4)) {
807 cmd_setp(&cmdbuf[5]);
810 else if (!strncasecmp(cmdbuf,"LRMS",4)) {
811 cmd_lrms(&cmdbuf[5]);
814 else if (!strncasecmp(cmdbuf,"LKRA",4)) {
815 cmd_lkra(&cmdbuf[5]);
818 else if (!strncasecmp(cmdbuf,"LKRN",4)) {
819 cmd_lkrn(&cmdbuf[5]);
822 else if (!strncasecmp(cmdbuf,"LKRO",4)) {
823 cmd_lkro(&cmdbuf[5]);
826 else if (!strncasecmp(cmdbuf,"LZRM",4)) {
827 cmd_lzrm(&cmdbuf[5]);
830 else if (!strncasecmp(cmdbuf,"GETU",4)) {
834 else if (!strncasecmp(cmdbuf,"SETU",4)) {
835 cmd_setu(&cmdbuf[5]);
838 else if (!strncasecmp(cmdbuf,"GOTO",4)) {
839 cmd_goto(&cmdbuf[5]);
842 else if (!strncasecmp(cmdbuf,"MSGS",4)) {
843 cmd_msgs(&cmdbuf[5]);
846 else if (!strncasecmp(cmdbuf,"WHOK",4)) {
850 else if (!strncasecmp(cmdbuf,"RDIR",4)) {
854 else if (!strncasecmp(cmdbuf,"MSG0",4)) {
855 cmd_msg0(&cmdbuf[5]);
858 else if (!strncasecmp(cmdbuf,"MSG2",4)) {
859 cmd_msg2(&cmdbuf[5]);
862 else if (!strncasecmp(cmdbuf,"MSG3",4)) {
863 cmd_msg3(&cmdbuf[5]);
866 else if (!strncasecmp(cmdbuf,"MSG4",4)) {
867 cmd_msg4(&cmdbuf[5]);
870 else if (!strncasecmp(cmdbuf,"OPNA",4)) {
871 cmd_opna(&cmdbuf[5]);
874 else if (!strncasecmp(cmdbuf,"INFO",4)) {
878 else if (!strncasecmp(cmdbuf,"SLRP",4)) {
879 cmd_slrp(&cmdbuf[5]);
882 else if (!strncasecmp(cmdbuf,"INVT",4)) {
883 cmd_invt_kick(&cmdbuf[5],1);
886 else if (!strncasecmp(cmdbuf,"KICK",4)) {
887 cmd_invt_kick(&cmdbuf[5],0);
890 else if (!strncasecmp(cmdbuf,"GETR",4)) {
894 else if (!strncasecmp(cmdbuf,"SETR",4)) {
895 cmd_setr(&cmdbuf[5]);
898 else if (!strncasecmp(cmdbuf,"GETA",4)) {
902 else if (!strncasecmp(cmdbuf,"SETA",4)) {
903 cmd_seta(&cmdbuf[5]);
906 else if (!strncasecmp(cmdbuf,"ENT0",4)) {
907 cmd_ent0(&cmdbuf[5]);
910 else if (!strncasecmp(cmdbuf,"ENT3",4)) {
911 cmd_ent3(&cmdbuf[5]);
914 else if (!strncasecmp(cmdbuf,"RINF",4)) {
918 else if (!strncasecmp(cmdbuf,"DELE",4)) {
919 cmd_dele(&cmdbuf[5]);
922 else if (!strncasecmp(cmdbuf,"KILL",4)) {
923 cmd_kill(&cmdbuf[5]);
926 else if (!strncasecmp(cmdbuf,"CRE8",4)) {
927 cmd_cre8(&cmdbuf[5]);
930 else if (!strncasecmp(cmdbuf,"MOVE",4)) {
931 cmd_move(&cmdbuf[5]);
934 else if (!strncasecmp(cmdbuf,"FORG",4)) {
938 else if (!strncasecmp(cmdbuf,"MESG",4)) {
939 cmd_mesg(&cmdbuf[5]);
942 else if (!strncasecmp(cmdbuf,"EMSG",4)) {
943 cmd_emsg(&cmdbuf[5]);
946 else if (!strncasecmp(cmdbuf,"GNUR",4)) {
950 else if (!strncasecmp(cmdbuf,"GREG",4)) {
951 cmd_greg(&cmdbuf[5]);
954 else if (!strncasecmp(cmdbuf,"VALI",4)) {
955 cmd_vali(&cmdbuf[5]);
958 else if (!strncasecmp(cmdbuf,"EINF",4)) {
959 cmd_einf(&cmdbuf[5]);
962 else if (!strncasecmp(cmdbuf,"LIST",4)) {
966 else if (!strncasecmp(cmdbuf,"REGI",4)) {
970 else if (!strncasecmp(cmdbuf,"CHEK",4)) {
974 else if (!strncasecmp(cmdbuf,"DELF",4)) {
975 cmd_delf(&cmdbuf[5]);
978 else if (!strncasecmp(cmdbuf,"MOVF",4)) {
979 cmd_movf(&cmdbuf[5]);
982 else if (!strncasecmp(cmdbuf,"NETF",4)) {
983 cmd_netf(&cmdbuf[5]);
986 else if (!strncasecmp(cmdbuf,"RWHO",4)) {
990 else if (!strncasecmp(cmdbuf,"OPEN",4)) {
991 cmd_open(&cmdbuf[5]);
994 else if (!strncasecmp(cmdbuf,"CLOS",4)) {
998 else if (!strncasecmp(cmdbuf,"UOPN",4)) {
999 cmd_uopn(&cmdbuf[5]);
1002 else if (!strncasecmp(cmdbuf,"UCLS",4)) {
1003 cmd_ucls(&cmdbuf[5]);
1006 else if (!strncasecmp(cmdbuf,"READ",4)) {
1007 cmd_read(&cmdbuf[5]);
1010 else if (!strncasecmp(cmdbuf,"WRIT",4)) {
1011 cmd_writ(&cmdbuf[5]);
1014 else if (!strncasecmp(cmdbuf,"QUSR",4)) {
1015 cmd_qusr(&cmdbuf[5]);
1018 else if (!strncasecmp(cmdbuf,"ECHO",4)) {
1019 cmd_echo(&cmdbuf[5]);
1022 else if (!strncasecmp(cmdbuf,"OIMG",4)) {
1023 cmd_oimg(&cmdbuf[5]);
1026 else if (!strncasecmp(cmdbuf,"MORE",4)) {
1030 else if (!strncasecmp(cmdbuf,"NETP",4)) {
1031 cmd_netp(&cmdbuf[5]);
1034 else if (!strncasecmp(cmdbuf,"NDOP",4)) {
1035 cmd_ndop(&cmdbuf[5]);
1038 else if (!strncasecmp(cmdbuf,"NUOP",4)) {
1039 cmd_nuop(&cmdbuf[5]);
1042 else if (!strncasecmp(cmdbuf,"LFLR",4)) {
1046 else if (!strncasecmp(cmdbuf,"CFLR",4)) {
1047 cmd_cflr(&cmdbuf[5]);
1050 else if (!strncasecmp(cmdbuf,"KFLR",4)) {
1051 cmd_kflr(&cmdbuf[5]);
1054 else if (!strncasecmp(cmdbuf,"EFLR",4)) {
1055 cmd_eflr(&cmdbuf[5]);
1058 else if (!strncasecmp(cmdbuf,"IDEN",4)) {
1059 cmd_iden(&cmdbuf[5]);
1062 else if (!strncasecmp(cmdbuf,"IPGM",4)) {
1063 cmd_ipgm(&cmdbuf[5]);
1066 else if (!strncasecmp(cmdbuf,"EBIO",4)) {
1070 else if (!strncasecmp(cmdbuf,"RBIO",4)) {
1071 cmd_rbio(&cmdbuf[5]);
1074 else if (!strncasecmp(cmdbuf,"LBIO",4)) {
1078 else if (!strncasecmp(cmdbuf,"STEL",4)) {
1079 cmd_stel(&cmdbuf[5]);
1082 else if (!strncasecmp(cmdbuf,"TERM",4)) {
1083 cmd_term(&cmdbuf[5]);
1086 else if (!strncasecmp(cmdbuf,"DOWN",4)) {
1090 else if (!strncasecmp(cmdbuf,"SCDN",4)) {
1091 cmd_scdn(&cmdbuf[5]);
1094 else if (!strncasecmp(cmdbuf, "NSET", 4)) {
1095 cmd_nset(&cmdbuf[5]);
1098 else if (!strncasecmp(cmdbuf, "UIMG", 4)) {
1099 cmd_uimg(&cmdbuf[5]);
1102 else if (!strncasecmp(cmdbuf, "UCHG", 4)) {
1103 cmd_uchg(&cmdbuf[5]);
1106 else if (!strncasecmp(cmdbuf, "TIME", 4)) {
1110 else if (!strncasecmp(cmdbuf, "HCHG", 4)) {
1111 cmd_hchg(&cmdbuf[5]);
1114 else if (!strncasecmp(cmdbuf, "RCHG", 4)) {
1115 cmd_rchg(&cmdbuf[5]);
1118 else if (!strncasecmp(cmdbuf, "AGUP", 4)) {
1119 cmd_agup(&cmdbuf[5]);
1122 else if (!strncasecmp(cmdbuf, "ASUP", 4)) {
1123 cmd_asup(&cmdbuf[5]);
1126 else if (!strncasecmp(cmdbuf, "GPEX", 4)) {
1127 cmd_gpex(&cmdbuf[5]);
1130 else if (!strncasecmp(cmdbuf, "SPEX", 4)) {
1131 cmd_spex(&cmdbuf[5]);
1134 else if (!strncasecmp(cmdbuf, "CONF", 4)) {
1135 cmd_conf(&cmdbuf[5]);
1138 #ifdef DEBUG_MEMORY_LEAKS
1139 else if (!strncasecmp(cmdbuf, "LEAK", 4)) {
1144 else if (!DLoader_Exec_Cmd(cmdbuf))
1146 cprintf("%d Unrecognized or unsupported command.\n",
1150 } while(strncasecmp(cmdbuf, "QUIT", 4));
1152 cleanup(EXIT_NORMAL);