1 #if (!defined(lint) && !defined(SABER))
2 static char rcsid_module_c[] = "$Header$";
5 /* This is the file menu.c for allmaint, the SMS client that allows
6 * a user to maintaint most important parts of the SMS database.
7 * It Contains: all menu definitions for allmaint.
10 * By: Chris D. Peterson
16 * Copyright 1987, 1988 by the Massachusetts Institute of Technology.
18 * For further information on copyright and distribution
19 * see the file mit-copyright.h
25 #include "mit-copyright.h"
27 #include "allmaint_funcs.h"
34 Menu attachmaint_filemenu = {
37 "Filesystem Maintenance",
40 { GetFS, NULLMENU, 2, {
41 {"get", "Get Filesystem Name Information"},
42 {"name", "Name of Filesystem: "}
44 { AddFS, NULLMENU, 2, {
45 {"add", "Add New Filesystem to Database"},
48 { ChangeFS, NULLMENU, 2, {
49 {"change", "Update Filesystem Information"},
52 { DeleteFS, NULLMENU, 2, {
53 {"delete", "Delete Filesystem"},
54 {"name", "Filesystem Name: "}
59 Menu attachmaint_top_menu = {
62 "Attach/Filesystem Maintenance",
65 SUBMENU("filesystem", "Filesystem Work", &attachmaint_filemenu),
66 { GetFSAlias, NULLMENU, 2, {
67 {"check", "Check An Association"},
68 {"name", "alias name : "}
70 { CreateFSAlias, NULLMENU, 2, {
71 {"alias", "Associate with a Filesystem"},
72 {"name", "alias name : "},
74 { DeleteFSAlias, NULLMENU, 2, {
75 {"unalias", "Disassociate from a Filesystem"},
76 {"name", "alias name : "},
78 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode),
79 SIMPLEFUNC("help", "Help ..", AttachHelp)
87 Menu clustermaint_machine_menu = {
90 "Machine Maintenence",
93 { ShowMachineInfo, NULLMENU, 2, {
94 {"show","Get machine information"},
95 {"name","Machine's Name: "}
97 { AddMachine, NULLMENU, 2, {
98 {"add","Add a new machine"},
99 {"name","Machine's Name: "},
101 { UpdateMachine, NULLMENU, 2, {
102 {"update","Update machine information"},
103 {"name","Machine's Name: "},
105 { DeleteMachine, NULLMENU, 2, {
106 {"delete","Delete this machine"},
107 {"name","Machine's Name: "}
109 { MachineToClusterMap, NULLMENU, 3, {
110 {"map", "Show Machine to cluster mapping"},
111 {"name", "Machine's Name: "},
112 {"cluster", "Cluster's Name: "},
114 { AddMachineToCluster, NULLMENU, 3, {
115 {"addcluster","Add machines to a clusters"},
116 {"name","Machine's Name: "},
117 {"cluster", "Cluster's Name: "},
119 { RemoveMachineFromCluster, NULLMENU, 3, {
120 {"remcluster", "Remove machines from clusters"},
121 {"name","Machine's Name: "},
122 {"cluster", "Cluster's Name: "},
127 Menu clustermaint_cluster_menu = {
130 "Cluster Information",
133 { ShowClusterInfo, NULLMENU, 2, {
134 {"show", "Get cluster information"},
135 {"name", "Cluster's Name: "}
137 { MachinesInCluster, NULLMENU, 2, {
138 {"machines", "List all machines in a cluster"},
139 {"clus", "Cluster's Name: "}
141 { AddCluster, NULLMENU, 2, {
142 {"add", "Add a new cluster"},
143 {"name","Cluster's Name: "},
145 { UpdateCluster, NULLMENU, 2, {
146 {"update", "Update cluster information"},
147 {"name","Cluster's Name: "},
149 { DeleteCluster, NULLMENU, 2, {
150 {"delete", "Delete this cluster"},
151 {"name", "Cluster's Name: "}
153 { AddMachineToCluster, NULLMENU, 3, {
154 {"addcluster","Add machines to a clusters"},
155 {"name","Machine's Name: "},
156 {"cluster", "Cluster's Name: "},
158 { RemoveMachineFromCluster, NULLMENU, 3, {
159 {"remcluster", "Remove machines from clusters"},
160 {"name","Machine's Name: "},
161 {"cluster", "Cluster's Name: "},
166 Menu clustermaint_data_menu = {
169 "Cluster Data Maintenence",
172 { ShowClusterData, NULLMENU, 3, {
173 {"show", "Show Data on a given Cluster"},
174 {"clus", "Cluster's Name: "},
175 {"label", "Label Identifing the data: "},
177 { AddClusterData, NULLMENU, 4, {
178 {"add", "Add Data to a given Cluster"},
179 {"clus", "Cluster Name: "},
180 {"label", "Label Identifing the data: "},
181 {"data", "The data to be added: "},
183 { RemoveClusterData, NULLMENU, 4, {
184 {"delete", "Remove Data to a given Cluster"},
185 {"clus", "Cluster's Name: "},
186 {"label", "Label Identifing the data: "},
187 {"data", "The data to be removed: "},
192 Menu clustermaint_top_menu = {
195 "Cluster Maintenence",
198 SUBMENU("machine", "Work on Machines", &clustermaint_machine_menu),
199 SUBMENU("cluster", "Work on Clusters", &clustermaint_cluster_menu),
200 SUBMENU("data", "Work with cluster data", &clustermaint_data_menu),
201 {MachineToClusterMap, NULLMENU, 3, {
202 {"map", "Machine to Cluster Mapping"},
203 {"machine", "Machine Name: "},
204 {"clus", "Cluster Name: "}
206 SIMPLEFUNC("verbose", "Toggle Delete Confirmation", ToggleVerboseMode),
214 /* Commenting out all DCM maint stuff.
216 Menu dcmmaint_service_menu = {
217 dcmmaint_service_menu_entry,
218 dcmmaint_service_menu_exit,
222 SIMPLEFUNC("show", "Show fields of service", show_service),
223 SIMPLEFUNC("interval", "Change the interval field", change_interval),
224 SIMPLEFUNC("target_path", "Change the target_path field",
226 SIMPLEFUNC("script", "Change the script field", change_script),
228 "Change the date of the latest generation of the db file",
233 Menu dcmmaint_host_info_menu = {
234 dcmmaint_host_info_menu_entry,
235 dcmmaint_host_info_menu_exit,
239 SIMPLEFUNC("show", "Show values of entry", show_host_info),
240 SIMPLEFUNC("last_time", "Change the last_time field", change_last_time),
241 SIMPLEFUNC("success", "Change the success field", change_success),
242 SIMPLEFUNC("override", "Change the override field", change_override),
243 SIMPLEFUNC("enable", "Change the enable field", change_enable),
244 SIMPLEFUNC("value1", "Change the value1 field", change_value1),
245 SIMPLEFUNC("value2", "Change the value2 field", change_value2),
246 SIMPLEFUNC("rvdacls", "Change the RVD ACLs (for RVD servers only)",
251 Menu dcmmaint_top_menu = {
254 "Data Control Manager Maintenance",
257 SUBMENU("hi_change", "Modify a service-host entry",
258 &dcmmaint_host_info_menu),
259 SIMPLEFUNC("hi_add", "Create new service-host entry", do_host_info),
260 SIMPLEFUNC("hi_delete", "Remove a service-host entry", do_host_info),
261 SIMPLEFUNC("hi_list", "List service-host entries", do_host_info),
262 SUBMENU("s_change", "Modify info for an existing service",
263 &dcmmaint_service_menu),
264 SIMPLEFUNC("s_add", "Create new service", do_service),
265 SIMPLEFUNC("s_delete", "Remove a service", do_service),
266 SIMPLEFUNC("s_list", "List services", do_service),
267 SIMPLEFUNC("help", "How to use this program", instructions)
271 Commenting out all DCM maint stuff. */
277 Menu listmaint_list_menu = {
284 "List all lists to which a given member belongs",
287 "List all items which a given member can administer",
288 ListByAdministrator),
289 SIMPLEFUNC("groups", "List all lists which are groups",
291 SIMPLEFUNC("public", "List all public mailing lists",
292 ListAllPublicMailLists),
293 SIMPLEFUNC("maillists", "List all mailing lists",
298 Menu listmaint_member_menu = {
299 ListmaintMemberMenuEntry,
300 ListmaintMemberMenuExit,
304 SIMPLEFUNC("add", "Add a member to this list",
306 SIMPLEFUNC("remove", "Remove a member from this list",
308 SIMPLEFUNC("all", "Show the members of this list",
310 SIMPLEFUNC("user", "Show the members of type USER",
312 SIMPLEFUNC("list", "Show the members of type LIST",
314 SIMPLEFUNC("string", "Show the members of type STRING",
316 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete",
321 Menu listmaint_top_menu = {
324 "List Maintenance Menu",
327 { ShowListInfo, NULLMENU, 2, {
328 {"show", "Display information about a list"},
329 {"list name", "Name of list: "}
331 { NULLFUNC, &listmaint_member_menu, 2, {
332 {"add", "Create new List"},
333 {"list name", "Name of list: "}
335 { UpdateList, NULLMENU, 2, {
336 {"update", "Update characteristics of a list"},
337 {"list name", "Name of list: "}
339 { DeleteList, NULLMENU, 2, {
340 {"delete", "Delete a List"},
341 {"list name", "Name of list: "}
343 { NULLFUNC, &listmaint_member_menu, 2, {
344 {"members", "Change/Display the membership of a list"},
345 {"list name", "Name of list: "}
347 SIMPLEFUNC("query_remove",
348 "Interactively remove an item from all lists",
349 InterRemoveItemFromLists),
350 SUBMENU("list_lists", "Display inventory of lists",
351 &listmaint_list_menu),
352 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete",
354 SIMPLEFUNC("help", "How to use this program", ListHelp)
362 Menu nfsmaint_top_menu = {
368 { ShowNFSService, NULLMENU, 3, {
369 { "show", "Show an NFS server" },
370 { "machine", "Machine Name: "},
371 { "device", "Directory: "}
373 { AddNFSService, NULLMENU, 3, {
374 { "add", "Add NFS server" },
375 { "machine", "Machine Name: "},
376 { "device", "Directory: "}
378 { UpdateNFSService, NULLMENU, 3, {
379 { "update", "Update NFS server"},
380 { "machine", "Machine Name: "},
381 { "device", "Directory: "}
383 { DeleteNFSService, NULLMENU, 3, {
384 { "delete", "Delete NFS server"},
385 {"machine", "Machine Name: "},
386 {"device", "Directory: "}
388 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode),
389 /* SIMPLEFUNC("help", "Help", NFSHelp), */
397 /* Queries have not been implemented yet :-(
402 "Server Maintenence",
405 { getserv, NULLMENU, 2, {
406 {"get", "Services Info"},
407 {"serv", "Service Name: "}
409 { addserv, NULLMENU, 4, {
410 {"add", "Add Service"},
412 {"proto", "Protocol: "},
415 { updserv, NULLMENU, 4, {
416 {"update", "Update Service"},
418 {"proto", "Protocol: "},
421 {delserv, NULLMENU, 3, {
422 {"delete", "Delete Service"},
423 {"serv", "Service Name: "},
424 {"proto", "Protocol: "}
426 { getassc, NULLMENU, 2, {
427 {"get_alias", "Get All Aliases for Service"},
428 {"srv", "Service Name: "}
430 { alas, NULLMENU, 3, {
432 {"srv", "Service Name: "},
435 { alas, NULLMENU, 3, {
436 {"-", "Delete Alias"},
437 {"srv", "Service Name: "},
440 SIMPLEFUNC("toggle", "Toggle Verbosity of Delete", toggle_verb)
453 Menu usermaint_quota_menu = {
456 "Edit User Quotas and Server Machines",
459 SIMPLEFUNC("shdef", "Show default user quota (in KB)", ShowDefaultQuota),
460 {ShowUserQuota, NULLMENU, 2, {
461 {"shquota", "Show a user's quota (in KB)"},
462 {"login", "Login name: "}
464 {ChangeDefaultQuota, NULLMENU, 2, {
465 {"chdef", "Change default user quota"},
466 {"quota", "New quota (in KB): "}
468 {ChangeUserQuota, NULLMENU, 2, {
469 {"chquota", "Change a user's disk quota"},
470 {"user", "Login name: "}
472 {AddUserLocker, NULLMENU, 5, {
473 {"create", "Create a quota & locker for a user"},
474 {"login", "User's login name: "},
475 {"machine", "Server host name: "},
476 {"device", "Directory on host: /[dir]/[login] "},
477 {"quota", "Quota in KB: "}
479 {DeleteUserLocker, NULLMENU, 2, {
480 {"del", "Delete a user's quota & locker - BROKEN 6/10/88 CDP"},
481 {"login", "User's login: "}
486 Menu usermaint_top_menu = {
489 "SMS User Maintenance",
492 {ShowUserByLogin, NULLMENU, 2, {
493 {"login", "Show user information by login name"},
494 {"login name", "Desired login name: "}
496 {ShowUserByName, NULLMENU, 3, {
497 {"full", "Show user information by name"},
498 {"first", "First name: "},
499 {"last", "Last name: "}
501 {ShowUserByClass, NULLMENU, 2, {
502 {"login", "Show names of users in a given class"},
503 {"login name", "Desired class: "}
505 {ModifyUser, NULLMENU, 2, {
506 {"modify", "Change all user fields"},
507 {"login", "Login name: "}
509 /* SIMPLEFUNC("chpw", "Change a user's password", change_user_password), */
510 {ChangeUserPOBox, NULLMENU, 2, {
511 {"chpobox", "Change a user's post office box"},
512 {"login name", "login name: "}
514 /* {enter_user, NULLMENU, 6, {
515 {"enter", "Enter unregistered user"},
516 {"first", "User's first name: "},
517 {"middle", "User's middle initial: "},
518 {"last", "User's last name: "},
519 {"mit_id", "User's MIT ID: "},
520 {"mit_year", "User's MIT year: "}
522 {reg_user, NULLMENU, 5, {
523 {"register", "Register unregistered user"},
524 {"first", "User's first name: "},
525 {"last", "User's last name: "},
526 {"mit_id", "User's MIT ID: "},
527 {"login", "Login name to assign: "}
530 {DeleteUser, NULLMENU, 2, {
531 {"delete", "Delete user"},
532 {"login", "Login name: "}
534 {DeleteUserByUid, NULLMENU, 2, {
535 {"udelete", "Delete user by uid"},
536 {"uid", "User ID (not MIT ID!): "}
538 SUBMENU("quota", "User Quotas", &usermaint_quota_menu),
546 Menu sms_top_menu = {
549 "Sms Database Manipulation",
552 SUBMENU("attachmaint","open the attachmaint menu",&attachmaint_top_menu),
553 SUBMENU("clustermaint","open the clustermaint menu",
554 &clustermaint_top_menu),
555 /* SUBMENU("dcmmaint","open the dcmmaint menu",&dcmmaint_top_menu), */
556 SUBMENU("listmaint","open the listmaint menu",&listmaint_top_menu),
557 SUBMENU("nfsmaint","open the nfsmaint menu",&nfsmaint_top_menu),
558 /* SUBMENU("portmaint","open the portmaint menu",&portmaint_top_menu), */
559 /* SUBMENU("smsmaint","open the smsmaint menu",&smsmaint_top_menu), */
560 SUBMENU("usermaint","open the usermaint menu",&usermaint_top_menu)