-# Makefile for SMS clients blanche
+# Makefile for Moira clients blanche
#
# MIT Project Athena
#
CFLAGS = -I../../include ${DEFINES}
BINDIR = ${DESTDIR}/bin
-SMSLIB = -L../../lib -lsms -lgdb -lcom_err -lkrb -ldes -lhesiod
+MOIRALIB = -L../../lib -lmoira -lgdb -lcom_err -lkrb -ldes -lhesiod
PROGS= blanche
blanche: blanche.o
rm -f blanche
- cc -o blanche blanche.o ${SMSLIB}
+ cc -o blanche blanche.o ${MOIRALIB}
lint:
lint *.c
# DO NOT DELETE THIS LINE -- mkdep uses it.
blanche.o: blanche.c ../../include/mit-copyright.h /usr/include/stdio.h
-blanche.o: /usr/include/ctype.h ../../include/sms.h /usr/include/sms_et.h
-blanche.o: ../../include/sms_app.h
+blanche.o: /usr/include/ctype.h ../../include/moira.h ../../include/mr_et.h
+blanche.o: ../../include/moira_site.h
#include <mit-copyright.h>
#include <stdio.h>
#include <ctype.h>
-#include <sms.h>
-#include <sms_app.h>
+#include <moira.h>
+#include <moira_site.h>
#ifndef LINT
static char blanche_rcsid[] = "$Header$";
showusers = showstrings = showlists = showkerberos = 1;
/* fire up Moira */
- if (status = sms_connect(server)) {
+ if (status = mr_connect(server)) {
com_err(whoami, status, "unable to connect to the Moira server");
exit(2);
}
- if ( status = sms_motd(&motd) ) {
+ if ( status = mr_motd(&motd) ) {
com_err(whoami, status, "unable to check server status");
exit(2);
}
if (motd) {
fprintf(stderr, "The Moira server is currently unavailable:\n%s\n", motd);
- sms_disconnect();
+ mr_disconnect();
exit(2);
}
- if (!noauth && (status = sms_auth("blanche"))) {
+ if (!noauth && (status = mr_auth("blanche"))) {
com_err(whoami, status, "unable to authenticate to Moira");
com_err(whoami, 0,
" Try the -noauth flag if you don't need authentication");
/* display list info if requested to */
if (infoflg) {
- status = sms_query("get_list_info", 1, &listname, show_list_info,NULL);
+ status = mr_query("get_list_info", 1, &listname, show_list_info,NULL);
if (status)
com_err(whoami, status, "while getting list information");
if (verbose && !memberflg) {
- status = sms_query("count_members_of_list", 1, &listname,
+ status = mr_query("count_members_of_list", 1, &listname,
show_list_count, NULL);
if (status)
com_err(whoami, status, "while getting list count");
* lastly, reset memberlist so we can use it again later
*/
if (syncflg) {
- status = sms_query("get_members_of_list", 1, &listname,
+ status = mr_query("get_members_of_list", 1, &listname,
get_list_members, (char *)memberlist);
if (status)
com_err(whoami, status, "getting members of list %s", listname);
case M_ANY:
case M_USER:
membervec[1] = "USER";
- status = sms_query("add_member_to_list", 3, membervec, scream, NULL);
- if (status == SMS_SUCCESS)
+ status = mr_query("add_member_to_list", 3, membervec, scream, NULL);
+ if (status == MR_SUCCESS)
break;
- else if (status != SMS_USER || memberstruct->type != M_ANY) {
+ else if (status != MR_USER || memberstruct->type != M_ANY) {
com_err(whoami, status, "while adding member %s to %s",
memberstruct->name, listname);
break;
}
case M_LIST:
membervec[1] = "LIST";
- status = sms_query("add_member_to_list", 3, membervec,
+ status = mr_query("add_member_to_list", 3, membervec,
scream, NULL);
- if (status == SMS_SUCCESS)
+ if (status == MR_SUCCESS)
break;
- else if (status != SMS_LIST || memberstruct->type != M_ANY) {
+ else if (status != MR_LIST || memberstruct->type != M_ANY) {
com_err(whoami, status, "while adding member %s to %s",
memberstruct->name, listname);
break;
}
case M_STRING:
membervec[1] = "STRING";
- status = sms_query("add_member_to_list", 3, membervec,
+ status = mr_query("add_member_to_list", 3, membervec,
scream, NULL);
- if (status != SMS_SUCCESS)
+ if (status != MR_SUCCESS)
com_err(whoami, status, "while adding member %s to %s",
memberstruct->name, listname);
break;
case M_KERBEROS:
membervec[1] = "KERBEROS";
- status = sms_query("add_member_to_list", 3, membervec,
+ status = mr_query("add_member_to_list", 3, membervec,
scream, NULL);
- if (status != SMS_SUCCESS)
+ if (status != MR_SUCCESS)
com_err(whoami, status, "while adding member %s to %s",
memberstruct->name, listname);
}
case M_ANY:
case M_USER:
membervec[1] = "USER";
- status = sms_query("delete_member_from_list", 3, membervec,
+ status = mr_query("delete_member_from_list", 3, membervec,
scream, NULL);
- if (status == SMS_SUCCESS)
+ if (status == MR_SUCCESS)
break;
- else if ((status != SMS_USER && status != SMS_NO_MATCH) ||
+ else if ((status != MR_USER && status != MR_NO_MATCH) ||
memberstruct->type != M_ANY) {
com_err(whoami, status, "while deleting member %s from %s",
memberstruct->name, listname);
}
case M_LIST:
membervec[1] = "LIST";
- status = sms_query("delete_member_from_list", 3, membervec,
+ status = mr_query("delete_member_from_list", 3, membervec,
scream, NULL);
- if (status == SMS_SUCCESS)
+ if (status == MR_SUCCESS)
break;
- else if ((status != SMS_LIST && status != SMS_NO_MATCH) ||
+ else if ((status != MR_LIST && status != MR_NO_MATCH) ||
memberstruct->type != M_ANY) {
com_err(whoami, status, "while deleting member %s from %s",
memberstruct->name, listname);
}
case M_STRING:
membervec[1] = "STRING";
- status = sms_query("delete_member_from_list", 3, membervec,
+ status = mr_query("delete_member_from_list", 3, membervec,
scream, NULL);
- if (status == SMS_STRING && memberstruct->type == M_ANY)
+ if (status == MR_STRING && memberstruct->type == M_ANY)
com_err(whoami, 0, " Unable to find member %s to delete from %s",
memberstruct->name, listname);
- else if (status != SMS_SUCCESS)
+ else if (status != MR_SUCCESS)
com_err(whoami, status, "while deleting member %s from %s",
memberstruct->name, listname);
break;
case M_KERBEROS:
membervec[1] = "KERBEROS";
- status = sms_query("delete_member_from_list", 3, membervec,
+ status = mr_query("delete_member_from_list", 3, membervec,
scream, NULL);
- if (status != SMS_SUCCESS)
+ if (status != MR_SUCCESS)
com_err(whoami, status, "while deleting member %s from %s",
memberstruct->name, listname);
}
if (recursflg)
recursive_display_list_members();
else {
- status = sms_query("get_members_of_list", 1, &listname,
+ status = mr_query("get_members_of_list", 1, &listname,
get_list_members, (char *)memberlist);
if (status)
com_err(whoami, status, "while getting members of list %s",
}
/* We're done! */
- sms_disconnect();
+ mr_disconnect();
exit(0);
}
printf("\n");
printf("Owner: %s %s\n", argv[7], argv[8]);
printf("Last modified by %s with %s on %s\n", argv[11], argv[12], argv[10]);
- return(SMS_CONT);
+ return(MR_CONT);
}
memberlist = sq_create();
if (debugflg)
fprintf(stderr, "Fetching members of %s\n", m->name);
- status = sms_query("get_members_of_list", 1, &(m->name),
+ status = mr_query("get_members_of_list", 1, &(m->name),
get_list_members, (char *)memberlist);
if (status)
com_err(whoami, status, "while getting members of list %s", m->name);
}
m->name = strsave(argv[1]);
sq_save_data(q, m);
- return(SMS_CONT);
+ return(MR_CONT);
}
# For copying and distribution information, please see the file
# <mit-copyright.h>.
-# Makefile for SMS client mailmaint
+# Makefile for Moira client mailmaint
#
#
DESTDIR=
CONFDIR = ${DESTDIR}/usr/athena
BINDIR = ${DESTDIR}/bin
-SMSLIB = -L../../lib -lsms -lgdb -lcom_err
+MOIRALIB = -L../../lib -lmoira -lgdb -lcom_err
SRCS = mailmaint.c
all: mailmaint
mailmaint: ${OBJECTS}
- cc ${CFLAGS} -o mailmaint ${OBJECTS} ${SMSLIB} \
+ cc ${CFLAGS} -o mailmaint ${OBJECTS} ${MOIRALIB} \
-lcurses -ltermcap -lkrb -ldes -lhesiod
mailmaint.o: mailmaint.c
mailmaint.o: /usr/include/sys/ioctl.h /usr/include/sys/ttychars.h
mailmaint.o: /usr/include/sys/ttydev.h /usr/include/sys/types.h
mailmaint.o: /usr/include/varargs.h ../../include/com_err.h
-mailmaint.o: /usr/include/ctype.h ../../include/sms.h /usr/include/sms_et.h
-mailmaint.o: ../../include/sms_app.h ../../include/mit-copyright.h
+mailmaint.o: /usr/include/ctype.h ../../include/moira.h ../../include/mr_et.h
+mailmaint.o: ../../include/moira_site.h ../../include/mit-copyright.h
#include <varargs.h>
#include <com_err.h>
#include <ctype.h>
-#include <sms.h>
-#include <sms_app.h>
+#include <moira.h>
+#include <moira_site.h>
#include <mit-copyright.h>
printf("Connecting to database for %s...please hold on.\n", uname);
- status = sms_connect(NULL);
+ status = mr_connect(NULL);
if (status) {
(void) sprintf(buf, "\nConnection to Moira server failed");
goto punt;
}
- status = sms_motd(&motd);
+ status = mr_motd(&motd);
if (status) {
com_err(whoami, status, " unable to check server status");
- sms_disconnect();
+ mr_disconnect();
exit(2);
}
if (motd) {
fprintf(stderr, "The Moira server is currently unavailable:\n%s\n", motd);
- sms_disconnect();
+ mr_disconnect();
exit(2);
}
- status = sms_auth("mailmaint");
+ status = mr_auth("mailmaint");
if (status) {
(void) sprintf(buf, "\nAuthorization failed.\n");
goto punt;
argv[0] = strsave(buf);
argv[1] = strsave("user");
argv[2] = strsave(uname);
- if (status = sms_query("add_member_to_list", 3, argv,
+ if (status = mr_query("add_member_to_list", 3, argv,
scream, (char *) NULL)) {
display_buff("\r\n");
com_err(whoami, status, " found.\n");
argv[0] = strsave(buf);
argv[1] = strsave("user");
argv[2] = strsave(uname);
- if (status = sms_query("delete_member_from_list", 3, argv,
+ if (status = mr_query("delete_member_from_list", 3, argv,
scream, (char *) NULL)) {
display_buff("\r\n");
com_err(whoami, status, " found.\n");
show_text(DISPROW, STARTCOL, buf);
mvcur(0, 0, currow, STARTCOL);
refresh();
- if (status = sms_query("get_lists_of_member", 2, nargv + 1,
+ if (status = mr_query("get_lists_of_member", 2, nargv + 1,
print_1, (char *) NULL)) {
display_buff("\r\n");
com_err(whoami, status, " in get_lists_of_member");
argv[1] = argv[4] = "dontcare";
argv[2] = "false";
first_time = 1;
- if (status = sms_query("qualified_get_lists", 5, argv,
+ if (status = mr_query("qualified_get_lists", 5, argv,
print_all, (char *) NULL)) {
display_buff("\r\n");
com_err(whoami, status, " in list_all_groups\n");
(void) sprintf(buffer, "The members of list '%s' are:", buf);
show_text(DISPROW + 1, STARTCOL, buffer);
argv[0] = buf;
- if (status = sms_query("get_members_of_list", 1, argv,
+ if (status = mr_query("get_members_of_list", 1, argv,
print_2, (char *) NULL)) {
display_buff("\r\n");
com_err(whoami, status, " found.\n");
{
com_err(whoami, status, "\nA Moira update returned a value -- programmer \
botch\n");
- sms_disconnect();
+ mr_disconnect();
exit(1);
return(0); /* to keep compiler happy */
}
char *argv[1];
argv[0] = list;
- return sms_query("get_list_info", 1, argv, get_list_info, (char *) NULL);
+ return mr_query("get_list_info", 1, argv, get_list_info, (char *) NULL);
}
/* ARGSUSED */
-# This is the Makefile for allmaint, the SMS client that allows
-# a user to maintaint most important parts of the SMS database.
+# This is the Makefile for allmaint, the Moira client that allows
+# a user to maintaint most important parts of the Moira database.
# It Contains: The Makefile
#
# Created: 5/9/88
CONFDIR = ${DESTDIR}/usr/athena
BINDIR = ${DESTDIR}/bin
-SMSLIB = -lsms -lgdb -lcom_err
-LIBS = ${SMSLIB} -lcurses -ltermcap -lkrb -ldes -lhesiod
+MOIRALIB = -lmoira -lgdb -lcom_err
+LIBS = ${MOIRALIB} -lcurses -ltermcap -lkrb -ldes -lhesiod
SRCS = utils.c attach.c cluster.c delete.c globals.c lists.c main.c \
# correct libraries when using saber C.
saber: ;
- /mit/kaufer/saber -I/mit/smsdev/include -DDEBUG ${LDFLAGS} \
+ /mit/kaufer/saber -I/mit/moiradev/include -DDEBUG ${LDFLAGS} \
${SRCS} ${LIBS}
depend:
# DO NOT DELETE THIS LINE -- mkdep uses it.
utils.o: utils.c /usr/include/stdio.h /usr/include/strings.h
-utils.o: ../../include/sms.h /usr/include/sms_et.h ../../include/sms_app.h
-utils.o: ../../include/mit-copyright.h menu.h /usr/include/ctype.h defs.h
-utils.o: f_defs.h globals.h /usr/include/netdb.h
+utils.o: ../../include/moira.h ../../include/mr_et.h
+utils.o: ../../include/moira_site.h ../../include/mit-copyright.h menu.h
+utils.o: /usr/include/ctype.h defs.h f_defs.h globals.h /usr/include/netdb.h
attach.o: attach.c /usr/include/stdio.h /usr/include/strings.h
-attach.o: ../../include/sms.h /usr/include/sms_et.h ../../include/sms_app.h
-attach.o: ../../include/mit-copyright.h menu.h defs.h f_defs.h globals.h
+attach.o: ../../include/moira.h ../../include/mr_et.h
+attach.o: ../../include/moira_site.h ../../include/mit-copyright.h menu.h
+attach.o: defs.h f_defs.h globals.h
cluster.o: cluster.c /usr/include/stdio.h /usr/include/strings.h
-cluster.o: ../../include/sms.h /usr/include/sms_et.h ../../include/sms_app.h
-cluster.o: ../../include/mit-copyright.h menu.h defs.h f_defs.h globals.h
+cluster.o: ../../include/moira.h ../../include/mr_et.h
+cluster.o: ../../include/moira_site.h ../../include/mit-copyright.h menu.h
+cluster.o: defs.h f_defs.h globals.h
delete.o: delete.c /usr/include/stdio.h /usr/include/strings.h
-delete.o: ../../include/sms.h /usr/include/sms_et.h ../../include/sms_app.h
-delete.o: ../../include/mit-copyright.h menu.h defs.h f_defs.h globals.h
+delete.o: ../../include/moira.h ../../include/mr_et.h
+delete.o: ../../include/moira_site.h ../../include/mit-copyright.h menu.h
+delete.o: defs.h f_defs.h globals.h
globals.o: globals.c ../../include/mit-copyright.h defs.h
lists.o: lists.c /usr/include/stdio.h /usr/include/strings.h
-lists.o: ../../include/sms.h /usr/include/sms_et.h ../../include/sms_app.h
-lists.o: ../../include/mit-copyright.h menu.h defs.h f_defs.h globals.h
+lists.o: ../../include/moira.h ../../include/mr_et.h
+lists.o: ../../include/moira_site.h ../../include/mit-copyright.h menu.h
+lists.o: defs.h f_defs.h globals.h
main.o: main.c /usr/include/pwd.h /usr/include/signal.h /usr/include/stdio.h
-main.o: /usr/include/strings.h /usr/include/sys/types.h ../../include/sms.h
-main.o: /usr/include/sms_et.h menu.h ../../include/mit-copyright.h defs.h
+main.o: /usr/include/strings.h /usr/include/sys/types.h ../../include/moira.h
+main.o: ../../include/mr_et.h menu.h ../../include/mit-copyright.h defs.h
main.o: f_defs.h globals.h
menu.o: menu.c ../../include/mit-copyright.h /usr/include/sys/types.h
menu.o: /usr/include/stdio.h /usr/include/signal.h /usr/include/curses.h
menu.o: ../../include/com_err.h menu.h
menus.o: menus.c /usr/include/stdio.h menu.h ../../include/mit-copyright.h
menus.o: defs.h f_defs.h globals.h
-nfs.o: nfs.c /usr/include/stdio.h /usr/include/strings.h ../../include/sms.h
-nfs.o: /usr/include/sms_et.h ../../include/sms_app.h
+nfs.o: nfs.c /usr/include/stdio.h /usr/include/strings.h
+nfs.o: ../../include/moira.h ../../include/mr_et.h ../../include/moira_site.h
nfs.o: ../../include/mit-copyright.h menu.h defs.h f_defs.h globals.h
pobox.o: pobox.c /usr/include/stdio.h /usr/include/strings.h
-pobox.o: /usr/include/ctype.h ../../include/sms.h /usr/include/sms_et.h
-pobox.o: ../../include/sms_app.h ../../include/mit-copyright.h menu.h defs.h
-pobox.o: f_defs.h globals.h
+pobox.o: /usr/include/ctype.h ../../include/moira.h ../../include/mr_et.h
+pobox.o: ../../include/moira_site.h ../../include/mit-copyright.h menu.h
+pobox.o: defs.h f_defs.h globals.h
quota.o: quota.c /usr/include/stdio.h /usr/include/strings.h
-quota.o: ../../include/sms.h /usr/include/sms_et.h ../../include/sms_app.h
-quota.o: ../../include/mit-copyright.h menu.h defs.h f_defs.h globals.h
+quota.o: ../../include/moira.h ../../include/mr_et.h
+quota.o: ../../include/moira_site.h ../../include/mit-copyright.h menu.h
+quota.o: defs.h f_defs.h globals.h
user.o: user.c /usr/include/stdio.h /usr/include/strings.h
-user.o: ../../include/sms.h /usr/include/sms_et.h ../../include/sms_app.h
-user.o: ../../include/mit-copyright.h menu.h /usr/include/ctype.h defs.h
-user.o: f_defs.h globals.h
+user.o: ../../include/moira.h ../../include/mr_et.h
+user.o: ../../include/moira_site.h ../../include/mit-copyright.h menu.h
+user.o: /usr/include/ctype.h defs.h f_defs.h globals.h
dcmmaint.o: dcmmaint.c /usr/include/stdio.h /usr/include/strings.h
-dcmmaint.o: /usr/include/ctype.h ../../include/sms.h /usr/include/sms_et.h
-dcmmaint.o: ../../include/sms_app.h ../../include/mit-copyright.h menu.h
+dcmmaint.o: /usr/include/ctype.h ../../include/moira.h ../../include/mr_et.h
+dcmmaint.o: ../../include/moira_site.h ../../include/mit-copyright.h menu.h
dcmmaint.o: defs.h f_defs.h globals.h
printer.o: printer.c /usr/include/stdio.h /usr/include/strings.h
-printer.o: /usr/include/ctype.h ../../include/sms.h /usr/include/sms_et.h
-printer.o: ../../include/sms_app.h ../../include/mit-copyright.h menu.h
+printer.o: /usr/include/ctype.h ../../include/moira.h ../../include/mr_et.h
+printer.o: ../../include/moira_site.h ../../include/mit-copyright.h menu.h
printer.o: defs.h f_defs.h globals.h
misc.o: misc.c /usr/include/stdio.h /usr/include/strings.h
-misc.o: ../../include/sms.h /usr/include/sms_et.h ../../include/sms_app.h
-misc.o: ../../include/mit-copyright.h menu.h /usr/include/sys/types.h
-misc.o: /usr/include/netdb.h /usr/include/sys/socket.h
-misc.o: /usr/include/netinet/in.h defs.h f_defs.h globals.h
+misc.o: ../../include/moira.h ../../include/mr_et.h
+misc.o: ../../include/moira_site.h ../../include/mit-copyright.h menu.h
+misc.o: /usr/include/sys/types.h /usr/include/netdb.h
+misc.o: /usr/include/sys/socket.h /usr/include/netinet/in.h defs.h f_defs.h
+misc.o: globals.h
static char rcsid_module_c[] = "$Header$";
#endif
-/* This is the file attach.c for the SMS Client, which allows a nieve
- * user to quickly and easily maintain most parts of the SMS database.
+/* This is the file attach.c for the MOIRA Client, which allows a nieve
+ * user to quickly and easily maintain most parts of the MOIRA database.
* It Contains: Functions for maintaining data used by Hesiod
* to map courses/projects/users to their file systems,
* and maintain filesys info.
#include <stdio.h>
#include <strings.h>
-#include <sms.h>
-#include <sms_app.h>
+#include <moira.h>
+#include <moira_site.h>
#include <menu.h>
#include "mit-copyright.h"
switch (type) {
case LABEL:
- if ( (stat = do_sms_query("get_filesys_by_label", 1, &name,
+ if ( (stat = do_mr_query("get_filesys_by_label", 1, &name,
StoreInfo, (char *)&elem)) != 0) {
com_err(program_name, stat, NULL);
return(NULL);
}
break;
case MACHINE:
- if ( (stat = do_sms_query("get_filesys_by_machine", 1, &name,
+ if ( (stat = do_mr_query("get_filesys_by_machine", 1, &name,
StoreInfo, (char *)&elem)) != 0) {
com_err(program_name, stat, NULL);
return(NULL);
}
break;
case GROUP:
- if ( (stat = do_sms_query("get_filesys_by_group", 1, &name,
+ if ( (stat = do_mr_query("get_filesys_by_group", 1, &name,
StoreInfo, (char *)&elem)) != 0) {
com_err(program_name, stat, NULL);
return(NULL);
args[ALIAS_NAME] = name;
args[ALIAS_TYPE] = FS_ALIAS_TYPE;
args[ALIAS_TRANS] = "*";
- if ( (stat = do_sms_query("get_alias", 3, args, StoreInfo,
+ if ( (stat = do_mr_query("get_alias", 3, args, StoreInfo,
(char *) &elem)) != 0) {
com_err(program_name, stat, " in get_alias.");
return(NULL);
info[FS_MODWITH]);
Put_message(print_buf);
Put_message("Containing the filesystems (in order):");
- if ((stat = do_sms_query("get_fsgroup_members", 1, &info[FS_NAME],
+ if ((stat = do_mr_query("get_fsgroup_members", 1, &info[FS_NAME],
StoreInfo, (char *)&elem)) != 0) {
- if (stat == SMS_NO_MATCH)
+ if (stat == MR_NO_MATCH)
Put_message(" [no members]");
else
com_err(program_name, stat, NULL);
sprintf(temp_buf, "Are you sure that you want to delete filesystem %s",
info[FS_NAME]);
if(!one_item || Confirm(temp_buf)) {
- if ( (stat = do_sms_query("delete_filesys", 1,
+ if ( (stat = do_mr_query("delete_filesys", 1,
&info[FS_NAME], Scream, NULL)) != 0)
com_err(program_name, stat, " filesystem not deleted.");
else
char ** args = AskFSInfo(info, TRUE);
extern Menu nfsphys_menu;
- stat = do_sms_query("update_filesys", CountArgs(args), args,
+ stat = do_mr_query("update_filesys", CountArgs(args), args,
NullFunc, NULL);
switch (stat) {
- case SMS_NFS:
+ case MR_NFS:
Put_message("That NFS filesystem is not exported.");
if (YesNoQuestion("Fix this now (Y/N)")) {
Do_menu(&nfsphys_menu, 0, NULL);
if (YesNoQuestion("Retry filesystem update now (Y/N)")) {
- if (stat = do_sms_query("update_filesys", CountArgs(args), args,
+ if (stat = do_mr_query("update_filesys", CountArgs(args), args,
NullFunc, NULL))
com_err(program_name, stat, " filesystem not updated");
else
}
}
break;
- case SMS_SUCCESS:
+ case MR_SUCCESS:
break;
default:
com_err(program_name, stat, " in UpdateFS");
if ( !ValidName(argv[1]) )
return(DM_NORMAL);
- if ( (stat = do_sms_query("get_filesys_by_label", 1, argv + 1,
+ if ( (stat = do_mr_query("get_filesys_by_label", 1, argv + 1,
NullFunc, NULL)) == 0) {
Put_message ("A Filesystem by that name already exists.");
return(DM_NORMAL);
- } else if (stat != SMS_NO_MATCH) {
+ } else if (stat != MR_NO_MATCH) {
com_err(program_name, stat, " in AddFS");
return(DM_NORMAL);
}
args = AskFSInfo(SetDefaults(info, argv[1]), FALSE );
- stat = do_sms_query("add_filesys", CountArgs(args), args, NullFunc, NULL);
+ stat = do_mr_query("add_filesys", CountArgs(args), args, NullFunc, NULL);
switch (stat) {
- case SMS_NFS:
+ case MR_NFS:
Put_message("That NFS filesystem is not exported.");
if (YesNoQuestion("Fix this now (Y/N)")) {
Do_menu(&nfsphys_menu, 0, NULL);
if (YesNoQuestion("Retry filesystem creation now (Y/N)")) {
- if (stat = do_sms_query("add_filesys", CountArgs(args), args,
+ if (stat = do_mr_query("add_filesys", CountArgs(args), args,
NullFunc, NULL))
com_err(program_name, stat, " in AddFS");
else
}
}
break;
- case SMS_SUCCESS:
+ case MR_SUCCESS:
break;
default:
com_err(program_name, stat, " in AddFS");
}
- if (stat == SMS_SUCCESS && !strcasecmp(info[FS_L_TYPE], "HOMEDIR")) {
+ if (stat == MR_SUCCESS && !strcasecmp(info[FS_L_TYPE], "HOMEDIR")) {
static char *val[] = {"def_quota", NULL};
static char *def_quota = NULL;
char *argv[3];
struct qelem *top = NULL;
if (def_quota == NULL) {
- stat = do_sms_query("get_value", CountArgs(val), val,
+ stat = do_mr_query("get_value", CountArgs(val), val,
StoreInfo, (char *) &top);
- if (stat != SMS_SUCCESS) {
+ if (stat != MR_SUCCESS) {
com_err(program_name, stat, " getting default quota");
} else {
top = QueueTop(top);
if (YesNoQuestion(buf, 1)) {
argv[Q_LOGIN] = argv[Q_FILESYS] = info[FS_NAME];
argv[Q_QUOTA] = def_quota;
- if ((stat = do_sms_query("add_nfs_quota", 3, argv, Scream,
- (char *) NULL)) != SMS_SUCCESS) {
+ if ((stat = do_mr_query("add_nfs_quota", 3, argv, Scream,
+ (char *) NULL)) != MR_SUCCESS) {
com_err(program_name, stat, " while adding quota");
}
}
struct qelem *elem = NULL;
char buf[BUFSIZ], *args[5], *bufp;
- if ((stat = do_sms_query("get_fsgroup_members", 1, argv+1, StoreInfo,
+ if ((stat = do_mr_query("get_fsgroup_members", 1, argv+1, StoreInfo,
(char *)&elem)) != 0) {
- if (stat != SMS_NO_MATCH)
+ if (stat != MR_NO_MATCH)
com_err(program_name, stat, " in AddFSToGroup");
}
if (elem == NULL) {
args[0] = argv[1];
args[1] = argv[2];
args[2] = "M";
- stat = do_sms_query("add_filesys_to_fsgroup", 3, args, Scream, NULL);
+ stat = do_mr_query("add_filesys_to_fsgroup", 3, args, Scream, NULL);
if (stat)
com_err(program_name, stat, " in AddFSToGroup");
return(DM_NORMAL);
FreeQueue(QueueTop(elem));
args[0] = argv[1];
args[1] = argv[2];
- stat = do_sms_query("add_filesys_to_fsgroup", 3, args, Scream, NULL);
- if (stat == SMS_EXISTS) {
+ stat = do_mr_query("add_filesys_to_fsgroup", 3, args, Scream, NULL);
+ if (stat == MR_EXISTS) {
Put_message("That filesystem is already a member of the group.");
Put_message("Use the order command if you want to change the sorting order.");
} else if (stat)
sprintf(buf, "Delete filesystem %s from FS group %s", argv[2], argv[1]);
if (!Confirm(buf))
return(DM_NORMAL);
- if ((stat = do_sms_query("remove_filesys_from_fsgroup", 2, argv+1,
+ if ((stat = do_mr_query("remove_filesys_from_fsgroup", 2, argv+1,
Scream, NULL)) != 0) {
com_err(program_name, stat, ", not removed.");
}
struct qelem *elem = NULL, *top;
char buf[BUFSIZ], *bufp, *args[3];
- if ((stat = do_sms_query("get_fsgroup_members", 1, argv+1, StoreInfo,
+ if ((stat = do_mr_query("get_fsgroup_members", 1, argv+1, StoreInfo,
(char *)&elem)) != 0) {
- if (stat == SMS_NO_MATCH) {
+ if (stat == MR_NO_MATCH) {
sprintf(buf, "Ether %s is not a filesystem group or it has no members", argv[1]);
Put_message(buf);
} else
args[2] = SortAfter(top, dst);
args[0] = argv[1];
args[1] = ((char **)elem->q_data)[0];
- if ((stat = do_sms_query("remove_filesys_from_fsgroup", 2, args,
+ if ((stat = do_mr_query("remove_filesys_from_fsgroup", 2, args,
Scream, NULL)) != 0) {
com_err(program_name, stat, " in ChangeFSGroupOrder");
return(DM_NORMAL);
}
- if ((stat = do_sms_query("add_filesys_to_fsgroup", 3, args,
+ if ((stat = do_mr_query("add_filesys_to_fsgroup", 3, args,
Scream, NULL)) != 0) {
com_err(program_name, stat, " in ChangeFSGroupOrder");
}
* print out values, free memory used and then exit.
*/
- if ( (stat = do_sms_query("get_alias", 3, args, StoreInfo,
+ if ( (stat = do_mr_query("get_alias", 3, args, StoreInfo,
(char *)&elem)) == 0) {
top = elem = QueueTop(elem);
while (elem != NULL) {
FreeQueue(top);
return(DM_NORMAL);
}
- else if ( stat != SMS_NO_MATCH) {
+ else if ( stat != MR_NO_MATCH) {
com_err(program_name, stat, " in CreateFSAlias.");
return(DM_NORMAL);
}
GetValueFromUser("Which filesystem will this alias point to?",
&args[ALIAS_TRANS]);
- if ( (stat = do_sms_query("add_alias", 3, args, NullFunc, NULL)) != 0)
+ if ( (stat = do_mr_query("add_alias", 3, args, NullFunc, NULL)) != 0)
com_err(program_name, stat, " in CreateFSAlias.");
FreeInfo(args);
"Are you sure that you want to delete the filesystem alias %s",
info[ALIAS_NAME]);
if(!one_item || Confirm(temp_buf)) {
- if ( (stat = do_sms_query("delete_alias", CountArgs(info),
+ if ( (stat = do_mr_query("delete_alias", CountArgs(info),
info, Scream, NULL)) != 0 )
com_err(program_name, stat, " filesystem alias not deleted.");
else
static char rcsid_module_c[] = "$Header$";
#endif lint
-/* This is the file cluster.c for the SMS Client, which allows a nieve
- * user to quickly and easily maintain most parts of the SMS database.
+/* This is the file cluster.c for the MOIRA Client, which allows a nieve
+ * user to quickly and easily maintain most parts of the MOIRA database.
* It Contains:
*
* Created: 4/22/88
#include <stdio.h>
#include <strings.h>
-#include <sms.h>
-#include <sms_app.h>
+#include <moira.h>
+#include <moira_site.h>
#include <menu.h>
#include "mit-copyright.h"
switch (type) {
case MACHINE:
- if ( (stat = do_sms_query("get_machine", 1, &name1,
+ if ( (stat = do_mr_query("get_machine", 1, &name1,
StoreInfo, (char *)&elem)) != 0) {
com_err(program_name, stat, " in get_machine.");
return(NULL);
}
break;
case CLUSTER:
- if ( (stat = do_sms_query("get_cluster", 1, &name1,
+ if ( (stat = do_mr_query("get_cluster", 1, &name1,
StoreInfo, (char *)&elem)) != 0) {
com_err(program_name, stat, " in get_cluster.");
return(NULL);
case MAP:
args[MAP_MACHINE] = name1;
args[MAP_CLUSTER] = name2;
- if ( (stat = do_sms_query("get_machine_to_cluster_map", 2, args,
+ if ( (stat = do_mr_query("get_machine_to_cluster_map", 2, args,
StoreInfo, (char *)&elem)) != 0) {
com_err(program_name, stat, " in get_machine_to_cluster_map.");
return(NULL);
case DATA:
args[CD_NAME] = name1;
args[CD_LABEL] = name2;
- if ( (stat = do_sms_query("get_cluster_data", 2, args,
+ if ( (stat = do_mr_query("get_cluster_data", 2, args,
StoreInfo, (char *)&elem)) != 0) {
com_err(program_name, stat, " in get_cluster_data.");
return(NULL);
*/
name = canonicalize_hostname(strsave(argv[1]));
- if ( (stat = do_sms_query("get_machine", 1, &name, NullFunc, NULL)) == 0) {
+ if ( (stat = do_mr_query("get_machine", 1, &name, NullFunc, NULL)) == 0) {
Put_message("This machine already exists.");
free(name);
return(DM_NORMAL);
}
- else if (stat != SMS_NO_MATCH) {
+ else if (stat != MR_NO_MATCH) {
com_err(program_name, stat, " in AddMachine.");
free(name);
return(DM_NORMAL);
* Actually create the new Machine.
*/
- if ( (stat = do_sms_query("add_machine", CountArgs(args),
+ if ( (stat = do_mr_query("add_machine", CountArgs(args),
args, Scream, NULL)) != 0)
com_err(program_name, stat, " in AddMachine.");
{
register int stat;
char ** args = AskMCDInfo(info, MACHINE, TRUE);
- if ( (stat = do_sms_query("update_machine", CountArgs(args),
+ if ( (stat = do_mr_query("update_machine", CountArgs(args),
args, Scream, NULL)) != 0)
com_err(program_name, stat, " in UpdateMachine.");
else
* and if so then removes it
* Arguments: name - name of the machine (already Canonocalized).
* ask_user- query the user before removing if from clusters?
- * Returns: SMS_ERROR if machine left in a cluster, or sms_error.
+ * Returns: MR_ERROR if machine left in a cluster, or mr_error.
*/
int
ret_value = SUB_NORMAL; /* initialize ret_value. */
args[0] = name;
args[1] = "*";
- stat = do_sms_query("get_machine_to_cluster_map", 2, args,
+ stat = do_mr_query("get_machine_to_cluster_map", 2, args,
StoreInfo, (char *)&elem);
- if (stat && stat != SMS_NO_MATCH) {
+ if (stat && stat != MR_NO_MATCH) {
com_err(program_name, stat, " in get_machine_to_cluster_map.");
return(DM_NORMAL);
}
- if (stat == SMS_SUCCESS) {
+ if (stat == MR_SUCCESS) {
elem = top = QueueTop(elem);
if (ask_user) {
sprintf(temp_buf, "%s is assigned to the following clusters.",
if (delete_it) {
while (elem != NULL) {
char **info = (char **) elem->q_data;
- if ( (stat = do_sms_query( "delete_machine_from_cluster",
+ if ( (stat = do_mr_query( "delete_machine_from_cluster",
2, info, Scream, NULL)) != 0) {
ret_value = SUB_ERROR;
com_err(program_name, stat,
info[M_NAME]);
if(!one_machine || Confirm(temp_buf)) {
if (CheckAndRemoveFromCluster(info[M_NAME], TRUE) != SUB_ERROR) {
- if ( (stat = do_sms_query("delete_machine", 1,
+ if ( (stat = do_mr_query("delete_machine", 1,
&info[M_NAME], Scream, NULL)) != 0) {
com_err(program_name, stat, " in DeleteMachine.");
sprintf(temp_buf, "%s ** NOT ** deleted.",
if (add_it) {
args[0] = minfo[M_NAME];
args[1] = cinfo[C_NAME];
- stat = do_sms_query("add_machine_to_cluster", 2, args,
+ stat = do_mr_query("add_machine_to_cluster", 2, args,
Scream, NULL);
switch (stat) {
- case SMS_SUCCESS:
+ case MR_SUCCESS:
break;
- case SMS_EXISTS:
+ case MR_EXISTS:
sprintf(temp_buf, "%s is already in cluster %s",
minfo[M_NAME], cinfo[C_NAME]);
Put_message(temp_buf);
sprintf(temp_buf, "Remove %s from the cluster %s",
info[MAP_MACHINE], info[MAP_CLUSTER]);
if (!one_map || Confirm(temp_buf)) {
- if ( (stat = do_sms_query("delete_machine_from_cluster", 2,
+ if ( (stat = do_mr_query("delete_machine_from_cluster", 2,
info, Scream, NULL)) != 0 )
com_err(program_name, stat, " in delete_machine_from_cluster");
else {
args[MAP_CLUSTER] = argv[2];
args[MAP_END] = NULL;
- stat = do_sms_query("get_machine_to_cluster_map", CountArgs(args), args,
+ stat = do_mr_query("get_machine_to_cluster_map", CountArgs(args), args,
StoreInfo, (char *)&elem);
- if (stat == SMS_NO_MATCH) {
+ if (stat == MR_NO_MATCH) {
sprintf(buf, "The machine %s is not is the cluster %s.",
args[MAP_MACHINE], args[MAP_CLUSTER]);
Put_message(buf);
free(args[MAP_MACHINE]);
return(DM_NORMAL);
}
- if (stat != SMS_SUCCESS)
+ if (stat != MR_SUCCESS)
com_err(program_name, stat, " in delete_machine_from_cluster");
elem = QueueTop(elem);
if (!ValidName(name))
return(DM_NORMAL);
- if ( (stat = do_sms_query("get_cluster", 1, &name,
- NullFunc, NULL)) == SMS_SUCCESS) {
+ if ( (stat = do_mr_query("get_cluster", 1, &name,
+ NullFunc, NULL)) == MR_SUCCESS) {
Put_message("This cluster already exists.");
return(DM_NORMAL);
}
- else if (stat != SMS_NO_MATCH) {
+ else if (stat != MR_NO_MATCH) {
com_err(program_name, stat, " in AddCluster.");
return(DM_NORMAL);
}
/*
* Actually create the new Cluster.
*/
- if ( (stat = do_sms_query("add_cluster", CountArgs(args),
+ if ( (stat = do_mr_query("add_cluster", CountArgs(args),
args, Scream, NULL)) != 0)
com_err(program_name, stat, " in AddCluster.");
{
register int stat;
char ** args = AskMCDInfo(info, CLUSTER, TRUE);
- if ( (stat = do_sms_query("update_cluster", CountArgs(args),
+ if ( (stat = do_mr_query("update_cluster", CountArgs(args),
args, Scream, NULL)) != 0)
com_err(program_name, stat, " in UpdateCluster.");
else
ret_value = SUB_NORMAL;
args[MAP_MACHINE] = "*";
args[MAP_CLUSTER] = name;
- stat = do_sms_query("get_machine_to_cluster_map", 2, args,
+ stat = do_mr_query("get_machine_to_cluster_map", 2, args,
StoreInfo, (char *)&elem);
- if (stat && stat != SMS_NO_MATCH) {
+ if (stat && stat != MR_NO_MATCH) {
com_err(program_name, stat, " in get_machine_to_cluster_map.");
return(DM_NORMAL);
}
elem = top;
while (elem != 0) {
char **info = (char **) elem->q_data;
- if ( (stat = do_sms_query("delete_machine_from_cluster",
+ if ( (stat = do_mr_query("delete_machine_from_cluster",
2, info, Scream, NULL)) != 0) {
ret_value = SUB_ERROR;
com_err(program_name, stat,
info[C_NAME]);
if (!one_cluster || Confirm(temp_buf)) {
if (CheckAndRemoveMachines(info[C_NAME], TRUE) != SUB_ERROR) {
- if ( (stat = do_sms_query("delete_cluster", 1,
+ if ( (stat = do_mr_query("delete_cluster", 1,
&info[C_NAME], Scream, NULL)) != 0) {
com_err(program_name, stat, " in delete_cluster.");
sprintf(temp_buf, "Cluster %s ** NOT ** deleted.",
{
int stat;
- if( (stat = do_sms_query("add_cluster_data", 3, argv + 1,
+ if( (stat = do_mr_query("add_cluster_data", 3, argv + 1,
Scream, (char *) NULL)) != 0)
com_err(program_name, stat, " in AddClusterData.");
temp_ptr = "Are you sure that you want to remove this cluster data (y/n) ?";
PrintClusterData(info);
if (!one_item || Confirm(temp_ptr)) {
- if( (stat = do_sms_query("delete_cluster_data", 3, info,
+ if( (stat = do_mr_query("delete_cluster_data", 3, info,
Scream, (char *) NULL)) != 0) {
com_err(program_name, stat, " in DeleteClusterData.");
Put_message("Data not removed.");
#include <stdio.h>
#include <strings.h>
#include <ctype.h>
-#include <sms.h>
-#include <sms_app.h>
+#include <moira.h>
+#include <moira_site.h>
#include <menu.h>
#include "mit-copyright.h"
char **info;
{
info[1] = strsave(argv[0]);
- return(SMS_CONT);
+ return(MR_CONT);
}
EnableDcm(argc, argv)
char *info[3];
info[0] = "dcm_enable";
- if (status = do_sms_query("get_value", 1, info, genable, info))
+ if (status = do_mr_query("get_value", 1, info, genable, info))
com_err(whoami, status, " while getting value of dcm_enable");
GetValueFromUser("Enable value", &info[1]);
- if (status = do_sms_query("update_value", 2, info, Scream, NULL))
+ if (status = do_mr_query("update_value", 2, info, Scream, NULL))
com_err(whoami, status, " while updating value of dcm_enable");
FreeAndClear(&info[0], FALSE);
FreeAndClear(&info[1], TRUE);
atoi(argv[SVC_INPROGRESS]) ? "InProgress" : "Idle", tmp);
Put_message(buf);
Put_message("");
- return(SMS_CONT);
+ return(MR_CONT);
}
int status;
qargv[0] = argv[1];
- if (status = do_sms_query("get_server_info", 1, qargv, shserv, NULL))
+ if (status = do_mr_query("get_server_info", 1, qargv, shserv, NULL))
com_err(whoami, status, " while getting server info");
return(DM_NORMAL);
}
initserv(argv[1], info);
askserv(info);
- if (status = do_sms_query("add_server_info", 8, info, Scream, NULL))
+ if (status = do_mr_query("add_server_info", 8, info, Scream, NULL))
com_err(whoami, status, " while updating server info");
FreeInfo(info);
return(DM_NORMAL);
cargv[SC_ACE_TYPE] = strsave(argv[SVC_ACE_TYPE]);
cargv[SC_ACE_NAME] = strsave(argv[SVC_ACE_NAME]);
cargv[SC_END] = NULL;
- return(SMS_CONT);
+ return(MR_CONT);
}
initserv(name, argv)
argv[SC_INTERVAL] = strsave("1440");
sprintf(tmp, "/tmp/%s.out", name);
argv[SC_TARGET] = strsave(tmp);
- sprintf(tmp, "/u1/sms/bin/%s.sh", name);
+ sprintf(tmp, "/u1/mr/bin/%s.sh", name);
argv[SC_SCRIPT] = strsave(tmp);
argv[SC_TYPE] = strsave("UNIQUE");
argv[SC_ENABLE] = strsave("1");
int status;
qargv[0] = (char *)argv[1];
- if (status = do_sms_query("get_server_info", 1,
+ if (status = do_mr_query("get_server_info", 1,
qargv, gserv, (char *)qargv)) {
com_err(whoami, status, " while getting server info");
return(DM_NORMAL);
}
askserv(qargv);
- if (status = do_sms_query("update_server_info", 8, qargv, Scream, NULL))
+ if (status = do_mr_query("update_server_info", 8, qargv, Scream, NULL))
com_err(whoami, status, " while updating server info");
return(DM_NORMAL);
}
free(ltt);
Put_message(buf);
Put_message("");
- return(SMS_CONT);
+ return(MR_CONT);
}
qargv[SHI_SERVICE] = argv[1];
qargv[SHI_MACHINE] = canonicalize_hostname(argv[2]);
- if (status = do_sms_query("get_server_host_info", 2, qargv, shhost, NULL))
+ if (status = do_mr_query("get_server_host_info", 2, qargv, shhost, NULL))
com_err(whoami, status, " getting server/host info");
return(DM_NORMAL);
}
char **argv;
{
int status;
- if (status = do_sms_query("reset_server_error", 1, &argv[1], Scream, NULL))
+ if (status = do_mr_query("reset_server_error", 1, &argv[1], Scream, NULL))
com_err(whoami, status, " while resetting server error");
return(DM_NORMAL);
}
qargv[3] = "0";
qargv[4] = "0";
qargv[5] = "";
- if (status = do_sms_query("set_server_internal_flags", 6, qargv,
+ if (status = do_mr_query("set_server_internal_flags", 6, qargv,
Scream, NULL))
com_err(whoami, status, " while resetting server error");
return(DM_NORMAL);
int status;
argv[2] = canonicalize_hostname(argv[2]);
- if (status = do_sms_query("reset_server_host_error", 2, &argv[1],
+ if (status = do_mr_query("reset_server_host_error", 2, &argv[1],
Scream, NULL))
com_err(whoami, status, " while resetting server/host error");
return(DM_NORMAL);
qargv[6] = "";
qargv[7] = "0";
qargv[8] = "0";
- if (status = do_sms_query("set_server_host_internal", 9, qargv,
+ if (status = do_mr_query("set_server_host_internal", 9, qargv,
Scream, NULL))
com_err(whoami, status, " while resetting server/host error");
return(DM_NORMAL);
int status;
argv[2] = canonicalize_hostname(argv[2]);
- if (status = do_sms_query("set_server_host_override", 2, &argv[1],
+ if (status = do_mr_query("set_server_host_override", 2, &argv[1],
Scream, NULL))
com_err(whoami, status, " while setting server/host override");
return(DM_NORMAL);
cargv[SHI_VALUE2] = strsave(argv[SH_VALUE2]);
cargv[SHI_VALUE3] = strsave(argv[SH_VALUE3]);
cargv[SHI_END] = NULL;
- return(SMS_CONT);
+ return(MR_CONT);
}
info[SHI_SERVICE] = strsave(argv[1]);
info[SHI_MACHINE] = strsave(canonicalize_hostname(argv[2]));
- if (status = do_sms_query("get_server_host_info", 2, info, ghost,
+ if (status = do_mr_query("get_server_host_info", 2, info, ghost,
(char *)info)) {
com_err(whoami, status, " while getting server/host info");
return(DM_NORMAL);
}
askhost(info);
- if (status = do_sms_query("update_server_host_info", SHI_END, info,
+ if (status = do_mr_query("update_server_host_info", SHI_END, info,
Scream, NULL))
com_err(whoami, status, " while updating server/host info");
FreeInfo(info);
info[SHI_MACHINE] = strsave(canonicalize_hostname(argv[2]));
inithost(info);
askhost(info);
- if (status = do_sms_query("add_server_host_info", 6, info, Scream, NULL))
+ if (status = do_mr_query("add_server_host_info", 6, info, Scream, NULL))
com_err(whoami, status, " while adding server/host info");
FreeInfo(info);
return(DM_NORMAL);
{
int status;
- if (status = do_sms_query("delete_server_info", 1, &argv[1], Scream, NULL))
+ if (status = do_mr_query("delete_server_info", 1, &argv[1], Scream, NULL))
com_err(whoami, status, " while deleting server info");
return(DM_NORMAL);
}
int status;
argv[2] = canonicalize_hostname(argv[2]);
- if (status = do_sms_query("delete_server_host_info", 2, &argv[1],
+ if (status = do_mr_query("delete_server_host_info", 2, &argv[1],
Scream, NULL))
com_err(whoami, status, " while deleting server/host info");
return(DM_NORMAL);
sprintf(buf, "Service %s", argv[0]);
Put_message(buf);
(*count)++;
- return(SMS_CONT);
+ return(MR_CONT);
}
phost(argc, argv, count)
sprintf(buf, "Host %s:%s", argv[0], argv[1]);
Put_message(buf);
(*count)++;
- return(SMS_CONT);
+ return(MR_CONT);
}
argv[0] = argv[2] = "DONTCARE";
argv[1] = "TRUE";
- if ((status = do_sms_query("qualified_get_server", 3, argv, pserv,
+ if ((status = do_mr_query("qualified_get_server", 3, argv, pserv,
(char *)&count)) &&
- status != SMS_NO_MATCH)
+ status != MR_NO_MATCH)
com_err(whoami, status, " while getting servers");
argv[0] = "*";
argv[1] = argv[2] = argv[3] = argv[5] = "DONTCARE";
argv[4] = "TRUE";
- if ((status = do_sms_query("qualified_get_server_host",6,argv,phost,
+ if ((status = do_mr_query("qualified_get_server_host",6,argv,phost,
(char *)&count)) &&
- status != SMS_NO_MATCH)
+ status != MR_NO_MATCH)
com_err(whoami, status, " while getting server/hosts");
if (!count)
strcpy(buf, "Nothing is in progress at this time");
argv[0] = argv[1] = "DONTCARE";
argv[2] = "TRUE";
- if ((status = do_sms_query("qualified_get_server", 3, argv, pserv,
+ if ((status = do_mr_query("qualified_get_server", 3, argv, pserv,
(char *)&count)) &&
- status != SMS_NO_MATCH)
+ status != MR_NO_MATCH)
com_err(whoami, status, " while getting servers");
argv[0] = "*";
argv[1] = argv[2] = argv[3] = argv[4] = "DONTCARE";
argv[5] = "TRUE";
- if ((status = do_sms_query("qualified_get_server_host",6,argv,phost,
+ if ((status = do_mr_query("qualified_get_server_host",6,argv,phost,
(char *)&count)) &&
- status != SMS_NO_MATCH)
+ status != MR_NO_MATCH)
com_err(whoami, status, " while getting server/hosts");
if (!count)
strcpy(buf, "Nothing has failed at this time");
Dcm()
{
int status;
- if (status = sms_do_update())
+ if (status = mr_do_update())
com_err(whoami, status, " while triggering update");
return(DM_NORMAL);
}
static char rcsid_module_c[] = "$Header$";
#endif lint
-/* This is the file delete.c for the SMS Client, which allows a nieve
- * user to quickly and easily maintain most parts of the SMS database.
+/* This is the file delete.c for the MOIRA Client, which allows a nieve
+ * user to quickly and easily maintain most parts of the MOIRA database.
* It Contains: functions for deleting users and lists.
*
* Created: 5/18/88
#include <stdio.h>
#include <strings.h>
-#include <sms.h>
-#include <sms_app.h>
+#include <moira.h>
+#include <moira_site.h>
#include <menu.h>
#include "mit-copyright.h"
int status;
char *args[2], buf[BUFSIZ], **info;
- if ( (status = do_sms_query("count_members_of_list", 1, &name, StoreInfo,
+ if ( (status = do_mr_query("count_members_of_list", 1, &name, StoreInfo,
(char *) &elem)) != 0) {
com_err(program_name, status,
" in DeleteList (count_members_of_list).");
args[0] = type;
args[1] = name;
- status = do_sms_query("get_ace_use", 2, args, NullFunc, (char *) NULL);
- if (status != SMS_NO_MATCH)
+ status = do_mr_query("get_ace_use", 2, args, NullFunc, (char *) NULL);
+ if (status != MR_NO_MATCH)
return; /* If this query fails the ace will
not be deleted even if it is empty. */
if (verbose) {
args[0] = type;
args[1] = name;
- switch (status = do_sms_query("get_ace_use", 2, args,
+ switch (status = do_mr_query("get_ace_use", 2, args,
StoreInfo, (char *) &elem)) {
- case SMS_NO_MATCH:
+ case MR_NO_MATCH:
return(DM_NORMAL);
- case SMS_SUCCESS:
+ case MR_SUCCESS:
local = elem = QueueTop(elem);
info = (char **) local->q_data;
if (QueueCount(elem) == 1 &&
* Get all list of which this item is a member, and store them in a queue.
*/
- status = do_sms_query("get_lists_of_member", 2, args, StoreInfo,
+ status = do_mr_query("get_lists_of_member", 2, args, StoreInfo,
(char *) elem);
- if (status == SMS_NO_MATCH)
+ if (status == MR_NO_MATCH)
return(SUB_NORMAL);
- if (status != SMS_SUCCESS) {
+ if (status != MR_SUCCESS) {
com_err(program_name, status, " in DeleteList (get_lists_of_member).");
return(SUB_ERROR);
}
while (local != NULL) {
char ** info = (char **) local->q_data;
args[DM_LIST] = info[GLOM_NAME];
- if ( (status = do_sms_query("delete_member_from_list",
+ if ( (status = do_mr_query("delete_member_from_list",
3, args, Scream, NULL)) != 0) {
com_err(program_name, status, " in delete_member\nAborting\n");
FreeQueue(*elem);
/*
* Get the members of this list.
*/
- status = do_sms_query("get_members_of_list", 1, &name, StoreInfo,
+ status = do_mr_query("get_members_of_list", 1, &name, StoreInfo,
(char *) &elem);
- if (status == SMS_NO_MATCH)
+ if (status == MR_NO_MATCH)
return(SUB_NORMAL);
if (status != 0) {
char ** info = (char **) local->q_data;
args[1] = info[0];
args[2] = info[1];
- if ( (status = do_sms_query("delete_member_from_list",
+ if ( (status = do_mr_query("delete_member_from_list",
3, args, Scream, NULL)) != 0) {
com_err(program_name, status, " in delete_member\nAborting\n");
FreeQueue(elem);
* Arguments: name - the name of the list to delete.
* verbose - flag that if TRUE queries the user to
* ask if list should be deleted.
- * Returns: SMS_ERROR if there is an error.
+ * Returns: MR_ERROR if there is an error.
*/
int
int status, ans;
char buf[BUFSIZ], *args[10];
- status = do_sms_query("get_list_info", 1, &name, NullFunc, (char *) NULL);
+ status = do_mr_query("get_list_info", 1, &name, NullFunc, (char *) NULL);
if (status == 0) {
if (verbose) {
sprintf(buf, "There is also a list named %s, delete it?", name);
args[1] = name;
DeleteList(2, args);
}
- else if (status != SMS_NO_MATCH) {
+ else if (status != MR_NO_MATCH) {
com_err(program_name, status, " Aborting Delete User.");
return(SUB_ERROR);
}
int status;
char buf[BUFSIZ];
- switch (status = do_sms_query("get_filesys_by_label", 1, &name, NullFunc,
+ switch (status = do_mr_query("get_filesys_by_label", 1, &name, NullFunc,
(char *) NULL)) {
- case SMS_NO_MATCH:
+ case MR_NO_MATCH:
break;
- case SMS_SUCCESS:
+ case MR_SUCCESS:
if (verbose) {
sprintf(buf, "Delete the filesystem named %s (y/n)?", name);
switch (YesNoQuestion(buf, FALSE)) {
return(SUB_ERROR);
}
}
- if ( (status = do_sms_query("delete_filesys", 1, &name, Scream,
- (char *) NULL) ) != SMS_SUCCESS) {
+ if ( (status = do_mr_query("delete_filesys", 1, &name, Scream,
+ (char *) NULL) ) != MR_SUCCESS) {
com_err(program_name, status, " in delete_filesys.");
return(SUB_ERROR);
}
char buf[BUFSIZ];
int status;
- if ( (status = do_sms_query("delete_user", 1, &name, Scream,
- (char *) NULL)) != SMS_SUCCESS) {
+ if ( (status = do_mr_query("delete_user", 1, &name, Scream,
+ (char *) NULL)) != MR_SUCCESS) {
com_err(program_name, status, ": user not deleted");
return(SUB_ERROR);
}
char buf[BUFSIZ];
int status;
- if ( (status = do_sms_query("delete_list", 1, &name, Scream,
- (char *) NULL)) != SMS_SUCCESS) {
+ if ( (status = do_mr_query("delete_list", 1, &name, Scream,
+ (char *) NULL)) != MR_SUCCESS) {
com_err(program_name, status, ": list not deleted");
return(SUB_ERROR);
}
* 3) This list is not an ace of another object.
*/
- switch (status = do_sms_query("delete_list", 1, &name,
+ switch (status = do_mr_query("delete_list", 1, &name,
Scream, (char *) NULL)) {
- case SMS_SUCCESS:
+ case MR_SUCCESS:
Put_message("List Sucessfully Deleted.");
CheckAce(list_info[L_ACE_TYPE], list_info[L_ACE_NAME], ask_first);
break;
- case SMS_IN_USE:
+ case MR_IN_USE:
/*
* This list is in use. Try to find out why,
* and for the cases where we have a good idea of
list_info[L_ACE_TYPE] = Strsave("USER");
list_info[L_ACE_NAME] = Strsave(user);
SlipInNewName(list_info, Strsave(list_info[L_NAME]));
- if ((status = do_sms_query("update_list", CountArgs(list_info)-3,
+ if ((status = do_mr_query("update_list", CountArgs(list_info)-3,
list_info, Scream, (char *) NULL))
- != SMS_SUCCESS) {
+ != MR_SUCCESS) {
com_err(program_name, status, " while updating list owner");
Put_message("List may be only partly deleted.");
}
/* Function Name: DeleteList
* Description: deletes a list
- * Arguments: argc, argv - standard SMS argc and argv.
+ * Arguments: argc, argv - standard MR argc and argv.
* Returns: DM Status Code.
*/
list = NULL;
- switch(status = do_sms_query("get_list_info", 1, argv + 1,
+ switch(status = do_mr_query("get_list_info", 1, argv + 1,
StoreInfo, (char *) &list)){
- case SMS_SUCCESS:
+ case MR_SUCCESS:
break;
-/* case SMS_NO_WILDCARD:
+/* case MR_NO_WILDCARD:
Put_message("Wildcards are not accepted here.");
return(DM_NORMAL);
-*/ case SMS_NO_MATCH:
- case SMS_LIST:
+*/ case MR_NO_MATCH:
+ case MR_LIST:
Put_message("There is no list that matches that name.");
return(DM_NORMAL);
default:
if (!Confirm("Are you sure that you want to delete this user?"))
return(DM_NORMAL);
- status = do_sms_query("delete_user", 1, &name, Scream, (char *) NULL);
- if (status != SMS_IN_USE && status != 0) {
+ status = do_mr_query("delete_user", 1, &name, Scream, (char *) NULL);
+ if (status != MR_IN_USE && status != 0) {
com_err(program_name, status, ": user not deleted");
return(DM_NORMAL);
}
Put_message("Sorry, registered users cannot be deleted from the database.");
Put_message("Deactivate the user now, and the system manager will expunge later.");
#ifdef notdef
- else if (status == SMS_IN_USE) {
+ else if (status == MR_IN_USE) {
/*
* Check:
static char rcsid_module_c[] = "$Header$";
#endif lint
-/* This is the file globals.c for the SMS Client, which allows a nieve
- * user to quickly and easily maintain most parts of the SMS database.
+/* This is the file globals.c for the Moira Client, which allows a nieve
+ * user to quickly and easily maintain most parts of the Moira database.
* It Contains: globals variable definitions.
*
* Created: 4/12/88
static char rcsid_module_c[] = "$Header$";
#endif lint
-/* This is the file lists.c for the SMS Client, which allows a nieve
- * user to quickly and easily maintain most parts of the SMS database.
+/* This is the file lists.c for the MOIRA Client, which allows a nieve
+ * user to quickly and easily maintain most parts of the MOIRA database.
* It Contains: All list manipulation functions, except delete.
*
* Created: 4/12/88
#include <stdio.h>
#include <strings.h>
-#include <sms.h>
-#include <sms_app.h>
+#include <moira.h>
+#include <moira_site.h>
#include <menu.h>
#include "mit-copyright.h"
switch(type) {
case LIST:
args[0] = name1;
- if ( (status = do_sms_query("get_list_info", 1, args,
+ if ( (status = do_mr_query("get_list_info", 1, args,
StoreInfo, (char *) &elem)) != 0) {
com_err(program_name, status, " in get_list_info");
return (NULL);
break;
case MEMBERS:
args[0] = name1;
- if ( (status = do_sms_query("get_members_of_list", 1, args,
+ if ( (status = do_mr_query("get_members_of_list", 1, args,
StoreInfo, (char *) &elem)) != 0) {
com_err(program_name, status, " in get_members_of_list");
return (NULL);
case GLOM:
args[0] = name1;
args[1] = name2;
- if ( (status = do_sms_query("get_lists_of_member", 2, args,
+ if ( (status = do_mr_query("get_lists_of_member", 2, args,
StoreInfo, (char *) &elem)) != 0) {
com_err(program_name, status, " in get_list_of_members");
return (NULL);
case ACE_USE:
args[0] = name1;
args[1] = name2;
- if ( (status = do_sms_query("get_ace_use", 2, args,
+ if ( (status = do_mr_query("get_ace_use", 2, args,
StoreInfo, (char *) &elem)) != 0) {
com_err(program_name, status, " in get_ace_use");
return (NULL);
char ** args;
args = AskListInfo(info, TRUE);
- if ( (stat = do_sms_query("update_list", CountArgs(args), args,
- Scream, (char *) NULL)) != SMS_SUCCESS) {
+ if ( (stat = do_mr_query("update_list", CountArgs(args), args,
+ Scream, (char *) NULL)) != MR_SUCCESS) {
com_err(program_name, stat, " in UpdateList.");
Put_message("List ** NOT ** Updated.");
}
if (!ValidName(argv[1]))
return(DM_NORMAL);
- status = do_sms_query("get_list_info", 1, argv + 1, NullFunc,
+ status = do_mr_query("get_list_info", 1, argv + 1, NullFunc,
(char *) NULL);
- if (status != SMS_NO_MATCH) {
- if (status == SMS_SUCCESS)
+ if (status != MR_NO_MATCH) {
+ if (status == MR_SUCCESS)
Put_message("This list already exists.");
else
com_err(program_name, status, " in AddList.");
add_args = AskListInfo(SetDefaults(info,argv[1]), FALSE);
- if ( (status = do_sms_query("add_list", CountArgs(add_args), add_args,
- Scream, (char *) NULL)) != SMS_SUCCESS) {
+ if ( (status = do_mr_query("add_list", CountArgs(add_args), add_args,
+ Scream, (char *) NULL)) != MR_SUCCESS) {
com_err(program_name, status, " in AddList.");
Put_message("List Not Created.");
ret_code = SUB_ERROR;
}
else
/* All we want to know is if it exists. */
- switch( (stat = do_sms_query("count_members_of_list", 1, argv + 1,
+ switch( (stat = do_mr_query("count_members_of_list", 1, argv + 1,
NullFunc, (char *) NULL))) {
- case SMS_SUCCESS:
+ case MR_SUCCESS:
break;
- case SMS_LIST:
+ case MR_LIST:
Put_message("This list does not exist.");
return(DM_QUIT);
- case SMS_PERM:
+ case MR_PERM:
Put_message("You are not allowed to view this list.");
break;
default:
args[1] = NULL;
found_some = FALSE;
- if ( (status = do_sms_query("get_members_of_list", CountArgs(args), args,
+ if ( (status = do_mr_query("get_members_of_list", CountArgs(args), args,
PrintByType, type)) != 0) {
com_err(program_name, status, " in ListMembersByType");
return(DM_NORMAL);
if ( GetMemberInfo("add", args) == SUB_ERROR )
return(DM_NORMAL);
- if ( (status = do_sms_query("add_member_to_list", CountArgs(args), args,
- Scream, NULL)) != SMS_SUCCESS) {
- if (status == SMS_EXISTS) {
+ if ( (status = do_mr_query("add_member_to_list", CountArgs(args), args,
+ Scream, NULL)) != MR_SUCCESS) {
+ if (status == MR_EXISTS) {
sprintf(temp_buf, "The %s %s is already a member of LIST %s.",
args[LM_TYPE], args[LM_MEMBER], args[LM_LIST]);
Put_message(temp_buf);
return(DM_NORMAL);
if (Confirm("Are you sure you want to delete this member?") ) {
- if (status = do_sms_query("delete_member_from_list", CountArgs(args),
+ if (status = do_mr_query("delete_member_from_list", CountArgs(args),
args, Scream, NULL))
com_err(program_name, status, " in DeleteMember");
else
args[DM_LIST] = info[GLOM_NAME];
args[DM_TYPE] = type;
args[DM_MEMBER] = name;
- if ( (status = do_sms_query("delete_member_from_list", 3, args,
+ if ( (status = do_mr_query("delete_member_from_list", 3, args,
Scream, (char *) NULL)) != 0)
/* should probabally check to delete list. */
com_err(program_name, status, " in delete_member");
if (YesNoQuestion("This query will take a while, Do you wish to continue?",
TRUE) == TRUE )
- if (status = do_sms_query("qualified_get_lists", 5, args,
+ if (status = do_mr_query("qualified_get_lists", 5, args,
Print, (char *) NULL) != 0)
com_err(program_name, status, " in ListAllGroups");
return (DM_NORMAL);
if (YesNoQuestion("This query will take a while. Do you wish to continue?",
TRUE) == TRUE )
- if (status = do_sms_query("qualified_get_lists", 5, args,
+ if (status = do_mr_query("qualified_get_lists", 5, args,
Print, (char *) NULL) != 0)
com_err(program_name, status, " in ListAllGroups");
if (YesNoQuestion("This query will take a while. Do you wish to continue?",
TRUE) == TRUE )
- if (status = do_sms_query("qualified_get_lists", 5, args,
+ if (status = do_mr_query("qualified_get_lists", 5, args,
Print, (char *) NULL) != 0)
com_err(program_name, status, " in ListAllGroups");
#include <stdio.h>
#include <strings.h>
#include <sys/types.h>
-#include <sms.h>
+#include <moira.h>
#include <menu.h>
#include "mit-copyright.h"
char * whoami; /* used by menu.c ugh!!! */
char * moira_server;
-extern Menu sms_top_menu, list_menu, user_menu, dcm_menu;
+extern Menu moira_top_menu, list_menu, user_menu, dcm_menu;
#ifndef DEBUG
static void SignalHandler();
}
}
- if ( status = sms_connect(moira_server) )
+ if ( status = mr_connect(moira_server) )
ErrorExit("\nConnection to Moira server failed", status);
- if ( status = sms_motd(&motd) )
+ if ( status = mr_motd(&motd) )
ErrorExit("\nUnable to check server status", status);
if (motd) {
fprintf(stderr, "The Moira server is currently unavailable:\n%s\n", motd);
- sms_disconnect();
+ mr_disconnect();
exit(1);
}
- if ( status = sms_auth(program_name) ) {
- if (status == SMS_USER_AUTH) {
+ if ( status = mr_auth(program_name) ) {
+ if (status == MR_USER_AUTH) {
char buf[BUFSIZ];
com_err(program_name, status, "\nPress [RETURN] to continue");
gets(buf);
else if (!strcmp(program_name, "dcmmaint"))
menu = &dcm_menu;
else
- menu = &sms_top_menu;
+ menu = &moira_top_menu;
if (use_menu) { /* Start menus that execute program */
Start_paging();
else /* Start program without menus. */
Start_no_menu(menu);
- sms_disconnect();
+ mr_disconnect();
exit(0);
}
char * buf;
{
com_err(program_name, status, buf);
- sms_disconnect();
+ mr_disconnect();
exit(1);
}
Put_message("Signal caught - exiting");
if (use_menu)
Cleanup_menu();
- sms_disconnect();
+ mr_disconnect();
exit(1);
}
#endif DEBUG
static char rcsid_module_c[] = "$Header$";
#endif lint
-/* This is the file menus.c for the SMS Client, which allows a nieve
- * user to quickly and easily maintain most parts of the SMS database.
+/* This is the file menus.c for the MOIRA Client, which allows a nieve
+ * user to quickly and easily maintain most parts of the MOIRA database.
* It Contains: All menu definitions.
*
* Created: 4/11/88
/* ------------------------- Root Menu ------------------------- */
/*
- * Sms top menu
+ * Moira top menu
*/
-Menu sms_top_menu = {
+Menu moira_top_menu = {
NULLFUNC,
NULLFUNC,
"Moira Database Manipulation",
-/* This is the file misc.c for the SMS Client, which allows a naieve
- * user to quickly and easily maintain most parts of the SMS database.
+/* This is the file misc.c for the MOIRA Client, which allows a naieve
+ * user to quickly and easily maintain most parts of the MOIRA database.
* It Contains:
* TableStats
* ShowClients
#include <stdio.h>
#include <strings.h>
-#include <sms.h>
-#include <sms_app.h>
+#include <moira.h>
+#include <moira_site.h>
#include <menu.h>
#include <sys/types.h>
#include <netdb.h>
/* Function Name: TableStats
- * Description: display the SMS table statistics
+ * Description: display the MOIRA table statistics
* Arguments: NONE
* Returns: DM_NORMAL
*/
int status;
struct qelem *elem = NULL;
- if (status = do_sms_query("get_all_table_stats", 0, NULL,
+ if (status = do_mr_query("get_all_table_stats", 0, NULL,
StoreInfo, (char *)&elem)) {
com_err(program_name, status, " in TableStats");
return(DM_NORMAL);
/* Function Name: ShowClients
- * Description: show clients actively using SMS
+ * Description: show clients actively using MR
* Arguments: NONE
* Returns: DM_NORMAL
*/
int status;
struct qelem *elem = NULL;
- if (status = do_sms_query("_list_users", 0, NULL,
+ if (status = do_mr_query("_list_users", 0, NULL,
StoreInfo, (char *) &elem)) {
com_err(program_name, status, " in ShowClients");
return(DM_NORMAL);
/* Function Name: ShowValue
- * Description: get a variable value from SMS
+ * Description: get a variable value from MR
* Arguments: variable name
* Returns: DM_NORMAL
*/
int status;
struct qelem *elem = NULL;
- if (status = do_sms_query("get_value", 1, &argv[1],
+ if (status = do_mr_query("get_value", 1, &argv[1],
StoreInfo, (char *) &elem)) {
com_err(program_name, status, " in ShowValue");
return(DM_NORMAL);
info[0] = argv[1];
info[1] = argv[2];
info[2] = "*";
- if (status = do_sms_query("get_alias", 3, info,
+ if (status = do_mr_query("get_alias", 3, info,
StoreInfo, (char *) &elem)) {
com_err(program_name, status, " in ShowAlias");
return(DM_NORMAL);
static char rcsid_module_c[] = "$Header$";
#endif lint
-/* This is the file nfs.c for the SMS Client, which allows a nieve
- * user to quickly and easily maintain most parts of the SMS database.
+/* This is the file nfs.c for the MOIRA Client, which allows a nieve
+ * user to quickly and easily maintain most parts of the MOIRA database.
* It Contains: All functions for manipulating NFS Physical directories.
*
* Created: 5/6/88
#include <stdio.h>
#include <strings.h>
-#include <sms.h>
-#include <sms_app.h>
+#include <moira.h>
+#include <moira_site.h>
#include <menu.h>
#include "mit-copyright.h"
status_buf[0] = '\0'; /* clear string. */
- if (status & SMS_FS_STUDENT) {
+ if (status & MR_FS_STUDENT) {
strcat(status_buf, "Student");
is_one = TRUE;
}
- if (status & SMS_FS_FACULTY) {
+ if (status & MR_FS_FACULTY) {
if (is_one)
strcat(status_buf, " and ");
strcat(status_buf, "Faculty");
is_one = TRUE;
}
- if (status & SMS_FS_STAFF) {
+ if (status & MR_FS_STAFF) {
if (is_one)
strcat(status_buf, " and ");
strcat(status_buf, "Staff");
is_one = TRUE;
}
- if (status & SMS_FS_MISC) {
+ if (status & MR_FS_MISC) {
if (is_one)
strcat(status_buf, " and ");
strcat(status_buf, "Miscellaneous");
if ( (args[1] = GetDirName()) == NULL)
return(DM_NORMAL);
- if ( (stat = do_sms_query("get_nfsphys", 2, args,
- StoreInfo, (char *) &elem)) != SMS_SUCCESS)
+ if ( (stat = do_mr_query("get_nfsphys", 2, args,
+ StoreInfo, (char *) &elem)) != MR_SUCCESS)
com_err(program_name, stat, " in ShowNFSServices.");
free(args[0]);
free(args[1]); /* prevents memory leaks. */
if (!ValidName(args[0]) || !ValidName(args[1]))
return(DM_NORMAL);
- if ( (stat = do_sms_query("get_nfsphys", 2, args,
- NullFunc, (char *) NULL)) == SMS_SUCCESS)
+ if ( (stat = do_mr_query("get_nfsphys", 2, args,
+ NullFunc, (char *) NULL)) == MR_SUCCESS)
Put_message("This service already exists.");
- if (stat != SMS_NO_MATCH)
+ if (stat != MR_NO_MATCH)
com_err(program_name, stat, " in get_nfsphys.");
info[NFS_NAME] = Strsave(args[0]);
add_args = AskNFSInfo(info);
- if ((stat = do_sms_query("add_nfsphys", CountArgs(add_args), add_args,
+ if ((stat = do_mr_query("add_nfsphys", CountArgs(add_args), add_args,
Scream, (char *) NULL)) != 0)
com_err(program_name, stat, " in AdsNFSService");
register int stat;
args = AskNFSInfo(info);
- if ((stat = do_sms_query("update_nfsphys", CountArgs(args), args,
- Scream, (char *)NULL)) != SMS_SUCCESS)
+ if ((stat = do_mr_query("update_nfsphys", CountArgs(args), args,
+ Scream, (char *)NULL)) != MR_SUCCESS)
com_err(program_name, stat, (char *) NULL);
}
if ( (args[1] = GetDirName()) == NULL)
return(DM_NORMAL);
- if ( (stat = do_sms_query("get_nfsphys", 2, args,
- StoreInfo, (char *) &elem)) != SMS_SUCCESS) {
+ if ( (stat = do_mr_query("get_nfsphys", 2, args,
+ StoreInfo, (char *) &elem)) != MR_SUCCESS) {
com_err(program_name, stat, " in UpdateNFSService.");
return (DM_NORMAL);
}
args[0] = info[NFS_NAME];
args[1] = info[NFS_DIR];
args[2] = NULL;
- switch(stat = do_sms_query("get_filesys_by_nfsphys", CountArgs(args),
+ switch(stat = do_mr_query("get_filesys_by_nfsphys", CountArgs(args),
args, StoreInfo, (char *)&elem)) {
- case SMS_NO_MATCH: /* it is unused, delete it. */
- if ( (stat = do_sms_query("delete_nfsphys", 2, info, Scream,
- (char *) NULL )) != SMS_SUCCESS)
+ case MR_NO_MATCH: /* it is unused, delete it. */
+ if ( (stat = do_mr_query("delete_nfsphys", 2, info, Scream,
+ (char *) NULL )) != MR_SUCCESS)
com_err(program_name, stat, " in DeleteNFSService");
else
Put_message("Physical Filesystem Deleted.");
break;
- case SMS_SUCCESS: /* it is used, print filesys's that use it. */
+ case MR_SUCCESS: /* it is used, print filesys's that use it. */
elem = QueueTop(elem);
Put_message("The following fileystems are using this partition,");
Put_message("and must be removed before it can be deleted.");
if ( (args[1] = GetDirName()) == NULL)
return(DM_NORMAL);
- switch(stat = do_sms_query("get_nfsphys", 2, args,
+ switch(stat = do_mr_query("get_nfsphys", 2, args,
StoreInfo, (char *) &elem)) {
- case SMS_NO_MATCH:
+ case MR_NO_MATCH:
Put_message("This filsystem does not exist!");
return(DM_NORMAL);
- case SMS_SUCCESS:
+ case MR_SUCCESS:
break;
default:
com_err(program_name, stat, " in DeleteNFSService");
static char rcsid_module_c[] = "$Header$";
#endif lint
-/* This is the file pobox.c for the SMS Client, which allows a nieve
- * user to quickly and easily maintain most parts of the SMS database.
+/* This is the file pobox.c for the MOIRA Client, which allows a nieve
+ * user to quickly and easily maintain most parts of the MOIRA database.
* It Contains: Functions for handling the poboxes.
*
* Created: 7/10/88
#include <stdio.h>
#include <strings.h>
#include <ctype.h>
-#include <sms.h>
-#include <sms_app.h>
+#include <moira.h>
+#include <moira_site.h>
#include <menu.h>
#include "mit-copyright.h"
/* Function Name: PrintPOBox
* Description: Yet another specialized print function.
* Arguments: info - all info about this PO_box.
- * Returns: SMS_CONT
+ * Returns: MR_CONT
*/
static void
static char * args[] = {"pop", NULL};
struct qelem * top = NULL;
- if ( (status = do_sms_query("get_server_locations", CountArgs(args), args,
- StoreInfo, (char *)&top)) != SMS_SUCCESS) {
+ if ( (status = do_mr_query("get_server_locations", CountArgs(args), args,
+ StoreInfo, (char *)&top)) != MR_SUCCESS) {
com_err(program_name, status, " in get_server_locations.");
return(SUB_ERROR);
}
if (!ValidName(argv[1]))
return(DM_NORMAL);
- switch (status = do_sms_query("get_pobox", 1, argv + 1, StoreInfo,
+ switch (status = do_mr_query("get_pobox", 1, argv + 1, StoreInfo,
(char *)&top)) {
- case SMS_NO_MATCH:
+ case MR_NO_MATCH:
Put_message("This user has no P.O. Box.");
break;
- case SMS_SUCCESS:
+ case MR_SUCCESS:
sprintf(buf,"Current pobox for user %s: \n", argv[1]);
Put_message("");
top = QueueTop(top);
type = LOCAL_BOX;
switch (YesNoQuestion("Use Previous Local Box (y/n)", TRUE)) {
case TRUE:
- switch (status = do_sms_query("set_pobox_pop", 1,
+ switch (status = do_mr_query("set_pobox_pop", 1,
&local_user, Scream, NULL)) {
- case SMS_SUCCESS:
+ case MR_SUCCESS:
return(DM_NORMAL);
- case SMS_MACHINE:
+ case MR_MACHINE:
if ( (temp_box = GetNewLocalPOBox(local_user)) !=
(char *) SUB_ERROR) {
strcpy(box, temp_box);
args[PO_TYPE] = type;
args[PO_BOX] = box;
args[PO_END] = NULL;
- if ( (status = do_sms_query("set_pobox", CountArgs(args), args,
- Scream, NULL)) != SMS_SUCCESS )
+ if ( (status = do_mr_query("set_pobox", CountArgs(args), args,
+ Scream, NULL)) != MR_SUCCESS )
com_err(program_name, status, " in ChangeUserPOBox");
else
Put_message("PO Box assigned.");
"Are you sure that you want to remove %s's PO Box (y/n)", argv[1]);
if (Confirm(temp_buf)) {
- if ( (status = do_sms_query("delete_pobox", 1, argv + 1,
- Scream, NULL)) != SMS_SUCCESS)
+ if ( (status = do_mr_query("delete_pobox", 1, argv + 1,
+ Scream, NULL)) != MR_SUCCESS)
com_err(program_name, status, "in delete_pobox.");
else
Put_message("PO Box removed.");
static char rcsid_module_c[] = "$Header$";
#endif lint
-/* This is the file printer.c for the SMS Client, which allows a nieve
- * user to quickly and easily maintain most parts of the SMS database.
+/* This is the file printer.c for the MOIRA Client, which allows a nieve
+ * user to quickly and easily maintain most parts of the MOIRA database.
* It Contains: Functions for handling the printers.
*
* Created: 8/16/88
#include <stdio.h>
#include <strings.h>
#include <ctype.h>
-#include <sms.h>
-#include <sms_app.h>
+#include <moira.h>
+#include <moira_site.h>
#include <menu.h>
#include "mit-copyright.h"
int stat;
struct qelem *elem = NULL;
- if ( (stat = do_sms_query("get_printcap", 1, &name,
+ if ( (stat = do_mr_query("get_printcap", 1, &name,
StoreInfo, (char *)&elem)) != 0) {
com_err(program_name, stat, NULL);
return(NULL);
int stat;
char temp_buf[BUFSIZ];
- if ( (stat = do_sms_query("delete_printcap", 1,
+ if ( (stat = do_mr_query("delete_printcap", 1,
&info[PCAP_NAME], Scream, NULL)) != 0)
com_err(program_name, stat, " printcap entry not deleted.");
else
if ( !ValidName(argv[1]) )
return(DM_NORMAL);
- if ( (stat = do_sms_query("get_printcap", 1, argv + 1,
+ if ( (stat = do_mr_query("get_printcap", 1, argv + 1,
NullFunc, NULL)) == 0) {
Put_message ("A Printer by that name already exists.");
return(DM_NORMAL);
- } else if (stat != SMS_NO_MATCH) {
+ } else if (stat != MR_NO_MATCH) {
com_err(program_name, stat, " in AddPcap");
return(DM_NORMAL);
}
args = AskPcapInfo(SetDefaults(info, argv[1]));
- if ( (stat = do_sms_query("add_printcap", CountArgs(args), args,
+ if ( (stat = do_mr_query("add_printcap", CountArgs(args), args,
NullFunc, NULL)) != 0)
com_err(program_name, stat, " in AddPcap");
{
int stat;
- if ((stat = do_sms_query("delete_printcap", 1, &info[PCAP_NAME],
+ if ((stat = do_mr_query("delete_printcap", 1, &info[PCAP_NAME],
Scream, NULL)) != 0) {
com_err(program_name, stat, " printcap entry not deleted.");
return(DM_NORMAL);
}
AskPcapInfo(info);
- if ((stat = do_sms_query("add_printcap", CountArgs(info), info,
+ if ((stat = do_mr_query("add_printcap", CountArgs(info), info,
NullFunc, NULL)) != 0)
com_err(program_name, stat, " in ChngPcap");
return(DM_NORMAL);
int status;
struct qelem *elem = NULL;
- if ((status = do_sms_query("get_palladium", 1, &name, StoreInfo, &elem))
+ if ((status = do_mr_query("get_palladium", 1, &name, StoreInfo, &elem))
!= 0) {
com_err(program_name, status, NULL);
return(NULL);
{
int status;
- if ((status = do_sms_query("delete_palladium", 1, &info[PD_NAME],
+ if ((status = do_mr_query("delete_palladium", 1, &info[PD_NAME],
Scream, NULL)) != 0) {
com_err(program_name, status, " palladium entry not deleted.");
return(DM_NORMAL);
}
AskPalladiumInfo(info);
- if ((status = do_sms_query("add_palladium", CountArgs(info), info,
+ if ((status = do_mr_query("add_palladium", CountArgs(info), info,
NullFunc, NULL)) != 0)
com_err(program_name, status, " in ChngPalladium");
return(DM_NORMAL);
int stat;
char temp_buf[BUFSIZ];
- if ( (stat = do_sms_query("delete_palladium", 1,
+ if ( (stat = do_mr_query("delete_palladium", 1,
&info[PD_NAME], Scream, NULL)) != 0)
com_err(program_name, stat, " palladium entry not deleted.");
else
if (!ValidName(argv[1]))
return(DM_NORMAL);
- if ((status = do_sms_query("get_palladium", 1, &argv[1], NullFunc, NULL))
+ if ((status = do_mr_query("get_palladium", 1, &argv[1], NullFunc, NULL))
== 0) {
Put_message("A server or supervisor by that name already exists.");
return(DM_NORMAL);
- } else if (status != SMS_NO_MATCH) {
+ } else if (status != MR_NO_MATCH) {
com_err(program_name, status, " in AddPalladium");
return(DM_NORMAL);
}
args = AskPalladiumInfo(SetPdDefaults(info, argv[1]));
- if ((status = do_sms_query("add_palladium", CountArgs(args), args,
+ if ((status = do_mr_query("add_palladium", CountArgs(args), args,
Scream, NULL)) != 0)
com_err(program_name, status, " in AddPalladium");
qargv[0] = argv[1];
qargv[1] = "PALLADIUM";
qargv[2] = argv[2];
- if ((status = do_sms_query("get_alias", 3, qargv, StoreInfo, &elem)) != 0) {
+ if ((status = do_mr_query("get_alias", 3, qargv, StoreInfo, &elem)) != 0) {
com_err(program_name, status, " in ShowPalladiumAlias");
return(DM_NORMAL);
}
qargv[0] = argv[1];
qargv[1] = "PALLADIUM";
qargv[2] = argv[2];
- if ((status = do_sms_query("add_alias", 3, qargv, Scream, NULL)) != 0)
+ if ((status = do_mr_query("add_alias", 3, qargv, Scream, NULL)) != 0)
com_err(program_name, status, " in AddPalladiumAlias");
return(DM_NORMAL);
}
qargv[0] = argv[1];
qargv[1] = "PALLADIUM";
qargv[2] = argv[2];
- if ((status = do_sms_query("delete_alias", 3, qargv, Scream, NULL)) != 0)
+ if ((status = do_mr_query("delete_alias", 3, qargv, Scream, NULL)) != 0)
com_err(program_name, status, " in DeletePalladiumAlias");
return(DM_NORMAL);
}
static char rcsid_module_c[] = "$Header$";
#endif lint
-/* This is the file quota.c for the SMS Client, which allows a nieve
- * user to quickly and easily maintain most parts of the SMS database.
+/* This is the file quota.c for the MOIRA Client, which allows a nieve
+ * user to quickly and easily maintain most parts of the MOIRA database.
* It Contains: Functions for manipulating the quota information.
*
* Created: 7/10/88
#include <stdio.h>
#include <strings.h>
-#include <sms.h>
-#include <sms_app.h>
+#include <moira.h>
+#include <moira_site.h>
#include <menu.h>
#include "mit-copyright.h"
static char * def_quota = NULL;
#define DEFAULT_FILESYS DEFAULT_NONE
-#define DEFAULT_USER user /* this is the user who started sms. */
+#define DEFAULT_USER user /* this is the user who started moira. */
#define NOBODY "\\[nobody\\]"
#define OLDNOBODY "[nobody]"
/* Function Name: GetDefaultUserQuota
- * Description: gets the user quota from sms, and caches the value.
- * Arguments: override - if true, go to sms and override the cache.
+ * Description: gets the user quota from moira, and caches the value.
+ * Arguments: override - if true, go to moira and override the cache.
* Returns: none.
* NOTE: Using a queue here is pretty useless, but StoreInfo expects
* one, and it works, so why fuck with it.
static char *val[] = {"def_quota", NULL};
if (override || (def_quota == NULL)) {
- if ( (status = do_sms_query("get_value", CountArgs(val), val,
- StoreInfo, (char *) &top)) != SMS_SUCCESS) {
+ if ( (status = do_mr_query("get_value", CountArgs(val), val,
+ StoreInfo, (char *) &top)) != MR_SUCCESS) {
com_err(program_name, status, " in ShowDefaultQuota");
if (def_quota == NULL) {
Put_message("No default Quota Found, setting default to 0.");
if (index(name, '*') || index(name, '?') || index(name, '\\'))
return(0);
argv[0] = name;
- status = do_sms_query("get_filesys_by_label", 1, argv,
+ status = do_mr_query("get_filesys_by_label", 1, argv,
afsfilsyshelper, &ret);
- if (status == SMS_SUCCESS)
+ if (status == MR_SUCCESS)
return(ret);
return(0);
"change the default quota for all new users");
if(Confirm(temp_buf)) {
newval[1] = argv[1];
- if ( (status = do_sms_query("update_value", CountArgs(newval),
- newval, Scream, NULL)) == SMS_SUCCESS ) {
+ if ( (status = do_mr_query("update_value", CountArgs(newval),
+ newval, Scream, NULL)) == MR_SUCCESS ) {
FreeAndClear(&def_quota, TRUE);
def_quota = Strsave(argv[1]);
}
if ( (args = GetQuotaArgs(FALSE) ) == NULL)
return(DM_NORMAL);
- if ( (status = do_sms_query("get_nfs_quota", CountArgs(args), args,
- StoreInfo, (char *) &top)) != SMS_SUCCESS)
+ if ( (status = do_mr_query("get_nfs_quota", CountArgs(args), args,
+ StoreInfo, (char *) &top)) != MR_SUCCESS)
com_err(program_name, status, " in get_nfs_quota");
FreeInfo(args); /* done with args free them. */
if ( (args = GetQuotaArgs(TRUE) ) == NULL)
return(DM_NORMAL);
- if ( (status = do_sms_query("add_nfs_quota", CountArgs(args), args,
- Scream, (char *) NULL)) != SMS_SUCCESS)
+ if ( (status = do_mr_query("add_nfs_quota", CountArgs(args), args,
+ Scream, (char *) NULL)) != MR_SUCCESS)
com_err(program_name, status, " in get_nfs_quota");
FreeInfo(args);
info[Q_LOGIN] = strsave(NOBODY);
}
- if (status = do_sms_query("update_nfs_quota", 3, info,
- Scream, (char *) NULL) != SMS_SUCCESS) {
+ if (status = do_mr_query("update_nfs_quota", 3, info,
+ Scream, (char *) NULL) != MR_SUCCESS) {
com_err(program_name, status, " in update_nfs_quota");
sprintf(temp_buf,"Could not perform quota change on %s",
info[Q_FILESYS]);
if ( (args = GetQuotaArgs(FALSE) ) == NULL)
return(DM_NORMAL);
- if ( (status = do_sms_query("get_nfs_quota", 2, args,
- StoreInfo, (char *) &top)) != SMS_SUCCESS)
+ if ( (status = do_mr_query("get_nfs_quota", 2, args,
+ StoreInfo, (char *) &top)) != MR_SUCCESS)
com_err(program_name, status, " in get_nfs_quota");
FreeInfo(args); /* done with args, free them. */
info[Q_LOGIN], info[Q_FILESYS]);
if (!one_item || Confirm(temp_buf)) {
- if ( (status = do_sms_query("delete_nfs_quota", 2, info,
- Scream, (char *) NULL)) != SMS_SUCCESS)
+ if ( (status = do_mr_query("delete_nfs_quota", 2, info,
+ Scream, (char *) NULL)) != MR_SUCCESS)
com_err(program_name, status, " in delete_nfs_quota");
else
Put_message("Quota sucessfully removed.");
if ( (args = GetQuotaArgs(FALSE) ) == NULL)
return(DM_NORMAL);
- if ( (status = do_sms_query("get_nfs_quota", 2, args,
- StoreInfo, (char *) &top)) != SMS_SUCCESS)
+ if ( (status = do_mr_query("get_nfs_quota", 2, args,
+ StoreInfo, (char *) &top)) != MR_SUCCESS)
com_err(program_name, status, " in get_nfs_quota");
FreeInfo(args);
static char rcsid_module_c[] = "$Header$";
#endif lint
-/* This is the file user.c for the SMS Client, which allows a nieve
- * user to quickly and easily maintain most parts of the SMS database.
+/* This is the file user.c for the MOIRA Client, which allows a nieve
+ * user to quickly and easily maintain most parts of the MOIRA database.
* It Contains: Functions for manipulating user information.
*
* Created: 5/9/88
#include <stdio.h>
#include <strings.h>
-#include <sms.h>
-#include <sms_app.h>
+#include <moira.h>
+#include <moira_site.h>
#include <menu.h>
#include <ctype.h>
GetValueFromUser("User's middle name", &info[U_MIDDLE]);
argv[0] = info[U_FIRST];
argv[1] = info[U_LAST];
- if (do_sms_query("get_user_by_name", 2, argv,
+ if (do_mr_query("get_user_by_name", 2, argv,
StoreInfo, (char *) &elem) == 0) {
Put_message("A user by that name already exists in the database.");
Loop(QueueTop(elem), PrintUserInfo);
switch(type) {
case LOGIN:
args[0] = name1;
- if ( (status = do_sms_query("get_user_by_login", 1, args,
+ if ( (status = do_mr_query("get_user_by_login", 1, args,
StoreInfo, (char *) &elem)) != 0) {
com_err(program_name, status,
" when attempting to get_user_by_login.");
break;
case UID:
args[0] = name1;
- if ( (status = do_sms_query("get_user_by_uid", 1, args,
+ if ( (status = do_mr_query("get_user_by_uid", 1, args,
StoreInfo, (char *) &elem)) != 0) {
com_err(program_name, status,
" when attempting to get_user_by_uid.");
case BY_NAME:
args[0] = name1;
args[1] = name2;
- if ( (status = do_sms_query("get_user_by_name", 2, args,
+ if ( (status = do_mr_query("get_user_by_name", 2, args,
StoreInfo, (char *) &elem)) != 0) {
com_err(program_name, status,
" when attempting to get_user_by_name.");
break;
case CLASS:
args[0] = name1;
- if ( (status = do_sms_query("get_user_by_class", 1, args,
+ if ( (status = do_mr_query("get_user_by_class", 1, args,
StoreInfo, (char *) &elem)) != 0) {
com_err(program_name, status,
" when attempting to get_user_by_class.");
args = AskUserInfo(SetUserDefaults(info), FALSE);
if (args == NULL)
return(DM_NORMAL);
- if ( (status = do_sms_query("add_user", CountArgs(args),
- args, Scream, (char *) NULL)) != SMS_SUCCESS)
+ if ( (status = do_mr_query("add_user", CountArgs(args),
+ args, Scream, (char *) NULL)) != MR_SUCCESS)
com_err(program_name, status, " in add_user");
else
Put_message("New user added to database.");
args[0] = first;
args[1] = last;
- switch (status = do_sms_query("get_user_by_name", 2, args,
+ switch (status = do_mr_query("get_user_by_name", 2, args,
StoreInfo, (char *) &top)) {
- case SMS_SUCCESS:
+ case MR_SUCCESS:
break;
- case SMS_NO_MATCH:
+ case MR_NO_MATCH:
Put_message("There is no user in the database with that name.");
return(NULL);
default:
args[2] = fstype;
args[3] = NULL;
- switch (status = do_sms_query("register_user", CountArgs(args),
+ switch (status = do_mr_query("register_user", CountArgs(args),
args, Scream, (char *) NULL)) {
- case SMS_SUCCESS:
+ case MR_SUCCESS:
sprintf(temp_buf, "User %s successfully registered.", login);
Put_message(temp_buf);
SetUserPassword(login);
break;
- case SMS_IN_USE:
+ case MR_IN_USE:
GiveBackLogin(login);
sprintf(temp_buf, "The username %s is already in use.", login);
Put_message(temp_buf);
char error_buf[BUFSIZ];
char ** args = AskUserInfo(info, TRUE);
- if ( (status = do_sms_query("update_user", CountArgs(args),
- args, Scream, (char *) NULL)) != SMS_SUCCESS) {
+ if ( (status = do_mr_query("update_user", CountArgs(args),
+ args, Scream, (char *) NULL)) != MR_SUCCESS) {
com_err(program_name, status, " in ModifyFields");
sprintf(error_buf, "User %s not updated due to errors.", info[NAME]);
Put_message(error_buf);
qargs[0] = info[NAME];
qargs[1] = "3";
- if ((status = do_sms_query("update_user_status", 2, qargs, Scream,
- (char *) NULL)) != SMS_SUCCESS) {
+ if ((status = do_mr_query("update_user_status", 2, qargs, Scream,
+ (char *) NULL)) != MR_SUCCESS) {
com_err(program_name, status, " in update_user_status");
sprintf(txt_buf, "User %s not deactivated due to errors.", info[NAME]);
Put_message(txt_buf);
* Description: Deletes the user given a uid number.
* Arguments: argc, argv - uid if user in argv[1].
* Returns: DM_NORMAL.
- * NOTES: This just gets the username from the sms server
+ * NOTES: This just gets the username from the mr server
* and performs a DeleteUser().
*/
if(!ValidName(argv[1]))
return(DM_NORMAL);
- if ( (status = do_sms_query("get_user_by_uid", 1, argv+1, StoreInfo,
- (char * ) &elem)) != SMS_SUCCESS)
+ if ( (status = do_mr_query("get_user_by_uid", 1, argv+1, StoreInfo,
+ (char * ) &elem)) != MR_SUCCESS)
com_err(program_name, status, " in get_user_by_uid");
info = (char **) elem->q_data;
struct qelem *elem = NULL, *top;
char buf[BUFSIZ];
- if ((stat = do_sms_query("get_kerberos_user_map", 2, &argv[1],
+ if ((stat = do_mr_query("get_kerberos_user_map", 2, &argv[1],
StoreInfo, (char *)&elem)) != 0) {
com_err(program_name, stat, " in GetKrbMap.");
return(DM_NORMAL);
Put_message("Please specify a realm for the kerberos principal.");
return(DM_NORMAL);
}
- if ((stat = do_sms_query("add_kerberos_user_map", 2, &argv[1],
+ if ((stat = do_mr_query("add_kerberos_user_map", 2, &argv[1],
Scream, NULL)) != 0) {
com_err(program_name, stat, " in AddKrbMap.");
- if (stat == SMS_EXISTS)
+ if (stat == MR_EXISTS)
Put_message("No user or principal may have more than one mapping.");
}
return(DM_NORMAL);
{
int stat;
- if ((stat = do_sms_query("delete_kerberos_user_map", 2, &argv[1],
+ if ((stat = do_mr_query("delete_kerberos_user_map", 2, &argv[1],
Scream, NULL)) != 0) {
com_err(program_name, stat, " in DeleteKrbMap.");
}
static char rcsid_module_c[] = "$Header$";
#endif lint
-/* This is the file utils.c for the SMS Client, which allows a nieve
- * user to quickly and easily maintain most parts of the SMS database.
+/* This is the file utils.c for the MOIRA Client, which allows a nieve
+ * user to quickly and easily maintain most parts of the MOIRA database.
* It Contains: Many useful utility functions.
*
* Created: 4/25/88
#include <stdio.h>
#include <strings.h>
-#include <sms.h>
-#include <sms_app.h>
+#include <moira.h>
+#include <moira_site.h>
#include <menu.h>
#include <ctype.h>
}
/* Function Name: StoreInfo
- * Description: Stores information from an sms query into a queue.
+ * Description: Stores information from an moira query into a queue.
* Arguments: argc, argv, - information returned from the query returned
* in argv.
* data - the previous element on the queue, this data will be
* If NULL then a new queue will be created. This value
* is updated to the current element at the end off the
* call.
- * Returns: SMS_CONT, or SMS_ABORT if it has problems.
+ * Returns: MR_CONT, or MR_ABORT if it has problems.
*/
int
Put_message("Could Not allocate more memory.");
FreeQueue(*old_elem);
*old_elem = (struct qelem *) NULL;
- return(SMS_ABORT);
+ return(MR_ABORT);
}
for (count = 0; count < argc; count++)
AddQueue(new_elem, *old_elem);
*old_elem = new_elem;
- return(SMS_CONT);
+ return(MR_CONT);
}
/* Function Name: CountArgs
{
com_err(program_name, 0,
"\nA Moira update returned a value -- programmer botch\n");
- sms_disconnect();
+ mr_disconnect();
exit(1);
}
/* Function Name: NullFunc
* Description: dummy callback routine
* Arguments: none
- * Returns: SMS_CONT
+ * Returns: MR_CONT
*/
int
NullFunc()
{
- return(SMS_CONT);
+ return(MR_CONT);
}
/* Function Name: SlipInNewName
else
c_value = atoi(*current);
- if (GetFSVal("student", SMS_FS_STUDENT, c_value, &new_val) == FALSE)
+ if (GetFSVal("student", MR_FS_STUDENT, c_value, &new_val) == FALSE)
return(SUB_ERROR);
- if (GetFSVal("faculty", SMS_FS_FACULTY, c_value, &new_val) == FALSE)
+ if (GetFSVal("faculty", MR_FS_FACULTY, c_value, &new_val) == FALSE)
return(SUB_ERROR);
- if (GetFSVal("staff", SMS_FS_STAFF, c_value, &new_val) == FALSE)
+ if (GetFSVal("staff", MR_FS_STAFF, c_value, &new_val) == FALSE)
return(SUB_ERROR);
- if (GetFSVal("miscellaneous", SMS_FS_MISC, c_value, &new_val) == FALSE)
+ if (GetFSVal("miscellaneous", MR_FS_MISC, c_value, &new_val) == FALSE)
return(SUB_ERROR);
FreeAndClear(current, TRUE);
/* Function Name: Print
* Description: prints out all the arguments on a single line.
- * Arguments: argc, argv - the standard SMS arguments.
+ * Arguments: argc, argv - the standard MR arguments.
* callback - the callback function - NOT USED.
- * Returns: SMS_CONT
+ * Returns: MR_CONT
*/
/* ARGSUSED */
(void) sprintf(buf,"%s %s",buf,argv[i]);
(void) Put_message(buf);
- return (SMS_CONT);
+ return (MR_CONT);
}
/* Function Name: PrintByType
* Description: This function prints all members of the type specified
* by the callback arg, unless the callback is NULL, in which
* case it prints all members.
- * Arguments: argc, argc - normal arguments for sms_callback function.
+ * Arguments: argc, argc - normal arguments for mr_callback function.
* callback - either a type of member or NULL.
- * Returns: SMS_CONT or SMS_QUIT.
+ * Returns: MR_CONT or MR_QUIT.
*/
/*ARGSUSED*/
return( Print(argc, argv, callback) );
if (strcmp(argv[0], callback) == 0)
return( Print(argc, argv, callback) );
- return(SMS_CONT);
+ return(MR_CONT);
}
/* Function Name: PrintHelp
argv[1] = "TYPE";
argv[2] = "*";
elem = NULL;
- if (stat = do_sms_query("get_alias", 3, argv, StoreInfo, (char *)&elem)) {
+ if (stat = do_mr_query("get_alias", 3, argv, StoreInfo, (char *)&elem)) {
com_err(program_name, stat, " in GetTypeValues");
return(NULL);
}
for (p = argv[2]; *p; p++)
if (islower(*p))
*p = toupper(*p);
- if (stat = do_sms_query("add_alias", 3, argv, Scream, NULL)) {
+ if (stat = do_mr_query("add_alias", 3, argv, Scream, NULL)) {
com_err(program_name, stat, " in add_alias");
} else {
elem = (struct qelem *) malloc(sizeof(struct qelem));
}
-do_sms_query(name, argc, argv, proc, hint)
+do_mr_query(name, argc, argv, proc, hint)
char *name;
int argc;
char **argv;
int status;
extern char *whoami, *moira_server;
- status = sms_query(name, argc, argv, proc, hint);
- if (status != SMS_ABORTED && status != SMS_NOT_CONNECTED)
+ status = mr_query(name, argc, argv, proc, hint);
+ if (status != MR_ABORTED && status != MR_NOT_CONNECTED)
return(status);
- status = sms_connect(moira_server);
+ status = mr_connect(moira_server);
if (status) {
com_err(whoami, status, " while re-connecting to server %s",
moira_server);
- return(SMS_ABORTED);
+ return(MR_ABORTED);
}
- status = sms_auth(whoami);
+ status = mr_auth(whoami);
if (status) {
com_err(whoami, status, " while re-authenticating to server %s",
moira_server);
- sms_disconnect();
- return(SMS_ABORTED);
+ mr_disconnect();
+ return(MR_ABORTED);
}
- status = sms_query(name, argc, argv, proc, hint);
+ status = mr_query(name, argc, argv, proc, hint);
return(status);
}
# <mit-copyright.h>.
-LIBS = ../rpc/libsms.a ../gdb/libgdb.a
+LIBS = ../rpc/libmoira.a ../gdb/libgdb.a
LLIBS= -L../lib -lhesiod -lkrb -ldes -lhesiod -lss -lcom_err -lm -lc
SRCS= test.c
# DO NOT DELETE THIS LINE -- mkdep uses it.
test.o: test.c ../include/mit-copyright.h /usr/include/stdio.h
-test.o: /usr/include/sys/file.h /usr/include/ctype.h ../include/sms.h
-test.o: ../include/sms_et.h ../include/ss.h
+test.o: /usr/include/sys/file.h /usr/include/ctype.h ../include/moira.h
+test.o: ../include/mr_et.h ../include/ss.h
#include <stdio.h>
#include <sys/file.h>
#include <ctype.h>
-#include <sms.h>
+#include <moira.h>
#include <ss.h>
int ss;
test_noop()
{
- int status = sms_noop();
+ int status = mr_noop();
if (status) ss_perror(ss, status, "");
}
test_new()
{
- sending_version_no = SMS_VERSION_2;
+ sending_version_no = MR_VERSION_2;
}
test_old()
{
- sending_version_no = SMS_VERSION_1;
+ sending_version_no = MR_VERSION_1;
}
test_connect(argc, argv)
if (argc > 1) {
server = argv[1];
}
- status = sms_connect(server);
+ status = mr_connect(server);
if (status) ss_perror(ss, status, "");
}
test_disconnect()
{
- int status = sms_disconnect();
+ int status = mr_disconnect();
if (status) ss_perror(ss, status, "");
}
bzero(host, sizeof(host));
- if (status = sms_host(host, sizeof(host) - 1))
+ if (status = mr_host(host, sizeof(host) - 1))
ss_perror(ss, status, "");
else
printf("You are connected to host %s\n", host);
{
int status;
- status = sms_auth("mrtest");
+ status = mr_auth("mrtest");
if (status) ss_perror(ss, status, "");
}
}
printf("\n");
count++;
- return(SMS_CONT);
+ return(MR_CONT);
}
test_query(argc, argv)
}
count = 0;
- status = sms_query(argv[1], argc-2, argv+2, print_reply, (char *)NULL);
+ status = mr_query(argv[1], argc-2, argv+2, print_reply, (char *)NULL);
printf("%d tuple%s\n", count, ((count == 1) ? "" : "s"));
if (status) ss_perror(ss, status, "");
}
ss_perror(ss, 0, "Usage: access handle [ args ... ]");
return;
}
- status = sms_access(argv[1], argc-2, argv+2);
+ status = mr_access(argv[1], argc-2, argv+2);
if (status) ss_perror(ss, status, "");
}
{
int status;
- if (status = sms_do_update())
+ if (status = mr_do_update())
ss_perror(ss, status, " while triggering dcm");
}
int status;
char *motd;
- if (status = sms_motd(&motd))
+ if (status = mr_motd(&motd))
ss_perror(ss, status, " while getting motd");
if (motd)
printf("%s\n", motd);
-# Makefile for SMS clients passwd/chfn/chpobox/chsh
+# Makefile for MOIRA clients passwd/chfn/chpobox/chsh
#
# MIT Project Athena
#
CONFDIR = ${DESTDIR}/usr/athena
BINDIR = ${DESTDIR}/bin
-SMSLIB = -L../../lib -lsms -lgdb -lcom_err -lkrb -ldes -lhesiod
+MOIRALIB = -L../../lib -lmoira -lgdb -lcom_err -lkrb -ldes -lhesiod
PROGS= chfn chsh chpobox
all: ${PROGS}
chfn: chfn.o
- cc -o chfn chfn.o ${SMSLIB}
+ cc -o chfn chfn.o ${MOIRALIB}
chpobox: chpobox.o
- cc -o chpobox chpobox.o ${SMSLIB}
+ cc -o chpobox chpobox.o ${MOIRALIB}
chsh: chsh.o
- cc -o chsh chsh.o ${SMSLIB}
+ cc -o chsh chsh.o ${MOIRALIB}
lint:
lint *.c
chfn.o: chfn.c /usr/include/sys/types.h /usr/include/stdio.h
chfn.o: /usr/include/strings.h /usr/include/sys/file.h ../../include/krb.h
chfn.o: ../../include/mit-copyright.h ../../include/des.h
-chfn.o: /usr/include/ctype.h /usr/include/errno.h ../../include/sms.h
-chfn.o: /usr/include/sms_et.h ../../include/sms_app.h
+chfn.o: /usr/include/ctype.h /usr/include/errno.h ../../include/moira.h
+chfn.o: ../../include/mr_et.h ../../include/moira_site.h
chpobox.o: chpobox.c /usr/include/sys/types.h /usr/include/stdio.h
chpobox.o: /usr/include/pwd.h /usr/include/strings.h /usr/include/ctype.h
-chpobox.o: /usr/include/errno.h ../../include/sms.h /usr/include/sms_et.h
-chpobox.o: ../../include/sms_app.h ../../include/mit-copyright.h
+chpobox.o: /usr/include/errno.h ../../include/moira.h ../../include/mr_et.h
+chpobox.o: ../../include/moira_site.h ../../include/mit-copyright.h
chsh.o: chsh.c /usr/include/sys/types.h /usr/include/stdio.h
chsh.o: /usr/include/strings.h /usr/include/sys/file.h ../../include/krb.h
chsh.o: ../../include/mit-copyright.h ../../include/des.h
-chsh.o: /usr/include/ctype.h /usr/include/errno.h ../../include/sms.h
-chsh.o: /usr/include/sms_et.h ../../include/sms_app.h
+chsh.o: /usr/include/ctype.h /usr/include/errno.h ../../include/moira.h
+chsh.o: ../../include/mr_et.h ../../include/moira_site.h
#endif not lint
/*
- * Talk to the SMS database to change a person's GECOS information.
+ * Talk to the MOIRA database to change a person's GECOS information.
*
* chfn with no modifiers changes the information of the user who is
* running the program.
#include <ctype.h>
#include <errno.h>
-/* SMS includes */
-#include <sms.h>
-#include <sms_app.h>
+/* MOIRA includes */
+#include <moira.h>
+#include <moira_site.h>
#include "mit-copyright.h"
char *whoami;
leave(status)
int status;
- /* This should be called rather than exit once connection to sms server
+ /* This should be called rather than exit once connection to moira server
has been established. */
{
- sms_disconnect();
+ mr_disconnect();
exit(status);
}
char *uname;
{
int status; /* general purpose exit status */
- int q_argc; /* argc for sms_query */
- char *q_argv[F_END]; /* argv for sms_query */
- char *motd; /* for SMS server status */
+ int q_argc; /* argc for mr_query */
+ char *q_argv[F_END]; /* argv for mr_query */
+ char *motd; /* for MR server status */
int i;
int get_user_info();
/* Try each query. If we ever fail, print error message and exit. */
- status = sms_connect(NULL);
+ status = mr_connect(NULL);
if (status) {
com_err(whoami, status, " while connecting to Moira");
exit(1);
}
- status = sms_motd(&motd);
+ status = mr_motd(&motd);
if (status) {
com_err(whoami, status, " unable to check server status");
leave(1);
leave(1);
}
- status = sms_auth("chfn"); /* Don't use argv[0] - too easy to fake */
+ status = mr_auth("chfn"); /* Don't use argv[0] - too easy to fake */
if (status) {
com_err(whoami, status,
" while authenticating -- run \"kinit\" and try again.");
q_argv[i] = "junk";
q_argc = F_MODTIME; /* one more than the last updatable field */
- if (status = sms_access("update_finger_by_login", q_argc, q_argv)) {
+ if (status = mr_access("update_finger_by_login", q_argc, q_argv)) {
com_err(whoami, status, "; finger\ninformation not changed.");
leave(2);
}
q_argv[NAME] = uname;
q_argc = NAME + 1;
- if (status = sms_query("get_finger_by_login", q_argc, q_argv,
+ if (status = mr_query("get_finger_by_login", q_argc, q_argv,
get_user_info, (char *) &old_info))
{
com_err(whoami, status, " while getting user information.");
q_argv[F_MIT_AFFIL] = new_info.mit_year;
q_argc = F_MODTIME; /* First non-update query argument */
- if (status = sms_query("update_finger_by_login", q_argc, q_argv,
+ if (status = mr_query("update_finger_by_login", q_argc, q_argv,
scream, (char *)NULL))
{
com_err(whoami, status, " while updating finger information.");
/* Only pay attention to the first match since login names are
unique in the database. */
- return(SMS_ABORT);
+ return(MR_ABORT);
}
char *ask(question, def_val, phone_num)
#endif not lint
/*
- * Talk to the SMS database to change a person's home mail machine. This may
+ * Talk to the MOIRA database to change a person's home mail machine. This may
* be an Athena machine, or a completely arbitrary address.
*
* chpobox with no modifiers reports the current mailbox.
#include <ctype.h>
#include <errno.h>
-/* SMS includes */
-#include <sms.h>
-#include <sms_app.h>
+/* MOIRA includes */
+#include <moira.h>
+#include <moira_site.h>
#include "mit-copyright.h"
char *getlogin();
char *argv[];
{
struct passwd *pwd;
- char *smsarg[3], buf[BUFSIZ];
+ char *mrarg[3], buf[BUFSIZ];
char *potype(), *index();
char *address, *uname, *machine, *motd;
uid_t u;
(void) strcpy(uname, pwd->pw_name);
}
}
- smsarg[0] = uname;
+ mrarg[0] = uname;
- status = sms_connect(NULL);
+ status = mr_connect(NULL);
if (status) {
com_err(whoami, status, " while connecting to Moira");
exit(1);
}
- status = sms_motd(&motd);
+ status = mr_motd(&motd);
if (status) {
- sms_disconnect();
+ mr_disconnect();
com_err(whoami, status, " unable to check server status");
exit(1);
}
if (motd) {
fprintf(stderr, "The Moira server is currently unavailable:\n%s\n", motd);
- sms_disconnect();
+ mr_disconnect();
exit(1);
}
- status = sms_auth("chpobox");
+ status = mr_auth("chpobox");
if (status) {
com_err(whoami, status, " while authenticating -- run \"kinit\" and try again.");
- sms_disconnect();
+ mr_disconnect();
exit(1);
}
whoami, address);
goto show;
}
- smsarg[2] = canonicalize_hostname(strsave(machine));
- smsarg[1] = potype(smsarg[2]);
- if (!strcmp(smsarg[1], "POP")) {
+ mrarg[2] = canonicalize_hostname(strsave(machine));
+ mrarg[1] = potype(mrarg[2]);
+ if (!strcmp(mrarg[1], "POP")) {
if (strcmp(address, uname)) {
fprintf(stderr,
"%s: the name on the POP box must match the username\n",
whoami);
goto show;
}
- } else if (!strcmp(smsarg[1], "LOCAL")) {
+ } else if (!strcmp(mrarg[1], "LOCAL")) {
strcat(address, "@");
- strcat(address, smsarg[2]);
- smsarg[2] = address;
+ strcat(address, mrarg[2]);
+ mrarg[2] = address;
if ((address = index(address, '@')) &&
(address = index(address, '.')))
*address = 0;
- strcat(smsarg[2], ".LOCAL");
- smsarg[1] = "SMTP";
- } else if (smsarg[1]) {
- if (*machine != '"' && strcasecmp(smsarg[2], machine))
+ strcat(mrarg[2], ".LOCAL");
+ mrarg[1] = "SMTP";
+ } else if (mrarg[1]) {
+ if (*machine != '"' && strcasecmp(mrarg[2], machine))
printf("Warning: hostname %s canonicalized to %s\n",
- machine, smsarg[2]);
+ machine, mrarg[2]);
strcat(address, "@");
- strcat(address, smsarg[2]);
- smsarg[2] = address;
+ strcat(address, mrarg[2]);
+ mrarg[2] = address;
} else
goto show;
- status = sms_query("set_pobox", 3, smsarg, scream, NULL);
+ status = mr_query("set_pobox", 3, mrarg, scream, NULL);
if (status)
com_err(whoami, status,
" while setting pobox for %s to type %s, box %s",
- smsarg[0], smsarg[1], smsarg[2]);
+ mrarg[0], mrarg[1], mrarg[2]);
} else if (prevpop) {
- status = sms_query("set_pobox_pop", 1, smsarg, scream, NULL);
- if (status == SMS_MACHINE) {
+ status = mr_query("set_pobox_pop", 1, mrarg, scream, NULL);
+ if (status == MR_MACHINE) {
fprintf(stderr,
"Moira has no record of a previous POP box for %s\n", uname);
} else if (status != 0)
* get current box
*/
show:
- status = sms_query("get_pobox", 1, smsarg, get_pobox, NULL);
- if (status == SMS_NO_MATCH)
+ status = mr_query("get_pobox", 1, mrarg, get_pobox, NULL);
+ if (status == MR_NO_MATCH)
printf("User %s has no pobox.\n", uname);
else if (status != 0)
com_err(whoami, status, " while retrieving current mailbox");
- sms_disconnect();
+ mr_disconnect();
exit(0);
}
scream()
{
com_err(whoami, 0, "Unexpected return value from Moira -- programmer botch");
- sms_disconnect();
+ mr_disconnect();
exit(1);
}
}
/*
- * given a canonicalized machine name, ask the SMS server if it is of type
+ * given a canonicalized machine name, ask the MR server if it is of type
* pop, or of type local -- if neither, we assume that it's of type foreign.
*/
char *
match = 0;
service[0] = "POP";
- status = sms_query("get_server_locations", 1, service,
+ status = mr_query("get_server_locations", 1, service,
check_match, machine);
- if (status && (status != SMS_NO_MATCH)) {
+ if (status && (status != MR_NO_MATCH)) {
com_err(whoami, status, " while reading list of POP servers");
return(NULL);
}
return ("POP");
service[0] = "LOCAL";
- status = sms_query("get_server_locations", 1, service,
+ status = mr_query("get_server_locations", 1, service,
check_match, machine);
- if (status && (status != SMS_NO_MATCH)) {
+ if (status && (status != MR_NO_MATCH)) {
com_err(whoami, status, " while reading list of LOCAL servers");
return(NULL);
}
#endif not lint
/*
- * Talk to the SMS database to change a person's login shell. The chosen
+ * Talk to the MOIRA database to change a person's login shell. The chosen
* shell must exist. A warning will be issued if the shell is not in
* /etc/shells.
*
#include <ctype.h>
#include <errno.h>
-/* SMS includes */
-#include <sms.h>
-#include <sms_app.h>
+/* MOIRA includes */
+#include <moira.h>
+#include <moira_site.h>
#include "mit-copyright.h"
char *whoami;
leave(status)
int status;
- /* This should be called rather than exit once connection to sms server
+ /* This should be called rather than exit once connection to moira server
has been established. */
{
- sms_disconnect();
+ mr_disconnect();
exit(status);
}
char *uname;
{
int status; /* general purpose exit status */
- int q_argc; /* argc for sms_query */
- char *q_argv[U_END]; /* argv for sms_query */
- char *motd; /* determine SMS server status */
+ int q_argc; /* argc for mr_query */
+ char *q_argv[U_END]; /* argv for mr_query */
+ char *motd; /* determine MR server status */
int got_one = 0; /* have we got a new shell yet? */
char shell[BUFSIZ]; /* the new shell */
/* Try each query. If we ever fail, print error message and exit. */
- status = sms_connect(NULL);
+ status = mr_connect(NULL);
if (status) {
com_err(whoami, status, " while connecting to Moira");
exit(1);
}
- status = sms_motd(&motd);
+ status = mr_motd(&motd);
if (status) {
com_err(whoami, status, " unable to check server status");
leave(1);
leave(1);
}
- status = sms_auth("chsh"); /* Don't use argv[0] - too easy to fake */
+ status = mr_auth("chsh"); /* Don't use argv[0] - too easy to fake */
if (status) {
com_err(whoami, status,
" while authenticating -- run \"kinit\" and try again.");
q_argv[USH_SHELL] = "junk";
q_argc = USH_END;
- if (status = sms_access("update_user_shell", q_argc, q_argv))
+ if (status = mr_access("update_user_shell", q_argc, q_argv))
{
com_err(whoami, status, "; shell not\nchanged.");
leave(2);
q_argv[NAME] = uname;
q_argc = NAME + 1;
- if ((status = sms_query("get_user_by_login", q_argc, q_argv,
+ if ((status = mr_query("get_user_by_login", q_argc, q_argv,
get_shell, (char *) uname)))
{
com_err(whoami, status, " while getting user information.");
q_argv[USH_NAME] = uname;
q_argv[USH_SHELL] = shell;
q_argc = USH_END;
- if (status = sms_query("update_user_shell", q_argc, q_argv,
+ if (status = mr_query("update_user_shell", q_argc, q_argv,
scream, (char *) NULL))
{
com_err(whoami, status, " while changing shell.");
}
printf("Shell successfully changed.\n");
- sms_disconnect();
+ mr_disconnect();
return(0);
}
printf("by user %s with %s.\n", argv[U_MODBY], argv[U_MODWITH]);
printf("Current shell for %s is %s.\n", uname, argv[U_SHELL]);
- return(SMS_ABORT); /* Don't pay attention to other matches. */
+ return(MR_ABORT); /* Don't pay attention to other matches. */
}
void check_shell(shell)
userreg: userreg.o display.o reg_stubs.o disable.o
cc ${CFLAGS} -o $@ userreg.o display.o reg_stubs.o disable.o \
- -L../../lib -lcom_err -lkrb -ldes -lsms -lcurses \
+ -L../../lib -lcom_err -lkrb -ldes -lmoira -lcurses \
-ltermcap -lhesiod
userreg.o display.o: userreg.h files.h
reg_stubs.o: /usr/include/sys/types.h /usr/include/sys/time.h
reg_stubs.o: /usr/include/sys/time.h /usr/include/sys/socket.h
reg_stubs.o: /usr/include/netinet/in.h /usr/include/netdb.h
-reg_stubs.o: ../../include/des.h /usr/include/errno.h ../../include/sms.h
-reg_stubs.o: ../../include/sms_et.h ../../include/sms_app.h
+reg_stubs.o: ../../include/des.h /usr/include/errno.h ../../include/moira.h
+reg_stubs.o: ../../include/mr_et.h ../../include/moira_site.h
reg_stubs.o: ../../include/ureg_err.h ../../include/ureg_proto.h
reg_stubs.o: /usr/include/strings.h
disable.o: disable.c ../../include/mit-copyright.h /usr/include/stdio.h
#include <netdb.h>
#include <des.h>
#include <errno.h>
-#include <sms.h>
-#include <sms_app.h>
+#include <moira.h>
+#include <moira_site.h>
#include "ureg_err.h"
#include "ureg_proto.h"
#include <strings.h>
}
#endif HESIOD
if (!host || (strlen(host) == 0)) {
- host = strsave(SMS_SERVER);
+ host = strsave(MOIRA_SERVER);
s = index(host, ':');
if (s) *s = 0;
}
# $Header$
# $Author$
#
-# (c) Copyright 1988 by the Massachusetts Institute of Technology.
+# (c) Copyright 1988, 1990 by the Massachusetts Institute of Technology.
# For copying and distribution information, please see the file
# <mit-copyright.h>.
DESTDIR=
-FILES= sms.h sms_app.h sms_et.h
+FILES= moira.h moira_site.h mr_et.h
all:
install: ${FILES}
- install -c -m 644 sms.h ${DESTDIR}/usr/include/sms.h
- install -c -m 644 sms_app.h ${DESTDIR}/usr/include/sms_app.h
- install -c -m 644 sms_et.h ${DESTDIR}/usr/include/sms_et.h
+ install -c -m 644 moira.h ${DESTDIR}/usr/include/moira.h
+ install -c -m 644 moira_site.h ${DESTDIR}/usr/include/moira_site.h
+ install -c -m 644 mr_et.h ${DESTDIR}/usr/include/mr_et.h
depend:
/* return values from queries (and error codes) */
-#include "sms_et.h"
+#include "mr_et.h"
#define MR_SUCCESS 0 /* Query was successful */
#define MR_VERSION_1 1 /* Version in use from 7/87 to 4/88 */
#define MR_VERSION_2 2 /* After 4/88, new query lib */
-/* return values for sms server calls, used by clients */
+/* return values for Moira server calls, used by clients */
#define MR_CONT 0 /* Everything okay, continue sending values. */
#define MR_ABORT -1 /* Something went wrong don't send anymore
* see the file mit-copyright.h
*/
-#ifndef _sms_app_
-#define _sms_app_
+#ifndef _moira_site_
+#define _moira_site_
#include "mit-copyright.h"
/* Default Moira server to connect to */
-#define SMS_SERVER "SMS.MIT.EDU:sms_db"
+#define MOIRA_SERVER "MOIRA.MIT.EDU:sms_db"
/* Compile-time options: */
/* used hesiod looking up Moira server name */
#define JOURNAL "/u1/sms/journal"
#define REGJOURNAL "/u1/sms/journal.reg"
#define NODCMFILE "/etc/nodcm" /* flag to inhibit DCM running */
-#define SMS_MOTD_FILE "/etc/smsdown" /* make the server go to sleep */
+#define MOIRA_MOTD_FILE "/etc/smsdown" /* make the server go to sleep */
-#endif _sms_app_ /* Do not add anything after this line. */
+#endif _moira_site_ /* Do not add anything after this line. */
# $Author$
# $Header$
#
-# Makefile for SMS library.
+# Makefile for Moira library.
#
-LIBSRC=sms_auth.c sms_call.c sms_connect.c sms_data.c sms_init.c \
- sms_query.c sms_param.c sms_access.c sms_ops.c \
+LIBSRC=mr_auth.c mr_call.c mr_connect.c mr_data.c mr_init.c \
+ mr_query.c mr_param.c mr_access.c mr_ops.c \
fixname.c strs.c fixhost.c nfsparttype.c sq.c hash.c \
idno.c critical.c
CFILES=${LIBSRC}
-LIBOBJ=sms_auth.o sms_call.o sms_connect.o sms_data.o sms_init.o \
- sms_query.o sms_param.o sms_access.o sms_ops.o \
+LIBOBJ=mr_auth.o mr_call.o mr_connect.o mr_data.o mr_init.o \
+ mr_query.o mr_param.o mr_access.o mr_ops.o \
fixname.o strs.o fixhost.o nfsparttype.o sq.o hash.o \
- idno.o critical.o sms_et.o ureg_err.o krb_et.o
+ idno.o critical.o mr_et.o ureg_err.o krb_et.o
COPTS= -O
CFLAGS= ${INCDIRS} ${COPTS}
LINTFLAGS= -uhv
-ALL=libsms.a llib-lsms.ln # libsms_p.a
+ALL=libmoira.a llib-lmoira.ln # libmoira_p.a
.c.o:
${CC} -c -pg ${CFLAGS} $*.c
all: ${ALL}
-libsms.a: ${LIBOBJ}
+libmoira.a: ${LIBOBJ}
ar cruv $@ `lorder ${LIBOBJ} | tsort`
ranlib $@
- (cd profiled; ar cruv ../libsms_p.a ${LIBOBJ}; ranlib ../libsms_p.a)
+ (cd profiled; ar cruv ../libmoira_p.a ${LIBOBJ}; ranlib ../libmoira_p.a)
-smslib.dvi: smslib.tex
- latex smslib.tex
+mrlib.dvi: mrlib.tex
+ latex mrlib.tex
krb_et.c krb_et.h: krb_et.et ../et/compile_et
../et/compile_et krb_et.et
-sms_et.c sms_et.h: sms_et.et ../et/compile_et
- ../et/compile_et sms_et.et
+mr_et.c mr_et.h: mr_et.et ../et/compile_et
+ ../et/compile_et mr_et.et
ureg_err.c ureg_err.h: ureg_err.et ../et/compile_et
../et/compile_et ureg_err.et
../et/compile_et:
cd ../et; make compile_et
-../include/sms_et.h: sms_et.h
+../include/mr_et.h: mr_et.h
clean:
rm -f ${ALL}
- rm -f *.o *~ sms_et.h krb_et.h ureg_err.h profiled/*.o \#*
- rm -f krb_et.c sms_et.c ureg_err.c
+ rm -f *.o *~ mr_et.h krb_et.h ureg_err.h profiled/*.o \#*
+ rm -f krb_et.c mr_et.c ureg_err.c
rm -f *.PS *.aux *.dvi *.log
rm -f *.bak
install:
- install -c -m 644 libsms.a ${DESTDIR}/usr/athena/lib/libsms.a
- ranlib ${DESTDIR}/usr/athena/lib/libsms.a
- install -c -m 644 libsms_p.a ${DESTDIR}/usr/athena/lib/libsms_p.a
- ranlib ${DESTDIR}/usr/athena/lib/libsms_p.a
- install -c -m 644 llib-lsms.ln ${DESTDIR}/usr/lib/lint/llib-lsms.ln
+ install -c -m 644 libmoira.a ${DESTDIR}/usr/athena/lib/libmoira.a
+ ranlib ${DESTDIR}/usr/athena/lib/libmoira.a
+ install -c -m 644 libmoira_p.a ${DESTDIR}/usr/athena/lib/libmoira_p.a
+ ranlib ${DESTDIR}/usr/athena/lib/libmoira_p.a
+ install -c -m 644 llib-lmoira.ln ${DESTDIR}/usr/lib/lint/llib-lmoira.ln
TAGS: $(CFILES)
-etags $(CFILES)
-lint: ${CFILES} llib-lsms.ln
- lint ${LINTFLAGS} ${INCDIRS} sms_main.c llib-lsms.ln
+lint: ${CFILES} llib-lmoira.ln
+ lint ${LINTFLAGS} ${INCDIRS} mr_main.c llib-lmoira.ln
-llib-lsms.ln: ${LIBSRC}
- lint -Csms $(LINTFLAGS) $(INCDIRS) ${LIBSRC}
+llib-lmoira.ln: ${LIBSRC}
+ lint -Cmr $(LINTFLAGS) $(INCDIRS) ${LIBSRC}
-depend: $(CFILES) sms_et.h ureg_err.h krb_et.h
+depend: $(CFILES) mr_et.h ureg_err.h krb_et.h
mkdep ${CFLAGS} ${CFILES}
# DO NOT DELETE THIS LINE -- mkdep uses it.
-sms_auth.o: sms_auth.c ../include/mit-copyright.h sms_private.h
-sms_auth.o: ../include/sms_proto.h /usr/include/stdio.h ../include/gdb.h
-sms_auth.o: /usr/include/sys/types.h /usr/include/sys/time.h
-sms_auth.o: /usr/include/sys/time.h ../include/sms.h sms_et.h
-sms_auth.o: ../include/krb.h ../include/des.h krb_et.h
-sms_call.o: sms_call.c ../include/mit-copyright.h sms_private.h
-sms_call.o: ../include/sms_proto.h /usr/include/stdio.h ../include/gdb.h
-sms_call.o: /usr/include/sys/types.h /usr/include/sys/time.h
-sms_call.o: /usr/include/sys/time.h ../include/sms.h sms_et.h
-sms_connect.o: sms_connect.c ../include/mit-copyright.h sms_private.h
-sms_connect.o: ../include/sms_proto.h /usr/include/stdio.h ../include/gdb.h
-sms_connect.o: /usr/include/sys/types.h /usr/include/sys/time.h
-sms_connect.o: /usr/include/sys/time.h ../include/sms.h sms_et.h
-sms_connect.o: ../include/sms_app.h /usr/include/strings.h
-sms_data.o: sms_data.c ../include/mit-copyright.h sms_private.h
-sms_data.o: ../include/sms_proto.h /usr/include/stdio.h ../include/gdb.h
-sms_data.o: /usr/include/sys/types.h /usr/include/sys/time.h
-sms_data.o: /usr/include/sys/time.h ../include/sms.h sms_et.h
-sms_init.o: sms_init.c ../include/mit-copyright.h sms_private.h
-sms_init.o: ../include/sms_proto.h /usr/include/stdio.h ../include/gdb.h
-sms_init.o: /usr/include/sys/types.h /usr/include/sys/time.h
-sms_init.o: /usr/include/sys/time.h ../include/sms.h sms_et.h
-sms_query.o: sms_query.c ../include/mit-copyright.h sms_private.h
-sms_query.o: ../include/sms_proto.h /usr/include/stdio.h ../include/gdb.h
-sms_query.o: /usr/include/sys/types.h /usr/include/sys/time.h
-sms_query.o: /usr/include/sys/time.h ../include/sms.h sms_et.h
-sms_param.o: sms_param.c ../include/mit-copyright.h /usr/include/sys/types.h
-sms_param.o: /usr/include/netinet/in.h sms_private.h ../include/sms_proto.h
-sms_param.o: /usr/include/stdio.h ../include/gdb.h /usr/include/sys/time.h
-sms_param.o: /usr/include/sys/time.h ../include/sms.h sms_et.h
-sms_access.o: sms_access.c ../include/mit-copyright.h sms_private.h
-sms_access.o: ../include/sms_proto.h /usr/include/stdio.h ../include/gdb.h
-sms_access.o: /usr/include/sys/types.h /usr/include/sys/time.h
-sms_access.o: /usr/include/sys/time.h ../include/sms.h sms_et.h
-sms_ops.o: sms_ops.c ../include/mit-copyright.h sms_private.h
-sms_ops.o: ../include/sms_proto.h /usr/include/stdio.h ../include/gdb.h
-sms_ops.o: /usr/include/sys/types.h /usr/include/sys/time.h
-sms_ops.o: /usr/include/sys/time.h ../include/sms.h sms_et.h
+mr_auth.o: mr_auth.c ../include/mit-copyright.h mr_private.h
+mr_auth.o: ../include/mr_proto.h /usr/include/stdio.h ../include/gdb.h
+mr_auth.o: /usr/include/sys/types.h /usr/include/sys/time.h
+mr_auth.o: /usr/include/sys/time.h ../include/moira.h mr_et.h
+mr_auth.o: /usr/include/ctype.h ../include/krb.h ../include/des.h krb_et.h
+mr_call.o: mr_call.c ../include/mit-copyright.h mr_private.h
+mr_call.o: ../include/mr_proto.h /usr/include/stdio.h ../include/gdb.h
+mr_call.o: /usr/include/sys/types.h /usr/include/sys/time.h
+mr_call.o: /usr/include/sys/time.h ../include/moira.h mr_et.h
+mr_connect.o: mr_connect.c ../include/mit-copyright.h mr_private.h
+mr_connect.o: ../include/mr_proto.h /usr/include/stdio.h ../include/gdb.h
+mr_connect.o: /usr/include/sys/types.h /usr/include/sys/time.h
+mr_connect.o: /usr/include/sys/time.h ../include/moira.h mr_et.h
+mr_connect.o: ../include/moira_site.h /usr/include/strings.h
+mr_data.o: mr_data.c ../include/mit-copyright.h mr_private.h
+mr_data.o: ../include/mr_proto.h /usr/include/stdio.h ../include/gdb.h
+mr_data.o: /usr/include/sys/types.h /usr/include/sys/time.h
+mr_data.o: /usr/include/sys/time.h ../include/moira.h mr_et.h
+mr_init.o: mr_init.c ../include/mit-copyright.h mr_private.h
+mr_init.o: ../include/mr_proto.h /usr/include/stdio.h ../include/gdb.h
+mr_init.o: /usr/include/sys/types.h /usr/include/sys/time.h
+mr_init.o: /usr/include/sys/time.h ../include/moira.h mr_et.h
+mr_query.o: mr_query.c ../include/mit-copyright.h mr_private.h
+mr_query.o: ../include/mr_proto.h /usr/include/stdio.h ../include/gdb.h
+mr_query.o: /usr/include/sys/types.h /usr/include/sys/time.h
+mr_query.o: /usr/include/sys/time.h ../include/moira.h mr_et.h
+mr_param.o: mr_param.c ../include/mit-copyright.h /usr/include/sys/types.h
+mr_param.o: /usr/include/netinet/in.h mr_private.h ../include/mr_proto.h
+mr_param.o: /usr/include/stdio.h ../include/gdb.h /usr/include/sys/time.h
+mr_param.o: /usr/include/sys/time.h ../include/moira.h mr_et.h
+mr_access.o: mr_access.c ../include/mit-copyright.h mr_private.h
+mr_access.o: ../include/mr_proto.h /usr/include/stdio.h ../include/gdb.h
+mr_access.o: /usr/include/sys/types.h /usr/include/sys/time.h
+mr_access.o: /usr/include/sys/time.h ../include/moira.h mr_et.h
+mr_ops.o: mr_ops.c ../include/mit-copyright.h mr_private.h
+mr_ops.o: ../include/mr_proto.h /usr/include/stdio.h ../include/gdb.h
+mr_ops.o: /usr/include/sys/types.h /usr/include/sys/time.h
+mr_ops.o: /usr/include/sys/time.h ../include/moira.h mr_et.h
fixname.o: fixname.c ../include/mit-copyright.h /usr/include/strings.h
fixname.o: /usr/include/ctype.h
strs.o: strs.c ../include/mit-copyright.h /usr/include/sys/types.h
fixhost.o: /usr/include/arpa/nameser.h /usr/include/arpa/resolv.h
fixhost.o: /usr/include/netdb.h /usr/include/stdio.h /usr/include/strings.h
fixhost.o: /usr/include/ctype.h
-nfsparttype.o: nfsparttype.c ../include/mit-copyright.h ../include/sms.h
-nfsparttype.o: sms_et.h /usr/include/stdio.h /usr/include/strings.h
+nfsparttype.o: nfsparttype.c ../include/mit-copyright.h ../include/moira.h
+nfsparttype.o: mr_et.h /usr/include/stdio.h /usr/include/strings.h
nfsparttype.o: /usr/include/ctype.h
-sq.o: sq.c ../include/mit-copyright.h ../include/sms.h sms_et.h
+sq.o: sq.c ../include/mit-copyright.h ../include/moira.h mr_et.h
hash.o: hash.c ../include/mit-copyright.h /usr/include/ctype.h
-hash.o: ../include/sms.h sms_et.h
+hash.o: ../include/moira.h mr_et.h
idno.o: idno.c ../include/mit-copyright.h /usr/include/strings.h
idno.o: /usr/include/ctype.h
critical.o: critical.c ../include/mit-copyright.h /usr/include/stdio.h
-critical.o: /usr/include/sys/file.h /usr/include/zephyr/zephyr.h
-critical.o: /usr/include/zephyr/mit-copyright.h
+critical.o: /usr/include/sys/file.h ../include/moira_site.h
+critical.o: /usr/include/zephyr/zephyr.h /usr/include/zephyr/mit-copyright.h
critical.o: /usr/include/zephyr/zephyr_err.h
critical.o: /usr/include/zephyr/zephyr_conf.h /usr/include/errno.h
critical.o: /usr/include/sys/types.h /usr/include/netinet/in.h
critical.o: /usr/include/sys/time.h /usr/include/sys/time.h ../include/krb.h
-critical.o: ../include/des.h ../include/sms_app.h
+critical.o: ../include/des.h
#include <mit-copyright.h>
#include <stdio.h>
#include <sys/file.h>
-#include <sms_app.h>
+#include <moira_site.h>
#ifdef ZEPHYR
#include <zephyr/zephyr.h>
#endif
extern char *whoami;
-/* This routine sends a class SMS zephyrgram of specified instance
+/* This routine sends a class MOIRA zephyrgram of specified instance
* and logs to a special logfile the message passed to it via msg
* and args in printf format. *** It expects the global variable
* whoami to be defined and contain the name of the calling program.
-/* Sends a zephyrgram of class "SMS", instance as a parameter. Ignores
+/* Sends a zephyrgram of class "MOIRA", instance as a parameter. Ignores
* errors while sending message.
*/
bzero (&znotice, sizeof (znotice));
znotice.z_kind = UNSAFE;
- znotice.z_class = "SMS";
+ znotice.z_class = "MOIRA";
znotice.z_class_inst = inst;
- znotice.z_default_format = "SMS $instance:\n $message\n";
+ znotice.z_default_format = "MOIRA $instance:\n $message\n";
(void) ZInitialize ();
znotice.z_message = msg;
znotice.z_message_len = strlen(msg) + 1;
#ifdef SYSLOG
{
char buf[512];
- sprintf(buf, "SMS: %s %s", inst, msg);
+ sprintf(buf, "MOIRA: %s %s", inst, msg);
syslog(LOG_ERR, buf);
}
#endif
#include <mit-copyright.h>
#include <ctype.h>
-#include <sms.h>
+#include <moira.h>
#define NULL 0
#define hash_func(h, key) (key >= 0 ? (key % h->size) : (-key % h->size))
* $Author$
* $Header$
*
- * Copyright (C) 1987 by the Massachusetts Institute of Technology
+ * Copyright (C) 1987, 1990 by the Massachusetts Institute of Technology
* For copying and distribution information, please see the file
* <mit-copyright.h>.
*/
#endif lint
#include <mit-copyright.h>
-#include "sms_private.h"
+#include "mr_private.h"
/*
* Check access to a named query.
*/
-int sms_access(name, argc, argv)
+int mr_access(name, argc, argv)
char *name; /* Query name */
int argc; /* Arg count */
char **argv; /* Args */
register int status = 0;
nargv[0] = name;
bcopy((char *)argv, (char *)(nargv+1), sizeof(char *) * argc);
- status = sms_access_internal(argc+1, nargv);
+ status = mr_access_internal(argc+1, nargv);
free(nargv);
return status;
}
* Check access to a named query, where the query name is argv[0]
* and the arguments are the rest of argv[].
*/
-int sms_access_internal(argc, argv)
+int mr_access_internal(argc, argv)
int argc; /* Arg count */
char **argv; /* Args */
{
int status;
- sms_params params_st;
- register sms_params *params = NULL;
- sms_params *reply = NULL;
+ mr_params params_st;
+ register mr_params *params = NULL;
+ mr_params *reply = NULL;
CHECK_CONNECTED;
params = ¶ms_st;
- params->sms_version_no = sending_version_no;
- params->sms_procno = SMS_ACCESS;
- params->sms_argc = argc;
- params->sms_argl = NULL;
- params->sms_argv = argv;
+ params->mr_version_no = sending_version_no;
+ params->mr_procno = MR_ACCESS;
+ params->mr_argc = argc;
+ params->mr_argl = NULL;
+ params->mr_argv = argv;
- if ((status = sms_do_call(params, &reply)) == 0)
- status = reply->sms_status;
+ if ((status = mr_do_call(params, &reply)) == 0)
+ status = reply->mr_status;
- sms_destroy_reply(reply);
+ mr_destroy_reply(reply);
return status;
}
-
-/*
- * Local Variables:
- * mode: c
- * c-indent-level: 4
- * c-continued-statement-offset: 4
- * c-brace-offset: -4
- * c-argdecl-indent: 4
- * c-label-offset: -4
- * End:
- */
* $Author$
* $Header$
*
- * Copyright (C) 1987 by the Massachusetts Institute of Technology
+ * Copyright (C) 1987, 1990 by the Massachusetts Institute of Technology
* For copying and distribution information, please see the file
* <mit-copyright.h>.
*
* Handles the client side of the sending of authenticators to
- * the sms server.
+ * the mr server.
*/
#ifndef lint
#endif lint
#include <mit-copyright.h>
-#include "sms_private.h"
+#include "mr_private.h"
#include <ctype.h>
#include <krb.h>
#include <krb_et.h>
-/* Authenticate this client with the SMS server. prog is the name of the
+/* Authenticate this client with the MR server. prog is the name of the
* client program, and will be recorded in the database.
*/
-int sms_auth(prog)
+int mr_auth(prog)
char *prog;
{
register int status;
- sms_params params_st;
+ mr_params params_st;
char *args[2];
int argl[2];
char realm[REALM_SZ], host[BUFSIZ], *p;
- register sms_params *params = ¶ms_st;
- sms_params *reply = NULL;
+ register mr_params *params = ¶ms_st;
+ mr_params *reply = NULL;
KTEXT_ST auth;
CHECK_CONNECTED;
/* Build a Kerberos authenticator. */
bzero(host, sizeof(host));
- if (status = sms_host(host, sizeof(host) - 1))
+ if (status = mr_host(host, sizeof(host) - 1))
return status;
strcpy(realm, krb_realmofhost(host));
status += ERROR_TABLE_BASE_krb;
return status;
}
- params->sms_version_no = sending_version_no;
- params->sms_procno = SMS_AUTH;
- params->sms_argc = 2;
- params->sms_argv = args;
- params->sms_argl = argl;
- params->sms_argv[0] = (char *)auth.dat;
- params->sms_argl[0] = auth.length;
- params->sms_argv[1] = prog;
- params->sms_argl[1] = strlen(prog) + 1;
+ params->mr_version_no = sending_version_no;
+ params->mr_procno = MR_AUTH;
+ params->mr_argc = 2;
+ params->mr_argv = args;
+ params->mr_argl = argl;
+ params->mr_argv[0] = (char *)auth.dat;
+ params->mr_argl[0] = auth.length;
+ params->mr_argv[1] = prog;
+ params->mr_argl[1] = strlen(prog) + 1;
- if (sending_version_no == SMS_VERSION_1)
- params->sms_argc = 1;
+ if (sending_version_no == MR_VERSION_1)
+ params->mr_argc = 1;
- if ((status = sms_do_call(params, &reply)) == 0)
- status = reply->sms_status;
+ if ((status = mr_do_call(params, &reply)) == 0)
+ status = reply->mr_status;
- sms_destroy_reply(reply);
+ mr_destroy_reply(reply);
return status;
}
#endif lint
#include <mit-copyright.h>
-#include "sms_private.h"
+#include "mr_private.h"
-sms_do_call(params, reply)
- struct sms_params *params;
- struct sms_params **reply;
+mr_do_call(params, reply)
+ struct mr_params *params;
+ struct mr_params **reply;
{
CHECK_CONNECTED;
- if (!_sms_send_op)
- _sms_send_op = create_operation();
+ if (!_mr_send_op)
+ _mr_send_op = create_operation();
- if (!_sms_recv_op)
- _sms_recv_op = create_operation();
+ if (!_mr_recv_op)
+ _mr_recv_op = create_operation();
- initialize_operation(_sms_send_op, sms_start_send, (char *)params,
+ initialize_operation(_mr_send_op, mr_start_send, (char *)params,
(int (*)())NULL);
- queue_operation(_sms_conn, CON_OUTPUT, _sms_send_op);
+ queue_operation(_mr_conn, CON_OUTPUT, _mr_send_op);
- initialize_operation(_sms_recv_op, sms_start_recv, (char *)reply,
+ initialize_operation(_mr_recv_op, mr_start_recv, (char *)reply,
(int (*)())NULL);
- queue_operation(_sms_conn, CON_INPUT, _sms_recv_op);
+ queue_operation(_mr_conn, CON_INPUT, _mr_recv_op);
/* Block until operation done. */
- sms_complete_operation(_sms_send_op);
- sms_complete_operation(_sms_recv_op);
+ mr_complete_operation(_mr_send_op);
+ mr_complete_operation(_mr_recv_op);
/* Look at results */
- if ((OP_STATUS(_sms_send_op) != OP_COMPLETE) ||
- (OP_STATUS(_sms_recv_op) != OP_COMPLETE)) {
- sms_disconnect();
- return SMS_ABORTED;
+ if ((OP_STATUS(_mr_send_op) != OP_COMPLETE) ||
+ (OP_STATUS(_mr_recv_op) != OP_COMPLETE)) {
+ mr_disconnect();
+ return MR_ABORTED;
}
return 0;
}
* $Author$
* $Header$
*
- * Copyright (C) 1987 by the Massachusetts Institute of Technology
+ * Copyright (C) 1987, 1990 by the Massachusetts Institute of Technology
* For copying and distribution information, please see the file
* <mit-copyright.h>.
*
* This routine is part of the client library. It handles
- * creating a connection to the sms server.
+ * creating a connection to the mr server.
*/
#ifndef lint
#endif lint
#include <mit-copyright.h>
-#include "sms_private.h"
-#include <sms_app.h>
+#include "mr_private.h"
+#include <moira_site.h>
#include <strings.h>
-static char *sms_server_host = 0;
+static char *mr_server_host = 0;
/*
- * Open a connection to the sms server. Looks for the server name
+ * Open a connection to the mr server. Looks for the server name
* 1) passed as an argument, 2) in environment variable, 3) by hesiod
* 4) compiled in default (from sms_app.h).
*/
-int sms_connect(server)
+int mr_connect(server)
char *server;
{
extern int errno;
char *p, **pp, sbuf[256];
extern char *getenv(), **hes_resolve();
- if (!sms_inited) sms_init();
- if (_sms_conn) return SMS_ALREADY_CONNECTED;
+ if (!mr_inited) mr_init();
+ if (_mr_conn) return MR_ALREADY_CONNECTED;
if (!server || (strlen(server) == 0)) {
server = getenv("MOIRASERVER");
#endif HESIOD
if (!server || (strlen(server) == 0)) {
- server = SMS_SERVER;
+ server = MOIRA_SERVER;
}
if (!index(server, ':')) {
- p = index(SMS_SERVER, ':');
+ p = index(MOIRA_SERVER, ':');
p++;
sprintf(sbuf, "%s:%s", server, p);
server = sbuf;
}
errno = 0;
- _sms_conn = start_server_connection(server, "");
- if (_sms_conn == NULL)
+ _mr_conn = start_server_connection(server, "");
+ if (_mr_conn == NULL)
return errno;
- if (connection_status(_sms_conn) == CON_STOPPED) {
- register status = connection_errno(_sms_conn);
- if (!status) status = SMS_CANT_CONNECT;
- sms_disconnect();
+ if (connection_status(_mr_conn) == CON_STOPPED) {
+ register status = connection_errno(_mr_conn);
+ if (!status) status = MR_CANT_CONNECT;
+ mr_disconnect();
return status;
}
* stash hostname for later use
*/
- sms_server_host = strsave(server);
- if (p = index(sms_server_host, ':'))
+ mr_server_host = strsave(server);
+ if (p = index(mr_server_host, ':'))
*p = 0;
- sms_server_host = canonicalize_hostname(sms_server_host);
+ mr_server_host = canonicalize_hostname(mr_server_host);
return 0;
}
-int sms_disconnect()
+int mr_disconnect()
{
CHECK_CONNECTED;
- _sms_conn = sever_connection(_sms_conn);
- free(sms_server_host);
- sms_server_host = 0;
+ _mr_conn = sever_connection(_mr_conn);
+ free(mr_server_host);
+ mr_server_host = 0;
return 0;
}
-int sms_host(host, size)
+int mr_host(host, size)
char *host;
int size;
{
CHECK_CONNECTED;
- /* If we are connected, sms_server_host points to a valid string. */
- strncpy(host, sms_server_host, size);
+ /* If we are connected, mr_server_host points to a valid string. */
+ strncpy(host, mr_server_host, size);
return(0);
}
-int sms_noop()
+int mr_noop()
{
int status;
- sms_params param_st;
- struct sms_params *params = NULL;
- struct sms_params *reply = NULL;
+ mr_params param_st;
+ struct mr_params *params = NULL;
+ struct mr_params *reply = NULL;
CHECK_CONNECTED;
params = ¶m_st;
- params->sms_version_no = sending_version_no;
- params->sms_procno = SMS_NOOP;
- params->sms_argc = 0;
- params->sms_argl = NULL;
- params->sms_argv = NULL;
+ params->mr_version_no = sending_version_no;
+ params->mr_procno = MR_NOOP;
+ params->mr_argc = 0;
+ params->mr_argl = NULL;
+ params->mr_argv = NULL;
- if ((status = sms_do_call(params, &reply)) == 0)
- status = reply->sms_status;
+ if ((status = mr_do_call(params, &reply)) == 0)
+ status = reply->mr_status;
- sms_destroy_reply(reply);
+ mr_destroy_reply(reply);
return status;
}
#endif lint
#include <mit-copyright.h>
-#include "sms_private.h"
+#include "mr_private.h"
-CONNECTION _sms_conn;
+CONNECTION _mr_conn;
-OPERATION _sms_send_op, _sms_recv_op;
+OPERATION _mr_send_op, _mr_recv_op;
-int sending_version_no = SMS_VERSION_2;
+int sending_version_no = MR_VERSION_2;
* $Author$
* $Header$
*
- * Copyright (C) 1987 by the Massachusetts Institute of Technology
+ * Copyright (C) 1987, 1990 by the Massachusetts Institute of Technology
* For copying and distribution information, please see the file
* <mit-copyright.h>.
*/
#endif lint
#include <mit-copyright.h>
-#include "sms_private.h"
+#include "mr_private.h"
-int sms_inited = 0;
+int mr_inited = 0;
/* the reference to link_against_the_moira_version_of_gdb is to make
* sure that this is built with the proper libraries.
*/
-sms_init()
+mr_init()
{
extern int link_against_the_moira_version_of_gdb;
- if (sms_inited) return;
+ if (mr_inited) return;
gdb_init();
initialize_sms_error_table();
initialize_krb_error_table();
link_against_the_moira_version_of_gdb = 0;
- sms_inited=1;
+ mr_inited=1;
}
* $Author$
* $Header$
*
- * Copyright (C) 1987, 1989 by the Massachusetts Institute of Technology
+ * Copyright (C) 1987, 1989, 1990 by the Massachusetts Institute of
+ * Technology
* For copying and distribution information, please see the file
* <mit-copyright.h>.
*
* This routine is part of the client library. It handles
* the protocol operations: invoking an update and getting the
- * SMS message of the day.
+ * MR message of the day.
*/
#ifndef lint
#endif lint
#include <mit-copyright.h>
-#include "sms_private.h"
+#include "mr_private.h"
/* Invoke a DCM update. */
-int sms_do_update()
+int mr_do_update()
{
int status;
- sms_params param_st;
- struct sms_params *params = NULL;
- struct sms_params *reply = NULL;
+ mr_params param_st;
+ struct mr_params *params = NULL;
+ struct mr_params *reply = NULL;
CHECK_CONNECTED;
params = ¶m_st;
- params->sms_version_no = sending_version_no;
- params->sms_procno = SMS_DO_UPDATE;
- params->sms_argc = 0;
- params->sms_argl = NULL;
- params->sms_argv = NULL;
+ params->mr_version_no = sending_version_no;
+ params->mr_procno = MR_DO_UPDATE;
+ params->mr_argc = 0;
+ params->mr_argl = NULL;
+ params->mr_argv = NULL;
- if ((status = sms_do_call(params, &reply)) == 0)
- status = reply->sms_status;
+ if ((status = mr_do_call(params, &reply)) == 0)
+ status = reply->mr_status;
- sms_destroy_reply(reply);
+ mr_destroy_reply(reply);
return status;
}
-/* Get the SMS motd. This returns an SMS status, and motd will either
+/* Get the MR motd. This returns an MR status, and motd will either
* point to NULL or the motd in a static buffer.
*/
-int sms_motd(motd)
+int mr_motd(motd)
char **motd;
{
int status;
- sms_params param_st;
- struct sms_params *params = NULL;
- struct sms_params *reply = NULL;
+ mr_params param_st;
+ struct mr_params *params = NULL;
+ struct mr_params *reply = NULL;
static char buffer[1024];
*motd = NULL;
CHECK_CONNECTED;
params = ¶m_st;
- params->sms_version_no = sending_version_no;
- params->sms_procno = SMS_MOTD;
- params->sms_argc = 0;
- params->sms_argl = NULL;
- params->sms_argv = NULL;
+ params->mr_version_no = sending_version_no;
+ params->mr_procno = MR_MOTD;
+ params->mr_argc = 0;
+ params->mr_argl = NULL;
+ params->mr_argv = NULL;
- if ((status = sms_do_call(params, &reply)))
+ if ((status = mr_do_call(params, &reply)))
goto punt;
- while ((status = reply->sms_status) == SMS_MORE_DATA) {
- if (reply->sms_argc > 0) {
- strncpy(buffer, reply->sms_argv[0], sizeof(buffer));
+ while ((status = reply->mr_status) == MR_MORE_DATA) {
+ if (reply->mr_argc > 0) {
+ strncpy(buffer, reply->mr_argv[0], sizeof(buffer));
*motd = buffer;
}
- sms_destroy_reply(reply);
+ mr_destroy_reply(reply);
reply = NULL;
- initialize_operation(_sms_recv_op, sms_start_recv, &reply,
+ initialize_operation(_mr_recv_op, mr_start_recv, &reply,
(int (*)())NULL);
- queue_operation(_sms_conn, CON_INPUT, _sms_recv_op);
+ queue_operation(_mr_conn, CON_INPUT, _mr_recv_op);
- sms_complete_operation(_sms_recv_op);
- if (OP_STATUS(_sms_recv_op) != OP_COMPLETE) {
- sms_disconnect();
- status = SMS_ABORTED;
+ mr_complete_operation(_mr_recv_op);
+ if (OP_STATUS(_mr_recv_op) != OP_COMPLETE) {
+ mr_disconnect();
+ status = MR_ABORTED;
return(status);
}
}
punt:
- sms_destroy_reply(reply);
+ mr_destroy_reply(reply);
/* for backwards compatability */
- if (status == SMS_UNKNOWN_PROC)
+ if (status == MR_UNKNOWN_PROC)
return(0);
else
return(status);
/* Tell the library to take care of another input source while it is
* processing a query. For instance, an X toolkit application would
* do something like
- * sms_set_alternate_input(ConnectionNumber(XtDisplay(widget)), doxinput);
+ * mr_set_alternate_input(ConnectionNumber(XtDisplay(widget)), doxinput);
* where doxinput is defined as:
* doxinput() {
* extern Widget toplevel;
* }
*/
-static int sms_alternate_input = 0;
-static int (*sms_alternate_handler)();
+static int mr_alternate_input = 0;
+static int (*mr_alternate_handler)();
-int sms_set_alternate_input(fd, proc)
+int mr_set_alternate_input(fd, proc)
int fd;
int (*proc)();
{
- if (sms_alternate_input != 0)
- return(SMS_ALREADY_CONNECTED);
- sms_alternate_input = fd;
- sms_alternate_handler = proc;
- return(SMS_SUCCESS);
+ if (mr_alternate_input != 0)
+ return(MR_ALREADY_CONNECTED);
+ mr_alternate_input = fd;
+ mr_alternate_handler = proc;
+ return(MR_SUCCESS);
}
* handles alternate input streams (such as X) as well.
*/
-sms_complete_operation(op)
+mr_complete_operation(op)
OPERATION op;
{
long infd, outfd, exfd;
gdb_progress(); /* try for an immediate completion */
- if (sms_alternate_input == 0)
+ if (mr_alternate_input == 0)
return(complete_operation(op));
- infd = (1<<sms_alternate_input);
+ infd = (1<<mr_alternate_input);
outfd = exfd = 0;
while(op->status != OP_COMPLETE && op->status != OP_CANCELLED) {
- rc = con_select(sms_alternate_input, (fd_set *)&infd, (fd_set *)&outfd,
+ rc = con_select(mr_alternate_input, (fd_set *)&infd, (fd_set *)&outfd,
(fd_set *)&exfd, (struct timeval *)NULL);
- if (rc > 0 && sms_alternate_handler) {
- (*sms_alternate_handler)();
+ if (rc > 0 && mr_alternate_handler) {
+ (*mr_alternate_handler)();
}
}
return(op->status);
* $Author$
* $Header$
*
- * Copyright (C) 1987 by the Massachusetts Institute of Technology
+ * Copyright (C) 1987, 1990 by the Massachusetts Institute of Technology
* For copying and distribution information, please see the file
* <mit-copyright.h>.
*
#include <mit-copyright.h>
#include <sys/types.h>
#include <netinet/in.h>
-#include "sms_private.h"
+#include "mr_private.h"
/*
* GDB operations to send and recieve RPC requests and replies.
* write of the next bunch of data.
*/
-sms_cont_send(op, hcon, arg)
+mr_cont_send(op, hcon, arg)
OPERATION op;
HALF_CONNECTION hcon;
- struct sms_params *arg;
+ struct mr_params *arg;
{
op->result = OP_SUCCESS;
- free(arg->sms_flattened);
- arg->sms_flattened = NULL;
+ free(arg->mr_flattened);
+ arg->mr_flattened = NULL;
return OP_COMPLETE;
}
-sms_start_send(op, hcon, arg)
+mr_start_send(op, hcon, arg)
OPERATION op;
HALF_CONNECTION hcon;
- register struct sms_params *arg;
+ register struct mr_params *arg;
{
int i, len;
- unsigned int sms_size;
+ unsigned int mr_size;
int *argl;
char *buf, *bp;
* This should probably be split into several routines.
* It could also probably be made more efficient (punting most
* of the argument marshalling stuff) by doing I/O directly
- * from the strings. Anyone for a scatter/gather sms_send_data?
+ * from the strings. Anyone for a scatter/gather mr_send_data?
*
* that would look a lot like the uio stuff in the kernel.. hmm.
*/
* to a longword boundary.
*/
- sms_size = 4 * sizeof(long);
+ mr_size = 4 * sizeof(long);
- argl = (int *)malloc((unsigned)(sizeof(int) * arg->sms_argc));
+ argl = (int *)malloc((unsigned)(sizeof(int) * arg->mr_argc));
/*
* For each argument, figure out how much space is needed.
*/
- for (i = 0; i < arg->sms_argc; ++i) {
- if (arg->sms_argl)
- argl[i] = len = arg->sms_argl[i];
+ for (i = 0; i < arg->mr_argc; ++i) {
+ if (arg->mr_argl)
+ argl[i] = len = arg->mr_argl[i];
else
- argl[i] = len = strlen(arg->sms_argv[i]) + 1;
- sms_size += sizeof(long) + len;
+ argl[i] = len = strlen(arg->mr_argv[i]) + 1;
+ mr_size += sizeof(long) + len;
/* Round up to next longword boundary.. */
- sms_size = sizeof(long) * howmany(sms_size, sizeof(long));
+ mr_size = sizeof(long) * howmany(mr_size, sizeof(long));
}
- arg->sms_flattened = buf = malloc(sms_size);
+ arg->mr_flattened = buf = malloc(mr_size);
- bzero(arg->sms_flattened, sms_size);
+ bzero(arg->mr_flattened, mr_size);
- arg->sms_size = sms_size;
+ arg->mr_size = mr_size;
/*
* This is gross. Any better suggestions, anyone?
* return a pointer which is aligned correctly for any data.
*/
- ((long *)buf)[0] = htonl(sms_size);
- ((long *)buf)[1] = htonl(arg->sms_version_no);
- ((long *)buf)[2] = htonl(arg->sms_procno);
- ((long *)buf)[3] = htonl(arg->sms_argc);
+ ((long *)buf)[0] = htonl(mr_size);
+ ((long *)buf)[1] = htonl(arg->mr_version_no);
+ ((long *)buf)[2] = htonl(arg->mr_procno);
+ ((long *)buf)[3] = htonl(arg->mr_argc);
/*
* bp is a pointer into the point in the buffer to put
bp = (char *)(((long *)buf) + 4);
- for (i = 0; i<arg->sms_argc; ++i) {
+ for (i = 0; i<arg->mr_argc; ++i) {
len = argl[i];
*((long *)bp) = htonl(len);
bp += sizeof(long);
- bcopy(arg->sms_argv[i], bp, len);
+ bcopy(arg->mr_argv[i], bp, len);
bp += sizeof(long) * howmany(len, sizeof(long));
}
- op->fcn.cont = sms_cont_send;
- arg->sms_size = sms_size;
+ op->fcn.cont = mr_cont_send;
+ arg->mr_size = mr_size;
free(argl);
- if (gdb_send_data(hcon, arg->sms_flattened, sms_size) == OP_COMPLETE)
- return sms_cont_send(op, hcon, arg);
+ if (gdb_send_data(hcon, arg->mr_flattened, mr_size) == OP_COMPLETE)
+ return mr_cont_send(op, hcon, arg);
else return OP_RUNNING;
}
-sms_cont_recv(op, hcon, argp)
+mr_cont_recv(op, hcon, argp)
OPERATION op;
HALF_CONNECTION hcon;
- sms_params **argp;
+ mr_params **argp;
{
int done = FALSE;
char *cp;
int *ip;
int i;
- register sms_params *arg = *argp;
+ register mr_params *arg = *argp;
while (!done) {
- switch (arg->sms_state) {
+ switch (arg->mr_state) {
case S_RECV_START:
- arg->sms_state = S_RECV_DATA;
- if (gdb_receive_data(hcon, (caddr_t)&arg->sms_size,
+ arg->mr_state = S_RECV_DATA;
+ if (gdb_receive_data(hcon, (caddr_t)&arg->mr_size,
sizeof(long)) == OP_COMPLETE)
continue;
done = TRUE;
case S_RECV_DATA:
fflush(stdout);
/* Should validate that length is reasonable */
- arg->sms_size = ntohl(arg->sms_size);
- if (arg->sms_size > 65536) {
+ arg->mr_size = ntohl(arg->mr_size);
+ if (arg->mr_size > 65536) {
return OP_CANCELLED;
}
- arg->sms_flattened = malloc(arg->sms_size);
- arg->sms_state = S_DECODE_DATA;
- bcopy((caddr_t)&arg->sms_size, arg->sms_flattened, sizeof(long));
+ arg->mr_flattened = malloc(arg->mr_size);
+ arg->mr_state = S_DECODE_DATA;
+ bcopy((caddr_t)&arg->mr_size, arg->mr_flattened, sizeof(long));
if (gdb_receive_data(hcon,
- arg->sms_flattened + sizeof(long),
- arg->sms_size - sizeof(long))
+ arg->mr_flattened + sizeof(long),
+ arg->mr_size - sizeof(long))
== OP_COMPLETE)
continue;
done = TRUE;
break;
case S_DECODE_DATA:
- cp = arg->sms_flattened;
+ cp = arg->mr_flattened;
ip = (int *) cp;
/* we already got the overall length.. */
for(i=1; i <4; i++) ip[i] = ntohl(ip[i]);
- arg->sms_version_no = ip[1];
- if (arg->sms_version_no != SMS_VERSION_1 &&
- arg->sms_version_no != SMS_VERSION_2)
- arg->sms_status = SMS_VERSION_MISMATCH;
- else arg->sms_status = ip[2];
- arg->sms_argc = ip[3];
+ arg->mr_version_no = ip[1];
+ if (arg->mr_version_no != MR_VERSION_1 &&
+ arg->mr_version_no != MR_VERSION_2)
+ arg->mr_status = MR_VERSION_MISMATCH;
+ else arg->mr_status = ip[2];
+ arg->mr_argc = ip[3];
cp += 4 * sizeof(int);
- arg->sms_argv=(char **)malloc(arg->sms_argc *sizeof(char **));
- arg->sms_argl=(int *)malloc(arg->sms_argc *sizeof(int *));
+ arg->mr_argv=(char **)malloc(arg->mr_argc *sizeof(char **));
+ arg->mr_argl=(int *)malloc(arg->mr_argc *sizeof(int *));
- for (i = 0; i<arg->sms_argc; ++i) {
+ for (i = 0; i<arg->mr_argc; ++i) {
u_short nlen = ntohl(* (int *) cp);
cp += sizeof (long);
- if (cp + nlen > arg->sms_flattened + arg->sms_size) {
- free(arg->sms_flattened);
- arg->sms_flattened = NULL;
+ if (cp + nlen > arg->mr_flattened + arg->mr_size) {
+ free(arg->mr_flattened);
+ arg->mr_flattened = NULL;
return OP_CANCELLED;
}
- arg->sms_argv[i] = (char *)malloc(nlen);
- bcopy(cp, arg->sms_argv[i], nlen);
- arg->sms_argl[i]=nlen;
+ arg->mr_argv[i] = (char *)malloc(nlen);
+ bcopy(cp, arg->mr_argv[i], nlen);
+ arg->mr_argl[i]=nlen;
cp += sizeof(long) * howmany(nlen, sizeof(long));
}
- free(arg->sms_flattened);
- arg->sms_flattened = NULL;
+ free(arg->mr_flattened);
+ arg->mr_flattened = NULL;
return OP_COMPLETE;
}
}
}
-sms_start_recv(op, hcon, argp)
+mr_start_recv(op, hcon, argp)
OPERATION op;
HALF_CONNECTION hcon;
- struct sms_params **argp;
+ struct mr_params **argp;
{
- register sms_params *arg = *argp;
+ register mr_params *arg = *argp;
if (!arg) {
- *argp = arg = (sms_params *)malloc(sizeof(sms_params));
- arg->sms_argl = NULL;
- arg->sms_argv = NULL;
- arg->sms_flattened = NULL;
+ *argp = arg = (mr_params *)malloc(sizeof(mr_params));
+ arg->mr_argl = NULL;
+ arg->mr_argv = NULL;
+ arg->mr_flattened = NULL;
}
- arg->sms_state = S_RECV_START;
- op->fcn.cont = sms_cont_recv;
- return sms_cont_recv(op, hcon, argp);
+ arg->mr_state = S_RECV_START;
+ op->fcn.cont = mr_cont_recv;
+ return mr_cont_recv(op, hcon, argp);
}
-sms_destroy_reply(reply)
- sms_params *reply;
+mr_destroy_reply(reply)
+ mr_params *reply;
{
int i;
if (reply) {
- if (reply->sms_argl)
- free(reply->sms_argl);
- reply->sms_argl = NULL;
- if (reply->sms_flattened)
- free(reply->sms_flattened);
- reply->sms_flattened = NULL;
- if (reply->sms_argv) {
- for (i=0; i<reply->sms_argc; i++) {
- if (reply->sms_argv[i])
- free (reply->sms_argv[i]);
- reply->sms_argv[i] = NULL;
+ if (reply->mr_argl)
+ free(reply->mr_argl);
+ reply->mr_argl = NULL;
+ if (reply->mr_flattened)
+ free(reply->mr_flattened);
+ reply->mr_flattened = NULL;
+ if (reply->mr_argv) {
+ for (i=0; i<reply->mr_argc; i++) {
+ if (reply->mr_argv[i])
+ free (reply->mr_argv[i]);
+ reply->mr_argv[i] = NULL;
}
- free(reply->sms_argv);
+ free(reply->mr_argv);
}
- reply->sms_argv = NULL;
+ reply->mr_argv = NULL;
free(reply);
}
}
-
-/*
- * Local Variables:
- * mode: c
- * c-indent-level: 4
- * c-continued-statement-offset: 4
- * c-brace-offset: -4
- * c-argdecl-indent: 4
- * c-label-offset: -4
- * End:
- */
*
* Copyright (C) 1987 by the Massachusetts Institute of Technology
*
- * Private declarations of the SMS library.
- *
- * $Log$
- * Revision 1.4 1988-04-19 12:42:49 mar
- * declared version number variable
- *
- * Revision 1.3 87/06/16 17:48:39 wesommer
- * Clean up memory allocation, indenting.
- *
- * Revision 1.2 87/05/31 22:07:06 wesommer
- * Private data to the sms server and library.
- *
- * Revision 1.1 87/05/20 03:12:00 wesommer
- * Initial revision
- *
+ * Private declarations of the Moira library.
*/
-#include "sms_proto.h"
+#include "mr_proto.h"
-extern CONNECTION _sms_conn;
-extern OPERATION _sms_send_op, _sms_recv_op;
+extern CONNECTION _mr_conn;
+extern OPERATION _mr_send_op, _mr_recv_op;
-extern int sms_inited;
+extern int mr_inited;
extern int sending_version_no;
/*
#define EVER (;;)
-#define CHECK_CONNECTED {if (!_sms_conn) return SMS_NOT_CONNECTED;}
+#define CHECK_CONNECTED {if (!_mr_conn) return MR_NOT_CONNECTED;}
/*
* There should be an include file for these..
#endif lint
#include <mit-copyright.h>
-#include "sms_private.h"
+#include "mr_private.h"
/*
- * This routine is the primary external interface to the sms library.
+ * This routine is the primary external interface to the mr library.
*
* It builds a new argument vector with the query handle prepended,
- * and calls sms_query_internal.
+ * and calls mr_query_internal.
*/
int level = 0;
-int sms_query(name, argc, argv, callproc, callarg)
+int mr_query(name, argc, argv, callproc, callarg)
char *name; /* Query name */
int argc; /* Arg count */
char **argv; /* Args */
register int status = 0;
nargv[0] = name;
bcopy((char *)argv, (char *)(nargv+1), sizeof(char *) * argc);
- status = sms_query_internal(argc+1, nargv, callproc, callarg);
+ status = mr_query_internal(argc+1, nargv, callproc, callarg);
free(nargv);
return status;
}
/*
- * This routine makes an SMS query.
+ * This routine makes an MR query.
*
* argv[0] is the query name.
* argv[1..argc-1] are the query arguments.
* way to send it a quench..)
*/
-int sms_query_internal(argc, argv, callproc, callarg)
+int mr_query_internal(argc, argv, callproc, callarg)
int argc; /* Arg count */
char **argv; /* Args */
int (*callproc)(); /* Callback procedure */
char *callarg; /* Callback argument */
{
int status;
- sms_params params_st;
- register sms_params *params = NULL;
- sms_params *reply = NULL;
+ mr_params params_st;
+ register mr_params *params = NULL;
+ mr_params *reply = NULL;
int stopcallbacks = 0;
- if (level) return SMS_QUERY_NOT_REENTRANT;
+ if (level) return MR_QUERY_NOT_REENTRANT;
CHECK_CONNECTED;
level++;
params = ¶ms_st;
- params->sms_version_no = sending_version_no;
- params->sms_procno = SMS_QUERY;
- params->sms_argc = argc;
- params->sms_argl = NULL;
- params->sms_argv = argv;
+ params->mr_version_no = sending_version_no;
+ params->mr_procno = MR_QUERY;
+ params->mr_argc = argc;
+ params->mr_argl = NULL;
+ params->mr_argv = argv;
- if ((status = sms_do_call(params, &reply)))
+ if ((status = mr_do_call(params, &reply)))
goto punt;
- while ((status = reply->sms_status) == SMS_MORE_DATA) {
+ while ((status = reply->mr_status) == MR_MORE_DATA) {
if (!stopcallbacks)
stopcallbacks =
- (*callproc)(reply->sms_argc, reply->sms_argv, callarg);
- sms_destroy_reply(reply);
+ (*callproc)(reply->mr_argc, reply->mr_argv, callarg);
+ mr_destroy_reply(reply);
reply = NULL;
- initialize_operation(_sms_recv_op, sms_start_recv, &reply,
+ initialize_operation(_mr_recv_op, mr_start_recv, &reply,
(int (*)())NULL);
- queue_operation(_sms_conn, CON_INPUT, _sms_recv_op);
+ queue_operation(_mr_conn, CON_INPUT, _mr_recv_op);
- sms_complete_operation(_sms_recv_op);
- if (OP_STATUS(_sms_recv_op) != OP_COMPLETE) {
- sms_disconnect();
- status = SMS_ABORTED;
+ mr_complete_operation(_mr_recv_op);
+ if (OP_STATUS(_mr_recv_op) != OP_COMPLETE) {
+ mr_disconnect();
+ status = MR_ABORTED;
goto punt_1;
}
}
punt:
- sms_destroy_reply(reply);
+ mr_destroy_reply(reply);
punt_1:
level--;
return status;
#endif lint
#include <mit-copyright.h>
-#include <sms.h>
+#include <moira.h>
#include <stdio.h>
#include <strings.h>
#include <ctype.h>
*/
static struct pair fs_names[] = {
- { SMS_FS_STUDENT, "Student" },
- { SMS_FS_FACULTY, "Faculty/Project" },
- { SMS_FS_FACULTY, "Faculty" },
- { SMS_FS_FACULTY, "Project" },
- { SMS_FS_STAFF, "Staff" },
- { SMS_FS_MISC, "Other" },
+ { MR_FS_STUDENT, "Student" },
+ { MR_FS_FACULTY, "Faculty/Project" },
+ { MR_FS_FACULTY, "Faculty" },
+ { MR_FS_FACULTY, "Project" },
+ { MR_FS_STAFF, "Staff" },
+ { MR_FS_MISC, "Other" },
/* Insert new entries before the 0,0 pair */
{ 0, 0 },
};
*/
#include <mit-copyright.h>
-#include <sms.h>
+#include <moira.h>
struct save_queue *
sq_create()