1 #if (!defined(lint) && !defined(SABER))
2 static char rcsid_module_c[] = "$Header$";
5 /* This is the file menus.c for the MOIRA Client, which allows a nieve
6 * user to quickly and easily maintain most parts of the MOIRA database.
7 * It Contains: All menu definitions.
10 * By: Chris D. Peterson
16 * Copyright 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"
31 /* ------------------------- Second Tier Menus ------------------------- */
37 Menu cluster_data_menu = {
43 { ShowClusterData, NULLMENU, 3, {
44 {"show", "Show Data on a given Cluster"},
45 {"clus", "Cluster's Name: "},
46 {"label", "Label Identifing the data: "},
48 { AddClusterData, NULLMENU, 4, {
49 {"add", "Add Data to a given Cluster"},
50 {"clus", "Cluster Name: "},
51 {"label", "Label Identifing the data: "},
52 {"data", "The data to be added: "},
54 { RemoveClusterData, NULLMENU, 3, {
55 {"delete", "Remove Data from a given Cluster"},
56 {"clus", "Cluster's Name: "},
57 {"label", "Label Identifing the data: "},
59 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
64 * List Information Menu
67 Menu list_info_menu = {
70 "List Information Menu",
74 "Show all lists to which a given member belongs",
77 "Show all items which a given member can administer",
79 SIMPLEFUNC("groups", "Show all lists which are groups",
81 SIMPLEFUNC("public", "Show all public mailing lists",
82 ListAllPublicMailLists),
83 SIMPLEFUNC("maillists", "Show all mailing lists",
92 Menu list_member_menu = {
93 ListmaintMemberMenuEntry,
94 ListmaintMemberMenuExit,
98 SIMPLEFUNC("add", "Add a member to this list", AddMember),
99 SIMPLEFUNC("remove", "Remove a member from this list", DeleteMember),
100 SIMPLEFUNC("all", "Show the members of this list", ListAllMembers),
101 SIMPLEFUNC("user", "Show the members of type USER", ListUserMembers),
102 SIMPLEFUNC("list", "Show the members of type LIST", ListListMembers),
103 SIMPLEFUNC("string", "Show the members of type STRING",
105 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
110 * Machine To Cluster Mappings Menu
113 Menu mappings_menu = {
116 "Machine To Cluster Mappings Menu",
119 { MachineToClusterMap, NULLMENU, 3, {
120 {"map", "Show Machine to cluster mapping"},
121 {"name", "Machine's Name: "},
122 {"cluster", "Cluster's Name: "},
124 { AddMachineToCluster, NULLMENU, 3, {
125 {"addcluster","Add machines to a clusters"},
126 {"name","Machine's Name: "},
127 {"cluster", "Cluster's Name: "},
129 { RemoveMachineFromCluster, NULLMENU, 3, {
130 {"remcluster", "Remove machines from clusters"},
131 {"name","Machine's Name: "},
132 {"cluster", "Cluster's Name: "},
134 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode),
139 * Post Office Box Menu
145 "Post Office Box Menu",
148 {GetUserPOBox, NULLMENU, 2, {
149 {"show", "Show a user's post office box"},
150 {"login name", "login name: "}
152 {SetUserPOBox, NULLMENU, 2, {
153 {"set", "Set (Add or Change) a user's post office box"},
154 {"login name", "login name: "}
156 {RemoveUserPOBox, NULLMENU, 2, {
157 {"remove", "Remove a user's post office box"},
158 {"login name", "login name: "}
160 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
174 SIMPLEFUNC("shdef", "Show default user quota (in KB)", ShowDefaultQuota),
175 {ChangeDefaultQuota, NULLMENU, 2, {
176 {"chdef", "Change default user quota"},
177 {"quota", "New quota (in KB): "}
179 SIMPLEFUNC("getquota", "Show a quota on a filesystem",
181 SIMPLEFUNC("getfsquotas", "Show all quotas on a filesystem",
183 SIMPLEFUNC("addquota", "Add a new disk quota on a filesystem",
185 SIMPLEFUNC("upquota", "Change a quota on a filesystem",
187 SIMPLEFUNC("delquota", "Delete a quota on a filesystem",
189 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
193 Menu fsgroup_menu = {
196 "Filesystem Group Menu",
199 { GetFS, NULLMENU, 2, {
200 {"get", "Get individual or group filesystem information"},
201 {"name", "Name of Filesystem: "}
203 { AddFSToGroup, NULLMENU, 3, {
204 {"add", "Add a new filesystem to an FS group"},
205 {"group", "FS Group name:"},
206 {"filsys", "Filesystem name:"}
208 { RemoveFSFromGroup, NULLMENU, 3, {
209 {"remove", "Remove a filesystem from an FS group"},
210 {"group", "FS Group name:"},
211 {"filsys", "Filesystem name:"}
213 { ChangeFSGroupOrder, NULLMENU, 2, {
214 {"order", "Change the order of filesystems in a group"},
215 {"group", "FS Group name:"}
217 SIMPLEFUNC("help", "Info on Filesystem Groups", FSGroupHelp),
218 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
222 Menu service_menu = {
228 { showserv, NULLMENU, 2, {
229 { "showserv", "Show service information" },
230 { "service name", "Name of service: " },
232 { addserv, NULLMENU, 2, {
233 { "addserv", "Add a new service" },
234 { "service name", "Name of service: " },
236 { updateserv, NULLMENU, 2, {
237 { "updateserv", "Update service information" },
238 { "service name", "Name of service: " },
240 { resetsrverr, NULLMENU, 2, {
241 { "resetsrverr", "Reset service error" },
242 { "service name", "Name of service: " },
244 { resetsrvc, NULLMENU, 2, {
245 { "resetsrvc", "Reset service state" },
246 { "service name", "Name of service: " },
248 { delserv, NULLMENU, 2, {
249 { "delserv", "Delete service info" },
250 { "service name", "Name of service: " },
261 { showhost, NULLMENU, 3, {
262 { "showhost", "Show service/host tuple information" },
263 { "service name", "Name of service: " },
264 { "host name", "Name of machine: " },
266 { addhost, NULLMENU, 3, {
267 { "addhost", "Add a new service/host tuple" },
268 { "service name", "Name of service: " },
269 { "host name", "Name of machine: " },
271 { updatehost, NULLMENU, 3, {
272 { "updatehost", "Update a service/host tuple" },
273 { "service name", "Name of service: " },
274 { "host name", "Name of machine: " },
276 { resethosterr, NULLMENU, 3, {
277 { "resethosterr", "Reset service/host error" },
278 { "service name", "Name of service: " },
279 { "host name", "Name of machine: " },
281 { resethost, NULLMENU, 3, {
282 { "resethost", "Reset service/host state" },
283 { "service name", "Name of service: " },
284 { "host name", "Name of machine: " },
286 { sethostor, NULLMENU, 3, {
287 { "override", "Set service/host override" },
288 { "service name", "Name of service: " },
289 { "host name", "Name of machine: " },
291 { delhost, NULLMENU, 3, {
292 { "delhost", "Delete service/host tuple" },
293 { "service name", "Name of service: " },
294 { "host name", "Name of machine: " },
299 /* ------------------------- First Tier Menus ------------------------- */
305 Menu cluster_menu = {
311 { ShowClusterInfo, NULLMENU, 2, {
312 {"show", "Get cluster information"},
313 {"name", "Cluster's Name: "}
315 { AddCluster, NULLMENU, 2, {
316 {"add", "Add a new cluster"},
317 {"name","Cluster's Name: "},
319 { UpdateCluster, NULLMENU, 2, {
320 {"update", "Update cluster information"},
321 {"name","Cluster's Name: "},
323 { DeleteCluster, NULLMENU, 2, {
324 {"delete", "Delete this cluster"},
325 {"name", "Cluster's Name: "}
327 SUBMENU("mappings","Machine To Cluster Mappings Menu", &mappings_menu),
328 SUBMENU("c_data","Cluster Data Menu", &cluster_data_menu),
329 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
337 Menu filesys_menu = {
343 { GetFS, NULLMENU, 2, {
344 {"get", "Get Filesystem Name Information"},
345 {"name", "Name of Filesystem: "}
347 { AddFS, NULLMENU, 2, {
348 {"add", "Add New Filesystem to Database"},
351 { ChangeFS, NULLMENU, 2, {
352 {"change", "Update Filesystem Information"},
355 { DeleteFS, NULLMENU, 2, {
356 {"delete", "Delete Filesystem"},
357 {"name", "Filesystem Name: "}
359 SUBMENU("fsgroups", "File System Groups Menu", &fsgroup_menu),
360 { GetFSAlias, NULLMENU, 2, {
361 {"check", "Check An Association"},
362 {"name", "alias name : "}
364 { CreateFSAlias, NULLMENU, 2, {
365 {"alias", "Associate with a Filesystem"},
366 {"name", "alias name : "},
368 { DeleteFSAlias, NULLMENU, 2, {
369 {"unalias", "Disassociate from a Filesystem"},
370 {"name", "alias name : "},
372 SUBMENU("quotas","Quota Menu", "a_menu),
373 /* SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode), */
374 /* SIMPLEFUNC("help", "Help ..", AttachHelp) */
382 Menu machine_menu = {
388 { ShowMachineInfo, NULLMENU, 2, {
389 {"show","Get machine information"},
390 {"name","Machine's Name: "}
392 { AddMachine, NULLMENU, 2, {
393 {"add","Add a new machine"},
394 {"name","Machine's Name: "},
396 { UpdateMachine, NULLMENU, 2, {
397 {"update","Update machine information"},
398 {"name","Machine's Name: "},
400 { DeleteMachine, NULLMENU, 2, {
401 {"delete","Delete this machine"},
402 {"name","Machine's Name: "}
404 SUBMENU("mappings","Machine To Cluster Mappings Menu", &mappings_menu),
405 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
419 { ShowListInfo, NULLMENU, 2, {
420 {"show", "Display information about a list"},
421 {"list name", "Name of list: "}
423 { NULLFUNC, &list_member_menu, 2, {
424 {"add", "Create new List"},
425 {"list name", "Name of list: "}
427 { UpdateList, NULLMENU, 2, {
428 {"update", "Update characteristics of a list"},
429 {"list name", "Name of list: "}
431 { DeleteList, NULLMENU, 2, {
432 {"delete", "Delete a List"},
433 {"list name", "Name of list: "}
435 SIMPLEFUNC("query_remove",
436 "Interactively remove an item from all lists",
437 InterRemoveItemFromLists),
438 { NULLFUNC, &list_member_menu, 2, {
439 {"members", "Member Menu - Change/Show Members of a List."},
440 {"list name", "Name of list: "}
442 SUBMENU("list_info", "List Info Menu",
444 SUBMENU("quotas","Quota Menu", "a_menu),
445 /* SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode), */
446 SIMPLEFUNC("help", "Print Help", ListHelp)
454 Menu nfsphys_menu = {
460 { ShowNFSService, NULLMENU, 2, {
461 { "show", "Show an NFS server" },
462 { "machine", "Machine Name: "},
464 { AddNFSService, NULLMENU, 2, {
465 { "add", "Add NFS server" },
466 { "machine", "Machine Name: "},
468 { UpdateNFSService, NULLMENU, 2, {
469 { "update", "Update NFS server"},
470 { "machine", "Machine Name: "},
472 { DeleteNFSService, NULLMENU, 2, {
473 { "delete", "Delete NFS server"},
474 {"machine", "Machine Name: "},
476 SUBMENU("quotas","Quota Menu", "a_menu),
477 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode),
478 /* SIMPLEFUNC("help", "Help", NFSHelp), */
485 "User Kerberos Mapping Menu",
488 { GetKrbmap, NULLMENU, 3, {
489 { "show", "Show Kerberos Mappings" },
490 { "user", "User login name: " },
491 { "principal", "Principal: " },
493 { AddKrbmap, NULLMENU, 3, {
494 { "add", "Add Kerberos Mapping" },
495 { "user", "User login name: " },
496 { "principal", "Principal (this is case sensitive): " },
498 { DeleteKrbmap, NULLMENU, 3, {
499 { "delete", "Delete Kerberos Mapping" },
500 { "user", "User login name: " },
501 { "principal", "Principal: " },
516 {ShowUserByLogin, NULLMENU, 2, {
517 {"login", "Show user information by login name"},
518 {"login name", "Desired login name: "}
520 {ShowUserByName, NULLMENU, 3, {
521 {"name", "Show user information by name"},
522 {"first", "First name: "},
523 {"last", "Last name: "}
525 {ShowUserByClass, NULLMENU, 2, {
526 {"class", "Show names of users in a given class"},
527 {"login name", "Desired class: "}
529 {UpdateUser, NULLMENU, 2, {
530 {"modify", "Change all user fields"},
531 {"login", "Login name: "}
533 SIMPLEFUNC("adduser", "Add a new user to the database",
535 SIMPLEFUNC("register", "Register a user", RegisterUser),
536 {DeactivateUser, NULLMENU, 2, {
537 {"deactivate", "Deactivate user"},
538 {"login", "Login name: "},
540 {DeleteUser, NULLMENU, 2, {
541 {"expunge", "Expunge user"},
542 {"login", "Login name: "}
544 SUBMENU("pobox", "Post Office Box Menu", &pobox_menu),
545 SUBMENU("quota", "Quota Menu", "a_menu),
546 SUBMENU("krbmap", "User Kerberos Mappings", &krbmap_menu),
556 SIMPLEFUNC("enable", "Enable/disable DCM", EnableDcm),
557 SUBMENU("service", "DCM Service Menu", &service_menu),
558 SUBMENU("host", "DCM Host Menu", &host_menu),
559 SIMPLEFUNC("active", "Display entries currently being updated",
561 SIMPLEFUNC("failed", "Display entries with errors to be reset",
563 SIMPLEFUNC("dcm", "Invoke a DCM update now", Dcm),
568 * Printcap Printer Menu
571 Menu printer_menu = {
577 { GetPcap, NULLMENU, 2, {
578 {"get", "Get Printcap Entry Information"},
579 {"name", "Name of Printer: "}
581 { AddPcap, NULLMENU, 2, {
582 {"add", "Add New Printcap Entry to Database"},
585 { ChngPcap, NULLMENU, 2, {
586 {"change", "Update Printer Information"},
589 { DeletePcap, NULLMENU, 2, {
590 {"delete", "Delete Printcap Entry"},
591 {"name", "Printer Name: "}
598 * Palladium Printer Menu
601 Menu palladium_menu = {
607 { GetPalladium, NULLMENU, 2, {
608 {"get", "Get Palladium Server/Supervisor Information"},
609 {"name", "Name of Printer: "}
611 { AddPalladium, NULLMENU, 2, {
612 {"add", "Add New Palladium Server/Supervisor to Database"},
613 {"name", "Supervisor/server name: "},
615 { ChngPalladium, NULLMENU, 2, {
616 {"change", "Update Palladium Server/Supervisor Information"},
619 { DeletePalladium, NULLMENU, 2, {
620 {"delete", "Delete Palladium Server/Supervisor Entry"},
621 {"name", "Printer Name: "}
623 { ShowPalladiumAlias, NULLMENU, 3, {
624 {"getprinter", "Show Logical Printers"},
625 {"newname", "Printer name: "},
626 {"server", "Supervisor or Server name: "},
628 { AddPalladiumAlias, NULLMENU, 3, {
629 {"addprinter", "Add Logical Printer"},
630 {"newname", "New printer: "},
631 {"server", "Supervisor or Server name: "},
633 { DeletePalladiumAlias, NULLMENU, 3, {
634 {"delprinter", "Remove Logical Printer"},
635 {"newname", "Printer name: "},
636 {"server", "Supervisor or Server name: "},
653 { GetZephyr, NULLMENU, 2, {
654 {"get", "Get Zephyr Class Information"},
655 {"name", "Name of class: "}
657 { AddZephyr, NULLMENU, 2, {
658 {"add", "Add New Zephyr class restrictions"},
659 {"name", "Class name: "},
661 { ChngZephyr, NULLMENU, 2, {
662 {"change", "Update Zephyr class restrictions"},
663 {"name", "Class name: "},
665 { DeleteZephyr, NULLMENU, 2, {
666 {"delete", "Delete Zephyr class restriction"},
667 {"name", "Class Name: "}
669 { NULLFUNC, &list_member_menu, 2, {
670 {"members", "Member Menu - Change/Show Members of a List."},
671 {"list name", "Name of list: "}
684 "Miscellaneous Menu",
687 SIMPLEFUNC("statistics", "Show database statistics", TableStats),
688 SIMPLEFUNC("clients", "Show active Moira clients", ShowClients),
689 { ShowValue, NULLMENU, 2, {
690 {"getval", "Show a database variable value"},
691 {"name", "variable name: "},
693 { ShowAlias, NULLMENU, 3, {
694 {"getalias", "Show an alias relation"},
695 {"name", "Alias name: "},
696 {"type", "Alias type: "},
702 /* ------------------------- Root Menu ------------------------- */
708 Menu moira_top_menu = {
711 "Moira Database Manipulation",
714 SUBMENU("cluster","Cluster Menu",&cluster_menu),
715 SUBMENU("filesys","Filesystem Menu", &filesys_menu),
716 SUBMENU("list","Lists and Group Menu", &list_menu),
717 SUBMENU("machine","Machine Menu",&machine_menu),
718 SUBMENU("nfs","NFS Physical Menu", &nfsphys_menu),
719 SUBMENU("user","User Menu", &user_menu),
720 SUBMENU("printcap", "Printcap Printer Menu", &printer_menu),
721 SUBMENU("palladium", "Palladium Printer Menu", &palladium_menu),
722 SUBMENU("zephyr", "Zephyr ACLS Menu", &zephyr_menu),
723 SUBMENU("dcm", "DCM Menu", &dcm_menu),
724 SUBMENU("misc", "Miscellaneous Menu", &misc_menu)