16 #include <sys/socket.h>
17 #include <netinet/in.h>
18 #include <arpa/inet.h>
21 #include "sysdep_decls.h"
22 #include "citserver.h"
25 #include "housekeeping.h"
30 #include "locate_host.h"
33 #include "dynloader.h"
38 struct CitContext *ContextList = NULL;
39 char *unique_session_numbers;
40 int ScheduledShutdown = 0;
44 * Various things that need to be initialized at startup
46 void master_startup(void) {
47 lprintf(7, "Opening databases\n");
53 lprintf(7, "Checking floor reference counts\n");
56 lprintf(7, "Creating base rooms (if necessary)\n");
57 create_room(BASEROOM, 0, "", 0);
58 create_room(AIDEROOM, 4, "", 0);
59 create_room(config.c_twitroom, 0, "", 0);
63 * Cleanup routine to be called when the server is shutting down.
65 void master_cleanup(void) {
66 struct CleanupFunctionHook *fcn;
68 /* Cancel all running sessions */
69 lprintf(7, "Cancelling running sessions...\n");
71 /* FIX do something here
72 while (ContextList != NULL) {
76 /* Run any cleanup routines registered by loadable modules */
77 for (fcn = CleanupHookTable; fcn != NULL; fcn = fcn->next) {
78 (*fcn->h_function_pointer)();
82 lprintf(7, "Closing databases\n");
85 /* Do system-dependent stuff */
86 sysdep_master_cleanup();
89 lprintf(3, "citserver: exiting.\n");
90 fflush(stdout); fflush(stderr);
96 * Free any per-session data allocated by modules or whatever
98 void deallocate_user_data(struct CitContext *con)
100 struct CtdlSessData *ptr;
102 begin_critical_section(S_SESSION_TABLE);
103 while (con->FirstSessData != NULL) {
104 lprintf(9, "Deallocating user data symbol %ld\n",
105 con->FirstSessData->sym_id);
106 if (con->FirstSessData->sym_data != NULL)
107 phree(con->FirstSessData->sym_data);
108 ptr = con->FirstSessData->next;
109 phree(con->FirstSessData);
110 con->FirstSessData = ptr;
112 end_critical_section(S_SESSION_TABLE);
119 * Terminate a session and remove its context data structure.
121 void RemoveContext (struct CitContext *con)
123 struct CitContext *ptr = NULL;
124 struct CitContext *ToFree = NULL;
126 lprintf(9, "RemoveContext() called\n");
128 lprintf(5, "WARNING: RemoveContext() called with NULL!\n");
132 lprintf(7, "Calling logout(%d)\n", con->cs_pid);
135 rec_log(CL_TERMINATE, con->curr_user);
137 lprintf(3, "citserver[%3d]: ended.\n", con->cs_pid);
139 /* Run any cleanup routines registered by loadable modules */
140 PerformSessionHooks(EVT_STOP);
142 syslog(LOG_NOTICE,"session %d ended", con->cs_pid);
144 /* Deallocate any user-data attached to this session */
145 deallocate_user_data(con);
149 lprintf(7, "Removing context\n");
151 begin_critical_section(S_SESSION_TABLE);
152 if (ContextList == con) {
153 ToFree = ContextList;
154 ContextList = ContextList->next;
157 for (ptr = ContextList; ptr != NULL; ptr = ptr->next) {
158 if (ptr->next == con) {
160 ptr->next = ptr->next->next;
164 end_critical_section(S_SESSION_TABLE);
166 lprintf(7, "Closing socket %d\n", ToFree->client_socket);
167 close(ToFree->client_socket);
169 /* Tell the housekeeping thread to check to see if this is the time
170 * to initiate a scheduled shutdown event.
172 enter_housekeeping_cmd("SCHED_SHUTDOWN");
174 /* Free up the memory used by this context */
177 lprintf(7, "Done with RemoveContext()\n");
183 * Get a dynamic symbol number for per-session user data.
184 * This API call should be made only ONCE per symbol per citserver run.
186 int CtdlGetDynamicSymbol()
188 static unsigned int next_symbol = SYM_MAX;
189 return ++next_symbol;
195 * Return a pointer to some generic per-session user data.
196 * (This function returns NULL if the requested symbol is not allocated.)
198 * NOTE: we use critical sections for allocating and de-allocating these,
199 * but not for locating one.
201 void *CtdlGetUserData(unsigned long requested_sym)
203 struct CtdlSessData *ptr;
205 for (ptr = CC->FirstSessData; ptr != NULL; ptr = ptr->next)
206 if (ptr->sym_id == requested_sym)
207 return(ptr->sym_data);
209 lprintf(2, "ERROR! CtdlGetUserData(%ld) symbol not allocated\n",
216 * Allocate some generic per-session user data.
218 void CtdlAllocUserData(unsigned long requested_sym, size_t num_bytes)
220 struct CtdlSessData *ptr;
222 lprintf(9, "CtdlAllocUserData(%ld) called\n", requested_sym);
224 /* Fail silently if the symbol is already registered. */
225 for (ptr = CC->FirstSessData; ptr != NULL; ptr = ptr->next) {
226 if (ptr->sym_id == requested_sym) {
231 /* Grab us some memory! Dem's good eatin' !! */
232 ptr = mallok(sizeof(struct CtdlSessData));
233 ptr->sym_id = requested_sym;
234 ptr->sym_data = mallok(num_bytes);
236 begin_critical_section(S_SESSION_TABLE);
237 ptr->next = CC->FirstSessData;
238 CC->FirstSessData = ptr;
239 end_critical_section(S_SESSION_TABLE);
241 lprintf(9, "CtdlAllocUserData(%ld) finished\n", requested_sym);
250 * cmd_info() - tell the client about this server
252 void cmd_info(void) {
253 cprintf("%d Server info:\n",LISTING_FOLLOWS);
254 cprintf("%d\n",CC->cs_pid);
255 cprintf("%s\n",config.c_nodename);
256 cprintf("%s\n",config.c_humannode);
257 cprintf("%s\n",config.c_fqdn);
258 cprintf("%s\n",CITADEL);
259 cprintf("%d\n",REV_LEVEL);
260 cprintf("%s\n",config.c_bbs_city);
261 cprintf("%s\n",config.c_sysadm);
262 cprintf("%d\n",SERVER_TYPE);
263 cprintf("%s\n",config.c_moreprompt);
264 cprintf("1\n"); /* 1 = yes, this system supports floors */
265 cprintf("1\n"); /* 1 = we support the extended paging options */
269 void cmd_rchg(char *argbuf)
271 char newroomname[ROOMNAMELEN];
273 extract(newroomname, argbuf, 0);
274 newroomname[ROOMNAMELEN] = 0;
275 if (strlen(newroomname) > 0) {
276 safestrncpy(CC->fake_roomname, newroomname,
277 sizeof(CC->fake_roomname) );
278 CC->fake_roomname[ROOMNAMELEN - 1] = 0;
281 strcpy(CC->fake_roomname, "");
283 cprintf("%d OK\n", OK);
286 void cmd_hchg(char *newhostname)
288 if ((newhostname) && (newhostname[0]))
290 memset(CC->fake_hostname, 0, 25);
291 safestrncpy(CC->fake_hostname, newhostname, sizeof(CC->fake_hostname));
294 strcpy(CC->fake_hostname, "");
295 cprintf("%d OK\n",OK);
298 void cmd_uchg(char *newusername)
300 if (CC->usersupp.axlevel < 6)
302 cprintf("%d You must be an Aide to use UCHG.\n",
303 ERROR+HIGHER_ACCESS_REQUIRED);
306 if ((newusername) && (newusername[0]))
308 CC->cs_flags &= ~CS_STEALTH;
309 memset(CC->fake_username, 0, 32);
310 if (strncasecmp(newusername, CC->curr_user, strlen(CC->curr_user)))
311 safestrncpy(CC->fake_username, newusername, sizeof(CC->fake_username));
315 CC->fake_username[0] = '\0';
316 CC->cs_flags |= CS_STEALTH;
322 * returns an asterisk if there are any express messages waiting,
325 char check_express(void) {
326 if (CC->FirstExpressMessage == NULL) {
340 cprintf("%d %ld\n", OK, tv);
344 * Check whether two hostnames match.
345 * "Realname" should be an actual name of a client that is trying to connect;
346 * "testname" should be the value we are comparing it with. The idea is that we
347 * want to compare with both the abbreviated and fully-qualified versions of
348 * "testname;" some people define "localhost" as "localhost.foo.com," etc.
350 static int hostnames_match(const char *realname, const char *testname) {
354 if (!strcasecmp(realname, testname))
357 #ifdef HAVE_NONREENTRANT_NETDB
358 begin_critical_section(S_NETDB);
361 if ((he = gethostbyname(testname)) != NULL)
362 if (!strcasecmp(realname, he->h_name))
365 #ifdef HAVE_NONREENTRANT_NETDB
366 end_critical_section(S_NETDB);
373 * check a hostname against the public_clients file
375 int is_public_client(char *where)
380 if (hostnames_match(where,"localhost")) return(1);
381 if (hostnames_match(where,config.c_fqdn)) return(1);
383 fp = fopen("public_clients","r");
384 if (fp == NULL) return(0);
386 while (fgets(buf,256,fp)!=NULL) {
387 while (isspace((buf[strlen(buf)-1])))
388 buf[strlen(buf)-1] = 0;
389 if (hostnames_match(where,buf)) {
401 * the client is identifying itself to the server
403 void cmd_iden(char *argbuf)
412 if (num_parms(argbuf)<4) {
413 cprintf("%d usage error\n",ERROR);
417 dev_code = extract_int(argbuf,0);
418 cli_code = extract_int(argbuf,1);
419 rev_level = extract_int(argbuf,2);
420 extract(desc,argbuf,3);
422 safestrncpy(from_host, config.c_fqdn, sizeof from_host);
423 from_host[sizeof from_host - 1] = 0;
424 if (num_parms(argbuf)>=5) extract(from_host,argbuf,4);
426 CC->cs_clientdev = dev_code;
427 CC->cs_clienttyp = cli_code;
428 CC->cs_clientver = rev_level;
429 safestrncpy(CC->cs_clientname, desc, sizeof CC->cs_clientname);
430 CC->cs_clientname[31] = 0;
432 lprintf(9, "Looking up hostname\n");
433 if ((strlen(from_host)>0) &&
434 (is_public_client(CC->cs_host))) {
435 if (inet_aton(from_host, &addr))
436 locate_host(CC->cs_host, &addr);
438 safestrncpy(CC->cs_host, from_host, sizeof CC->cs_host);
443 syslog(LOG_NOTICE,"client %d/%d/%01d.%02d (%s)\n",
449 cprintf("%d Ok\n",OK);
454 * enter or exit "stealth mode"
456 void cmd_stel(char *cmdbuf)
460 requested_mode = extract_int(cmdbuf,0);
461 if (requested_mode !=0) requested_mode = 1;
463 if (!CC->logged_in) {
464 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
468 if (CC->usersupp.axlevel < 6) {
469 cprintf("%d You must be an Aide to use stealth mode.\n",
470 ERROR+HIGHER_ACCESS_REQUIRED);
474 if (CC->cs_flags & CS_STEALTH) {
475 if (requested_mode == 0)
476 CC->cs_flags = CC->cs_flags-CS_STEALTH;
479 if (requested_mode == 1)
480 CC->cs_flags = CC->cs_flags|CS_STEALTH;
483 cprintf("%d Ok\n",OK);
490 * display system messages or help
492 void cmd_mesg(char *mname)
499 extract(buf,mname,0);
504 strcpy(dirs[0],"messages");
505 strcpy(dirs[1],"help");
506 mesg_locate(targ,buf,2,dirs);
511 if (strlen(targ)==0) {
512 cprintf("%d '%s' not found.\n",ERROR,mname);
516 mfp = fopen(targ,"r");
518 cprintf("%d Cannot open '%s': %s\n",
519 ERROR,targ,strerror(errno));
522 cprintf("%d %s\n",LISTING_FOLLOWS,buf);
524 while (fgets(buf,255,mfp)!=NULL) {
525 buf[strlen(buf)-1] = 0;
536 * enter system messages or help
538 void cmd_emsg(char *mname)
546 if (CC->usersupp.axlevel < 6) {
547 cprintf("%d You must be an Aide to edit system messages.\n",
548 ERROR+HIGHER_ACCESS_REQUIRED);
552 extract(buf,mname,0);
553 for (a=0; a<strlen(buf); ++a) { /* security measure */
554 if (buf[a] == '/') buf[a] = '.';
559 strcpy(dirs[0],"messages");
560 strcpy(dirs[1],"help");
561 mesg_locate(targ,buf,2,dirs);
565 if (strlen(targ)==0) {
566 snprintf(targ, sizeof targ, "./help/%s", buf);
569 mfp = fopen(targ,"w");
571 cprintf("%d Cannot open '%s': %s\n",
572 ERROR,targ,strerror(errno));
575 cprintf("%d %s\n", SEND_LISTING, targ);
577 while (client_gets(buf), strcmp(buf, "000")) {
578 fprintf(mfp, "%s\n", buf);
585 /* Don't show the names of private rooms unless the viewing
586 * user also knows the rooms.
588 void GenerateRoomDisplay(char *real_room,
589 struct CitContext *viewed,
590 struct CitContext *viewer) {
592 strcpy(real_room, viewed->quickroom.QRname);
593 if (viewed->quickroom.QRflags & QR_MAILBOX) {
594 strcpy(real_room, &real_room[11]);
596 if (viewed->quickroom.QRflags & QR_PRIVATE) {
597 if ( (CtdlRoomAccess(&viewed->quickroom, &viewer->usersupp)
599 strcpy(real_room, "<private room>");
603 if (viewed->cs_flags & CS_CHAT) {
604 while (strlen(real_room) < 14)
605 strcat(real_room, " ");
607 strcpy(&real_room[14], "<chat>");
616 void cmd_rwho(void) {
617 struct CitContext *cptr;
621 char real_room[ROOMNAMELEN], room[ROOMNAMELEN];
622 char host[40], flags[5];
624 aide = CC->usersupp.axlevel >= 6;
625 cprintf("%d%c \n", LISTING_FOLLOWS, check_express() );
627 for (cptr = ContextList; cptr != NULL; cptr = cptr->next)
632 if (cptr->cs_flags & CS_POSTING)
637 if (cptr->fake_username[0])
639 strcpy(un, cptr->fake_username);
643 strcpy(un, cptr->curr_user);
645 if (cptr->fake_hostname[0])
647 strcpy(host, cptr->fake_hostname);
651 strcpy(host, cptr->cs_host);
653 GenerateRoomDisplay(real_room, cptr, CC);
655 if (cptr->fake_roomname[0]) {
656 strcpy(room, cptr->fake_roomname);
660 strcpy(room, real_room);
663 if ((aide) && (spoofed))
666 if ((cptr->cs_flags & CS_STEALTH) && (aide))
669 if (((cptr->cs_flags&CS_STEALTH)==0) || (aide))
671 cprintf("%d|%s|%s|%s|%s|%ld|%s|%s\n",
672 cptr->cs_pid, un, room,
673 host, cptr->cs_clientname,
674 (long)(cptr->lastidle),
675 cptr->lastcmdname, flags);
677 if ((spoofed) && (aide))
679 cprintf("%d|%s|%s|%s|%s|%ld|%s|%s\n",
680 cptr->cs_pid, cptr->curr_user,
682 cptr->cs_host, cptr->cs_clientname,
683 (long)(cptr->lastidle),
684 cptr->lastcmdname, flags);
689 /* Now it's magic time. Before we finish, call any EVT_RWHO hooks
690 * so that external paging modules such as serv_icq can add more
691 * content to the Wholist.
693 PerformSessionHooks(EVT_RWHO);
699 * Terminate another running session
701 void cmd_term(char *cmdbuf)
704 struct CitContext *ccptr;
707 if (!CC->logged_in) {
708 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
712 if (CC->usersupp.axlevel < 6) {
713 cprintf("%d You must be an Aide to terminate sessions.\n",
714 ERROR+HIGHER_ACCESS_REQUIRED);
718 session_num = extract_int(cmdbuf, 0);
719 if (session_num == CC->cs_pid) {
720 cprintf("%d You can't kill your own session.\n", ERROR);
724 lprintf(9, "Locating session to kill\n");
725 begin_critical_section(S_SESSION_TABLE);
726 for (ccptr = ContextList; ccptr != NULL; ccptr = ccptr->next) {
727 if (session_num == ccptr->cs_pid) {
732 end_critical_section(S_SESSION_TABLE);
735 cprintf("%d Session terminated.\n", OK);
738 cprintf("%d No such session.\n", ERROR);
747 * get the paginator prompt
749 void cmd_more(void) {
750 cprintf("%d %s\n",OK,config.c_moreprompt);
756 void cmd_echo(char *etext)
758 cprintf("%d %s\n",OK,etext);
764 * identify as internal program
766 void cmd_ipgm(char *argbuf)
770 secret = extract_int(argbuf, 0);
771 if (secret == config.c_ipgm_secret) {
772 CC->internal_pgm = 1;
773 strcpy(CC->curr_user, "<internal program>");
774 CC->cs_flags = CC->cs_flags|CS_STEALTH;
775 cprintf("%d Authenticated as an internal program.\n",OK);
778 cprintf("%d Authentication failed.\n",ERROR);
779 lprintf(3, "Warning: ipgm authentication failed.\n");
785 * Shut down the server
787 void cmd_down(void) {
788 if (!CC->logged_in) {
789 cprintf("%d Not logged in.\n", ERROR+NOT_LOGGED_IN);
793 if (CC->usersupp.axlevel < 6) {
794 cprintf("%d You must be an Aide to shut down the server.\n",
795 ERROR+HIGHER_ACCESS_REQUIRED);
799 cprintf("%d Shutting down server. Goodbye.\n", OK);
804 * Schedule or cancel a server shutdown
806 void cmd_scdn(char *argbuf)
810 if (!CC->logged_in) {
811 cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
815 if (CC->usersupp.axlevel < 6) {
816 cprintf("%d You must be an Aide to schedule a shutdown.\n",
817 ERROR+HIGHER_ACCESS_REQUIRED);
821 new_state = extract_int(argbuf, 0);
822 if ((new_state == 0) || (new_state == 1)) {
823 ScheduledShutdown = new_state;
825 cprintf("%d %d\n", OK, ScheduledShutdown);
832 void begin_session(struct CitContext *con)
834 int num_sessions, len;
835 struct sockaddr_in sin;
838 * Initialize some variables specific to our context.
841 con->internal_pgm = 0;
842 con->download_fp = NULL;
843 con->upload_fp = NULL;
844 con->FirstExpressMessage = NULL;
846 time(&con->lastidle);
847 strcpy(con->lastcmdname, " ");
848 strcpy(con->cs_clientname, "(unknown)");
849 strcpy(con->curr_user,"(not logged in)");
850 strcpy(con->net_node,"");
851 snprintf(con->temp, sizeof con->temp, tmpnam(NULL));
852 safestrncpy(con->cs_host, config.c_fqdn, sizeof con->cs_host);
853 con->cs_host[sizeof con->cs_host - 1] = 0;
855 if (!getpeername(con->client_socket, (struct sockaddr *) &sin, &len))
856 locate_host(con->cs_host, &sin.sin_addr);
858 con->upload_type = UPL_FILE;
860 con->FirstSessData = NULL;
862 num_sessions = session_count();
864 if ((config.c_maxsessions > 0)&&(num_sessions > config.c_maxsessions))
867 if (con->nologin==1) {
868 cprintf("%d %s: Too many users are already online "
870 ERROR+MAX_SESSIONS_EXCEEDED,
871 config.c_nodename, config.c_maxsessions);
874 cprintf("%d %s Citadel/UX server ready.\n",
875 OK, config.c_nodename);
878 lprintf(3, "citserver[%3d]: started.\n", con->cs_pid);
880 /* Run any session startup routines registered by loadable modules */
881 PerformSessionHooks(EVT_START);
883 rec_log(CL_CONNECT, "");
890 * This loop recognizes all server commands.
892 void do_command_loop(void) {
896 memset(cmdbuf, 0, sizeof cmdbuf); /* Clear it, just in case */
897 if (client_gets(cmdbuf) < 1) {
898 lprintf(3, "Client socket is broken. Ending session.\n");
902 lprintf(5, "citserver[%3d]: %s\n", CC->cs_pid, cmdbuf);
905 * Let other clients see the last command we executed, and
906 * update the idle time, but not NOOP, PEXP, or GEXP.
908 if ( (strncasecmp(cmdbuf, "NOOP", 4))
909 && (strncasecmp(cmdbuf, "PEXP", 4))
910 && (strncasecmp(cmdbuf, "GEXP", 4)) ) {
911 strcpy(CC->lastcmdname, " ");
912 safestrncpy(CC->lastcmdname, cmdbuf,
913 sizeof(CC->lastcmdname) );
917 if ((strncasecmp(cmdbuf, "ENT0", 4))
918 && (strncasecmp(cmdbuf, "MESG", 4))
919 && (strncasecmp(cmdbuf, "MSGS", 4)))
921 CC->cs_flags &= ~CS_POSTING;
924 if (!strncasecmp(cmdbuf,"NOOP",4)) {
925 cprintf("%d%cok\n",OK,check_express());
928 else if (!strncasecmp(cmdbuf,"QUIT",4)) {
929 cprintf("%d Goodbye.\n",OK);
933 else if (!strncasecmp(cmdbuf,"LOUT",4)) {
934 if (CC->logged_in) logout(CC);
935 cprintf("%d logged out.\n",OK);
938 else if (!strncasecmp(cmdbuf,"USER",4)) {
939 cmd_user(&cmdbuf[5]);
942 else if (!strncasecmp(cmdbuf,"PASS",4)) {
943 cmd_pass(&cmdbuf[5]);
946 else if (!strncasecmp(cmdbuf,"NEWU",4)) {
947 cmd_newu(&cmdbuf[5]);
950 else if (!strncasecmp(cmdbuf,"SETP",4)) {
951 cmd_setp(&cmdbuf[5]);
954 else if (!strncasecmp(cmdbuf,"LRMS",4)) {
955 cmd_lrms(&cmdbuf[5]);
958 else if (!strncasecmp(cmdbuf,"LKRA",4)) {
959 cmd_lkra(&cmdbuf[5]);
962 else if (!strncasecmp(cmdbuf,"LKRN",4)) {
963 cmd_lkrn(&cmdbuf[5]);
966 else if (!strncasecmp(cmdbuf,"LKRO",4)) {
967 cmd_lkro(&cmdbuf[5]);
970 else if (!strncasecmp(cmdbuf,"LZRM",4)) {
971 cmd_lzrm(&cmdbuf[5]);
974 else if (!strncasecmp(cmdbuf,"GETU",4)) {
978 else if (!strncasecmp(cmdbuf,"SETU",4)) {
979 cmd_setu(&cmdbuf[5]);
982 else if (!strncasecmp(cmdbuf,"GOTO",4)) {
983 cmd_goto(&cmdbuf[5]);
986 else if (!strncasecmp(cmdbuf,"MSGS",4)) {
987 cmd_msgs(&cmdbuf[5]);
990 else if (!strncasecmp(cmdbuf,"WHOK",4)) {
994 else if (!strncasecmp(cmdbuf,"RDIR",4)) {
998 else if (!strncasecmp(cmdbuf,"MSG0",4)) {
999 cmd_msg0(&cmdbuf[5]);
1002 else if (!strncasecmp(cmdbuf,"MSG2",4)) {
1003 cmd_msg2(&cmdbuf[5]);
1006 else if (!strncasecmp(cmdbuf,"MSG3",4)) {
1007 cmd_msg3(&cmdbuf[5]);
1010 else if (!strncasecmp(cmdbuf,"MSG4",4)) {
1011 cmd_msg4(&cmdbuf[5]);
1014 else if (!strncasecmp(cmdbuf,"OPNA",4)) {
1015 cmd_opna(&cmdbuf[5]);
1018 else if (!strncasecmp(cmdbuf,"INFO",4)) {
1022 else if (!strncasecmp(cmdbuf,"SLRP",4)) {
1023 cmd_slrp(&cmdbuf[5]);
1026 else if (!strncasecmp(cmdbuf,"INVT",4)) {
1027 cmd_invt_kick(&cmdbuf[5],1);
1030 else if (!strncasecmp(cmdbuf,"KICK",4)) {
1031 cmd_invt_kick(&cmdbuf[5],0);
1034 else if (!strncasecmp(cmdbuf,"GETR",4)) {
1038 else if (!strncasecmp(cmdbuf,"SETR",4)) {
1039 cmd_setr(&cmdbuf[5]);
1042 else if (!strncasecmp(cmdbuf,"GETA",4)) {
1046 else if (!strncasecmp(cmdbuf,"SETA",4)) {
1047 cmd_seta(&cmdbuf[5]);
1050 else if (!strncasecmp(cmdbuf,"ENT0",4)) {
1051 cmd_ent0(&cmdbuf[5]);
1054 else if (!strncasecmp(cmdbuf,"ENT3",4)) {
1055 cmd_ent3(&cmdbuf[5]);
1058 else if (!strncasecmp(cmdbuf,"RINF",4)) {
1062 else if (!strncasecmp(cmdbuf,"DELE",4)) {
1063 cmd_dele(&cmdbuf[5]);
1066 else if (!strncasecmp(cmdbuf,"KILL",4)) {
1067 cmd_kill(&cmdbuf[5]);
1070 else if (!strncasecmp(cmdbuf,"CRE8",4)) {
1071 cmd_cre8(&cmdbuf[5]);
1074 else if (!strncasecmp(cmdbuf,"MOVE",4)) {
1075 cmd_move(&cmdbuf[5]);
1078 else if (!strncasecmp(cmdbuf,"FORG",4)) {
1082 else if (!strncasecmp(cmdbuf,"MESG",4)) {
1083 cmd_mesg(&cmdbuf[5]);
1086 else if (!strncasecmp(cmdbuf,"EMSG",4)) {
1087 cmd_emsg(&cmdbuf[5]);
1090 else if (!strncasecmp(cmdbuf,"GNUR",4)) {
1094 else if (!strncasecmp(cmdbuf,"VALI",4)) {
1095 cmd_vali(&cmdbuf[5]);
1098 else if (!strncasecmp(cmdbuf,"EINF",4)) {
1099 cmd_einf(&cmdbuf[5]);
1102 else if (!strncasecmp(cmdbuf,"LIST",4)) {
1106 else if (!strncasecmp(cmdbuf,"CHEK",4)) {
1110 else if (!strncasecmp(cmdbuf,"DELF",4)) {
1111 cmd_delf(&cmdbuf[5]);
1114 else if (!strncasecmp(cmdbuf,"MOVF",4)) {
1115 cmd_movf(&cmdbuf[5]);
1118 else if (!strncasecmp(cmdbuf,"NETF",4)) {
1119 cmd_netf(&cmdbuf[5]);
1122 else if (!strncasecmp(cmdbuf,"RWHO",4)) {
1126 else if (!strncasecmp(cmdbuf,"OPEN",4)) {
1127 cmd_open(&cmdbuf[5]);
1130 else if (!strncasecmp(cmdbuf,"CLOS",4)) {
1134 else if (!strncasecmp(cmdbuf,"UOPN",4)) {
1135 cmd_uopn(&cmdbuf[5]);
1138 else if (!strncasecmp(cmdbuf,"UCLS",4)) {
1139 cmd_ucls(&cmdbuf[5]);
1142 else if (!strncasecmp(cmdbuf,"READ",4)) {
1143 cmd_read(&cmdbuf[5]);
1146 else if (!strncasecmp(cmdbuf,"WRIT",4)) {
1147 cmd_writ(&cmdbuf[5]);
1150 else if (!strncasecmp(cmdbuf,"QUSR",4)) {
1151 cmd_qusr(&cmdbuf[5]);
1154 else if (!strncasecmp(cmdbuf,"ECHO",4)) {
1155 cmd_echo(&cmdbuf[5]);
1158 else if (!strncasecmp(cmdbuf,"OIMG",4)) {
1159 cmd_oimg(&cmdbuf[5]);
1162 else if (!strncasecmp(cmdbuf,"MORE",4)) {
1166 else if (!strncasecmp(cmdbuf,"NETP",4)) {
1167 cmd_netp(&cmdbuf[5]);
1170 else if (!strncasecmp(cmdbuf,"NDOP",4)) {
1171 cmd_ndop(&cmdbuf[5]);
1174 else if (!strncasecmp(cmdbuf,"NUOP",4)) {
1175 cmd_nuop(&cmdbuf[5]);
1178 else if (!strncasecmp(cmdbuf,"LFLR",4)) {
1182 else if (!strncasecmp(cmdbuf,"CFLR",4)) {
1183 cmd_cflr(&cmdbuf[5]);
1186 else if (!strncasecmp(cmdbuf,"KFLR",4)) {
1187 cmd_kflr(&cmdbuf[5]);
1190 else if (!strncasecmp(cmdbuf,"EFLR",4)) {
1191 cmd_eflr(&cmdbuf[5]);
1194 else if (!strncasecmp(cmdbuf,"IDEN",4)) {
1195 cmd_iden(&cmdbuf[5]);
1198 else if (!strncasecmp(cmdbuf,"IPGM",4)) {
1199 cmd_ipgm(&cmdbuf[5]);
1202 else if (!strncasecmp(cmdbuf,"EBIO",4)) {
1206 else if (!strncasecmp(cmdbuf,"RBIO",4)) {
1207 cmd_rbio(&cmdbuf[5]);
1210 else if (!strncasecmp(cmdbuf,"LBIO",4)) {
1214 else if (!strncasecmp(cmdbuf,"STEL",4)) {
1215 cmd_stel(&cmdbuf[5]);
1218 else if (!strncasecmp(cmdbuf,"TERM",4)) {
1219 cmd_term(&cmdbuf[5]);
1222 else if (!strncasecmp(cmdbuf,"DOWN",4)) {
1226 else if (!strncasecmp(cmdbuf,"SCDN",4)) {
1227 cmd_scdn(&cmdbuf[5]);
1230 else if (!strncasecmp(cmdbuf, "NSET", 4)) {
1231 cmd_nset(&cmdbuf[5]);
1234 else if (!strncasecmp(cmdbuf, "UIMG", 4)) {
1235 cmd_uimg(&cmdbuf[5]);
1238 else if (!strncasecmp(cmdbuf, "UCHG", 4)) {
1239 cmd_uchg(&cmdbuf[5]);
1242 else if (!strncasecmp(cmdbuf, "TIME", 4)) {
1246 else if (!strncasecmp(cmdbuf, "HCHG", 4)) {
1247 cmd_hchg(&cmdbuf[5]);
1250 else if (!strncasecmp(cmdbuf, "RCHG", 4)) {
1251 cmd_rchg(&cmdbuf[5]);
1254 else if (!strncasecmp(cmdbuf, "AGUP", 4)) {
1255 cmd_agup(&cmdbuf[5]);
1258 else if (!strncasecmp(cmdbuf, "ASUP", 4)) {
1259 cmd_asup(&cmdbuf[5]);
1262 else if (!strncasecmp(cmdbuf, "GPEX", 4)) {
1263 cmd_gpex(&cmdbuf[5]);
1266 else if (!strncasecmp(cmdbuf, "SPEX", 4)) {
1267 cmd_spex(&cmdbuf[5]);
1270 else if (!strncasecmp(cmdbuf, "CONF", 4)) {
1271 cmd_conf(&cmdbuf[5]);
1274 #ifdef DEBUG_MEMORY_LEAKS
1275 else if (!strncasecmp(cmdbuf, "LEAK", 4)) {
1280 else if (!DLoader_Exec_Cmd(cmdbuf))
1282 cprintf("%d Unrecognized or unsupported command.\n",
1286 /* Run any after-each-command outines registered by modules */
1287 PerformSessionHooks(EVT_CMD);