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", "name (user/group/course): "}
70 { CreateFSAlias, NULLMENU, 2, {
71 {"alais", "Associate with a Filesystem."},
72 {"name", "name (user/course/project): "},
74 { DeleteFSAlias, NULLMENU, 2, {
75 {"unalias", "Disassociate from a Filesystem."},
76 {"name", "name (user/course/project): "},
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 this machine to a cluster."},
116 {"name","Machine's Name: "},
117 {"cluster", "Cluster's Name:"},
119 { RemoveMachineFromCluster, NULLMENU, 2, {
120 {"RemoveCluster", "Remove this machine from a cluster."},
121 {"name","Machine's Name: "},
126 Menu clustermaint_cluster_menu = {
129 "Cluster Information",
132 { ShowClusterInfo, NULLMENU, 2, {
133 {"Show", "Get cluster information."},
134 {"name", "Cluster's Name: "}
136 { MachinesInCluster, NULLMENU, 2, {
137 {"Machines", "List all machines in a cluster."},
138 {"clus", "Cluster's Name: "}
140 { AddCluster, NULLMENU, 2, {
141 {"add", "Add a new cluster."},
142 {"name","Cluster's Name: "},
144 { UpdateCluster, NULLMENU, 2, {
145 {"update", "Update cluster information."},
146 {"name","Cluster's Name: "},
148 { DeleteCluster, NULLMENU, 2, {
149 {"delete", "Delete this cluster."},
150 {"name", "Cluster's Name: "}
155 Menu clustermaint_data_menu= {
158 "Cluster Data Maintenence",
161 { ShowClusterData, NULLMENU, 3, {
162 {"show_one", "Show Data on a given Cluster"},
163 {"clus", "Cluster's Name: "},
164 {"label", "Label Identifing the data"},
166 { AddClusterData, NULLMENU, 4, {
167 {"add", "Add Data to a given Cluster"},
168 {"clus", "Cluster Name: "},
169 {"label", "Label Identifing the data"},
170 {"data", "The data to be added"},
172 { RemoveClusterData, NULLMENU, 4, {
173 {"delete", "Remove Data to a given Cluster"},
174 {"clus", "Cluster's Name: "},
175 {"label", "Label Identifing the data"},
176 {"data", "The data to be removed"},
181 Menu clustermaint_top_menu = {
184 "Cluster Maintenence",
187 SUBMENU("machine", "Work on Machines", &clustermaint_machine_menu),
188 SUBMENU("cluster", "Work on Clusters", &clustermaint_cluster_menu),
189 SUBMENU("service", "Service Clusters", &clustermaint_data_menu),
190 {MachineToClusterMap, NULLMENU, 3, {
191 {"map", "Machine to Cluster Mapping"},
192 {"machine", "Machine Name: "},
193 {"clus", "Cluster Name: "}
195 SIMPLEFUNC("verbose", "Toggle Delete Confirmation", ToggleVerboseMode),
203 /* Commenting out all DCM maint stuff.
205 Menu dcmmaint_service_menu = {
206 dcmmaint_service_menu_entry,
207 dcmmaint_service_menu_exit,
211 SIMPLEFUNC("show", "Show fields of service", show_service),
212 SIMPLEFUNC("interval", "Change the interval field", change_interval),
213 SIMPLEFUNC("target_path", "Change the target_path field",
215 SIMPLEFUNC("script", "Change the script field", change_script),
217 "Change the date of the latest generation of the db file",
222 Menu dcmmaint_host_info_menu = {
223 dcmmaint_host_info_menu_entry,
224 dcmmaint_host_info_menu_exit,
228 SIMPLEFUNC("show", "Show values of entry", show_host_info),
229 SIMPLEFUNC("last_time", "Change the last_time field", change_last_time),
230 SIMPLEFUNC("success", "Change the success field", change_success),
231 SIMPLEFUNC("override", "Change the override field", change_override),
232 SIMPLEFUNC("enable", "Change the enable field", change_enable),
233 SIMPLEFUNC("value1", "Change the value1 field", change_value1),
234 SIMPLEFUNC("value2", "Change the value2 field", change_value2),
235 SIMPLEFUNC("rvdacls", "Change the RVD ACLs (for RVD servers only)",
240 Menu dcmmaint_top_menu = {
243 "Data Control Manager Maintenance",
246 SUBMENU("hi_change", "Modify a service-host entry",
247 &dcmmaint_host_info_menu),
248 SIMPLEFUNC("hi_add", "Create new service-host entry", do_host_info),
249 SIMPLEFUNC("hi_delete", "Remove a service-host entry", do_host_info),
250 SIMPLEFUNC("hi_list", "List service-host entries", do_host_info),
251 SUBMENU("s_change", "Modify info for an existing service",
252 &dcmmaint_service_menu),
253 SIMPLEFUNC("s_add", "Create new service", do_service),
254 SIMPLEFUNC("s_delete", "Remove a service", do_service),
255 SIMPLEFUNC("s_list", "List services", do_service),
256 SIMPLEFUNC("help", "How to use this program", instructions)
260 Commenting out all DCM maint stuff. */
266 Menu listmaint_list_menu = {
273 "List all lists to which a given member belongs",
275 SIMPLEFUNC("administrator",
276 "List all lists which a given user can administer",
277 ListByAdministrator),
278 SIMPLEFUNC("groups", "List all lists which are groups",
280 SIMPLEFUNC("public", "List all public mailing lists",
281 ListAllPublicMailLists),
282 SIMPLEFUNC("maillists", "List all mailing lists",
287 Menu listmaint_member_menu = {
288 ListmaintMemberMenuEntry,
289 ListmaintMemberMenuExit,
293 SIMPLEFUNC("add", "Add a member to the list",
295 SIMPLEFUNC("delete", "Delete a member from the list",
297 SIMPLEFUNC("all", "Show the members of the list",
299 SIMPLEFUNC("user", "Show the members of type USER",
301 SIMPLEFUNC("list", "Show the members of type LIST",
303 SIMPLEFUNC("string", "Show the members of type STRING",
308 Menu listmaint_top_menu = {
311 "List Maintenance Menu",
314 { NULLFUNC, &listmaint_member_menu, 2, {
315 {"add", "Create new List"},
316 {"list name", "Name of list: "}
318 { DeleteList, NULLMENU, 2, {
319 {"delete", "Delete a List"},
320 {"list name", "Name of list: "}
322 { ShowListInfo, NULLMENU, 2, {
323 {"show", "Display information about a list"},
324 {"list name", "Name of list: "}
326 { UpdateList, NULLMENU, 2, {
327 {"update", "Update characteristics of a list"},
328 {"list name", "Name of list: "}
330 { NULLFUNC, &listmaint_member_menu, 2, {
331 {"members", "Change/Display the membership of a list"},
332 {"list name", "Name of list: "}
334 SIMPLEFUNC("query_remove",
335 "Interactively remove an item from all lists",
336 InterRemoveItemFromLists),
337 SUBMENU("list_lists", "Display inventory of lists",
338 &listmaint_list_menu),
339 SIMPLEFUNC("help", "How to use this program", ListHelp)
347 Menu nfsmaint_top_menu = {
353 { ShowNFSService, NULLMENU, 3, {
354 { "show", "Show an NFS server " },
355 { "machine", "Machine Name: "},
356 { "device", "Directory: "}
358 { AddNFSService, NULLMENU, 3, {
359 { "add", "Add NFS server" },
360 { "machine", "Machine Name: "},
361 { "device", "Directory: "}
363 { UpdateNFSService, NULLMENU, 3, {
364 { "update", "Update NFS server"},
365 { "machine", "Machine Name: "},
366 { "device", "Directory: "}
368 { DeleteNFSService, NULLMENU, 3, {
369 { "delete", "Delete NFS server"},
370 {"machine", "Machine Name: "},
371 {"device", "Directory: "}
373 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode),
374 /* SIMPLEFUNC("help", "Help", NFSHelp), */
382 /* Queries have not been implemented yet :-(
387 "Server Maintenence",
390 { getserv, NULLMENU, 2, {
391 {"get", "Services Info"},
392 {"serv", "Service Name: "}
394 { addserv, NULLMENU, 4, {
395 {"add", "Add Service"},
397 {"proto", "Protocol: "},
400 { updserv, NULLMENU, 4, {
401 {"update", "Update Service"},
403 {"proto", "Protocol: "},
406 {delserv, NULLMENU, 3, {
407 {"delete", "Delete Service"},
408 {"serv", "Service Name: "},
409 {"proto", "Protocol: "}
411 { getassc, NULLMENU, 2, {
412 {"get_alias", "Get All Aliases for Service"},
413 {"srv", "Service Name: "}
415 { alas, NULLMENU, 3, {
417 {"srv", "Service Name: "},
420 { alas, NULLMENU, 3, {
421 {"-", "Delete Alias"},
422 {"srv", "Service Name: "},
425 SIMPLEFUNC("toggle", "Toggle Verbosity of Delete", toggle_verb)
438 Menu usermaint_quota_menu = {
441 "Edit User Quotas and Server Machines",
444 SIMPLEFUNC("shdef", "Show default user quota (in KB)", ShowDefaultQuota),
445 {ShowUserQuota, NULLMENU, 2, {
446 {"shquota", "Show a user's quota (in KB)"},
447 {"login", "Login name: "}
449 {ChangeDefaultQuota, NULLMENU, 2, {
450 {"chdef", "Change default user quota"},
451 {"quota", "New quota (in KB): "}
453 {ChangeUserQuota, NULLMENU, 2, {
454 {"chquota", "Change a user's disk quota"},
455 {"user", "Login name: "}
457 {AddUserLocker, NULLMENU, 5, {
458 {"create", "Create a quota & locker for a user"},
459 {"login", "User's login name: "},
460 {"machine", "Server host name: "},
461 {"device", "Directory on host: /[dir]/[login] "},
462 {"quota", "Quota in KB: "}
464 {DeleteUserLocker, NULLMENU, 2, {
465 {"del", "Delete a user's quota & locker - BROKEN 6/10/88 CDP"},
466 {"login", "User's login: "}
471 Menu usermaint_top_menu = {
474 "SMS User Maintenance",
477 {ShowUserByLogin, NULLMENU, 2, {
478 {"login", "Show user information by login name"},
479 {"login name", "Desired login name: "}
481 {ShowUserByName, NULLMENU, 3, {
482 {"full", "Show user information by name."},
483 {"first", "First name: "},
484 {"last", "Last name: "}
486 {ShowUserByClass, NULLMENU, 2, {
487 {"login", "Show names of users in a given class."},
488 {"login name", "Desired class: "}
490 {ModifyUser, NULLMENU, 2, {
491 {"modify", "Change all user fields"},
492 {"login", "Login name: "}
494 /* SIMPLEFUNC("chpw", "Change a user's password", change_user_password), */
495 {ChangeUserPOBox, NULLMENU, 2, {
496 {"chpobox", "Change a user's post office box"},
497 {"login name", "login name: "}
499 /* {enter_user, NULLMENU, 6, {
500 {"enter", "Enter unregistered user"},
501 {"first", "User's first name: "},
502 {"middle", "User's middle initial: "},
503 {"last", "User's last name: "},
504 {"mit_id", "User's MIT ID: "},
505 {"mit_year", "User's MIT year: "}
507 {reg_user, NULLMENU, 5, {
508 {"register", "Register unregistered user"},
509 {"first", "User's first name: "},
510 {"last", "User's last name: "},
511 {"mit_id", "User's MIT ID: "},
512 {"login", "Login name to assign: "}
515 {DeleteUser, NULLMENU, 2, {
516 {"delete", "Delete user"},
517 {"login", "Login name: "}
519 {DeleteUserByUid, NULLMENU, 2, {
520 {"udelete", "Delete user by uid"},
521 {"uid", "User ID (not MIT ID!): "}
523 SUBMENU("quota", "User Quotas", &usermaint_quota_menu),
531 Menu allmaint_top_menu = {
534 "All Maint Top Level Menu",
537 SUBMENU("attachmaint","open the attachmaint menu",&attachmaint_top_menu),
538 SUBMENU("clustermaint","open the clustermaint menu",
539 &clustermaint_top_menu),
540 /* SUBMENU("dcmmaint","open the dcmmaint menu",&dcmmaint_top_menu), */
541 SUBMENU("listmaint","open the listmaint menu",&listmaint_top_menu),
542 SUBMENU("nfsmaint","open the nfsmaint menu",&nfsmaint_top_menu),
543 /* SUBMENU("portmaint","open the portmaint menu",&portmaint_top_menu), */
544 /* SUBMENU("smsmaint","open the smsmaint menu",&smsmaint_top_menu), */
545 SUBMENU("usermaint","open the usermaint menu",&usermaint_top_menu)