]> andersk Git - moira.git/blame - clients/moira/menus.c
added DCM & printcap menus
[moira.git] / clients / moira / menus.c
CommitLineData
402461ad 1#if (!defined(lint) && !defined(SABER))
08345b74 2 static char rcsid_module_c[] = "$Header$";
3#endif lint
4
0a2c64cb 5/* This is the file menus.c for the SMS Client, which allows a nieve
6 * user to quickly and easily maintain most parts of the SMS database.
7 * It Contains: All menu definitions.
08345b74 8 *
9 * Created: 4/11/88
10 * By: Chris D. Peterson
11 *
12 * $Source$
13 * $Author$
14 * $Header$
15 *
0a2c64cb 16 * Copyright 1988 by the Massachusetts Institute of Technology.
08345b74 17 *
18 * For further information on copyright and distribution
19 * see the file mit-copyright.h
20 */
21
22#include <stdio.h>
23#include <menu.h>
461c03b6 24
08345b74 25#include "mit-copyright.h"
0a2c64cb 26#include "defs.h"
27#include "f_defs.h"
461c03b6 28#include "globals.h"
08345b74 29
e532b848 30
0a2c64cb 31/* ------------------------- Second Tier Menus ------------------------- */
32
33/*
34 * Cluster Data Menu
08345b74 35 */
36
0a2c64cb 37Menu cluster_data_menu = {
38 NULLFUNC,
39 NULLFUNC,
40 "Cluster Data Menu",
461c03b6 41 4,
08345b74 42 {
0a2c64cb 43 { ShowClusterData, NULLMENU, 3, {
44 {"show", "Show Data on a given Cluster"},
45 {"clus", "Cluster's Name: "},
46 {"label", "Label Identifing the data: "},
08345b74 47 } },
0a2c64cb 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: "},
08345b74 53 } },
0a2c64cb 54 { RemoveClusterData, NULLMENU, 4, {
55 {"delete", "Remove Data to a given Cluster"},
56 {"clus", "Cluster's Name: "},
57 {"label", "Label Identifing the data: "},
58 {"data", "The data to be removed: "},
59 } },
60 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
08345b74 61 }
62};
63
0a2c64cb 64/*
65 * List Information Menu
66 */
67
68Menu list_info_menu = {
69 NULLFUNC,
70 NULLFUNC,
71 "List Information Menu",
72 5,
73 {
74 SIMPLEFUNC("member",
75 "Show all lists to which a given member belongs",
76 ListByMember),
77 SIMPLEFUNC("admin",
78 "Show all items which a given member can administer",
79 ListByAdministrator),
80 SIMPLEFUNC("groups", "Show all lists which are groups",
81 ListAllGroups),
82 SIMPLEFUNC("public", "Show all public mailing lists",
83 ListAllPublicMailLists),
84 SIMPLEFUNC("maillists", "Show all mailing lists",
85 ListAllMailLists)
86 }
87};
88
89/*
90 * List Member Menu
91 */
92
93Menu list_member_menu = {
94 ListmaintMemberMenuEntry,
95 ListmaintMemberMenuExit,
96 NULL,
97 7,
98 {
99 SIMPLEFUNC("add", "Add a member to this list", AddMember),
100 SIMPLEFUNC("remove", "Remove a member from this list", DeleteMember),
101 SIMPLEFUNC("all", "Show the members of this list", ListAllMembers),
102 SIMPLEFUNC("user", "Show the members of type USER", ListUserMembers),
103 SIMPLEFUNC("list", "Show the members of type LIST", ListListMembers),
104 SIMPLEFUNC("string", "Show the members of type STRING",
105 ListStringMembers),
106 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
107 }
08345b74 108};
109
110/*
0a2c64cb 111 * Machine To Cluster Mappings Menu
08345b74 112 */
113
0a2c64cb 114Menu mappings_menu = {
08345b74 115 NULLFUNC,
116 NULLFUNC,
0a2c64cb 117 "Machine To Cluster Mappings Menu",
118 4,
08345b74 119 {
461c03b6 120 { MachineToClusterMap, NULLMENU, 3, {
85ca828a 121 {"map", "Show Machine to cluster mapping"},
122 {"name", "Machine's Name: "},
123 {"cluster", "Cluster's Name: "},
461c03b6 124 } },
08345b74 125 { AddMachineToCluster, NULLMENU, 3, {
85ca828a 126 {"addcluster","Add machines to a clusters"},
08345b74 127 {"name","Machine's Name: "},
85ca828a 128 {"cluster", "Cluster's Name: "},
08345b74 129 } },
85ca828a 130 { RemoveMachineFromCluster, NULLMENU, 3, {
131 {"remcluster", "Remove machines from clusters"},
08345b74 132 {"name","Machine's Name: "},
85ca828a 133 {"cluster", "Cluster's Name: "},
08345b74 134 } },
0a2c64cb 135 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode),
08345b74 136 }
137};
138
0a2c64cb 139/*
140 * Post Office Box Menu
141 */
142
143Menu pobox_menu = {
08345b74 144 NULLFUNC,
145 NULLFUNC,
0a2c64cb 146 "Post Office Box Menu",
147 4,
148 {
149 {GetUserPOBox, NULLMENU, 2, {
150 {"show", "Show a user's post office box"},
151 {"login name", "login name: "}
152 } },
153 {SetUserPOBox, NULLMENU, 2, {
154 {"set", "Set (Add or Change) a user's post office box"},
155 {"login name", "login name: "}
156 } },
157 {RemoveUserPOBox, NULLMENU, 2, {
158 {"remove", "Remove a user's post office box"},
159 {"login name", "login name: "}
160 } },
161 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
162 }
163};
164
165/*
166 * Quota Menu
167 */
168
169Menu quota_menu = {
170 NULLFUNC,
171 NULLFUNC,
172 "Quota Menu",
173 7,
174 {
175 SIMPLEFUNC("shdef", "Show default user quota (in KB)", ShowDefaultQuota),
176 {ChangeDefaultQuota, NULLMENU, 2, {
177 {"chdef", "Change default user quota"},
178 {"quota", "New quota (in KB): "}
179 } },
180 SIMPLEFUNC("shquota", "Show a user's disk quota on a filesytem",
181 ShowUserQuota),
182 SIMPLEFUNC("addquota", "Add a new disk quota for user on a filesytem",
183 AddUserQuota),
184 SIMPLEFUNC("chquota", "Change a user's disk quota on a filesytem",
185 ChangeUserQuota),
186 SIMPLEFUNC("rmquota", "Remove a user's disk quota on a filesytem",
187 RemoveUserQuota),
188 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
189 }
190};
191
e532b848 192Menu service_menu = {
193 NULLFUNC,
194 NULLFUNC,
195 "DCM Service Menu",
196 6,
197 {
198 { showserv, NULLMENU, 2, {
199 { "showserv", "Show service information" },
200 { "service name", "Name of service: " },
201 } },
202 { addserv, NULLMENU, 2, {
203 { "addserv", "Add a new service" },
204 { "service name", "Name of service: " },
205 } },
206 { updateserv, NULLMENU, 2, {
207 { "updateserv", "Update service information" },
208 { "service name", "Name of service: " },
209 } },
210 { resetsrverr, NULLMENU, 2, {
211 { "resetsrverr", "Reset service error" },
212 { "service name", "Name of service: " },
213 } },
214 { resetsrvc, NULLMENU, 2, {
215 { "resetsrvc", "Reset service state" },
216 { "service name", "Name of service: " },
217 } },
218 { delserv, NULLMENU, 2, {
219 { "delserv", "Delete service info" },
220 { "service name", "Name of service: " },
221 } },
222 }
223};
224
225Menu host_menu = {
226 NULLFUNC,
227 NULLFUNC,
228 "DCM Host Menu",
229 7,
230 {
231 { showhost, NULLMENU, 3, {
232 { "showhost", "Show service/host tuple information" },
233 { "service name", "Name of service: " },
234 { "host name", "Name of machine: " },
235 } },
236 { addhost, NULLMENU, 3, {
237 { "addhost", "Add a new service/host tuple" },
238 { "service name", "Name of service: " },
239 { "host name", "Name of machine: " },
240 } },
241 { updatehost, NULLMENU, 3, {
242 { "updatehost", "Update a service/host tuple" },
243 { "service name", "Name of service: " },
244 { "host name", "Name of machine: " },
245 } },
246 { resethosterr, NULLMENU, 3, {
247 { "resethosterr", "Reset service/host error" },
248 { "service name", "Name of service: " },
249 { "host name", "Name of machine: " },
250 } },
251 { resethost, NULLMENU, 3, {
252 { "resethost", "Reset service/host state" },
253 { "service name", "Name of service: " },
254 { "host name", "Name of machine: " },
255 } },
256 { sethostor, NULLMENU, 3, {
257 { "override", "Set service/host override" },
258 { "service name", "Name of service: " },
259 { "host name", "Name of machine: " },
260 } },
261 { delhost, NULLMENU, 3, {
262 { "delhost", "Delete service/host tuple" },
263 { "service name", "Name of service: " },
264 { "host name", "Name of machine: " },
265 } },
266 }
267};
268
0a2c64cb 269/* ------------------------- First Tier Menus ------------------------- */
270
271/*
272 * Cluster Menu
273 */
274
275Menu cluster_menu = {
276 NULLFUNC,
277 NULLFUNC,
278 "Cluster Menu",
85ca828a 279 7,
08345b74 280 {
281 { ShowClusterInfo, NULLMENU, 2, {
85ca828a 282 {"show", "Get cluster information"},
08345b74 283 {"name", "Cluster's Name: "}
284 } },
08345b74 285 { AddCluster, NULLMENU, 2, {
85ca828a 286 {"add", "Add a new cluster"},
08345b74 287 {"name","Cluster's Name: "},
288 } },
289 { UpdateCluster, NULLMENU, 2, {
85ca828a 290 {"update", "Update cluster information"},
08345b74 291 {"name","Cluster's Name: "},
292 } },
08345b74 293 { DeleteCluster, NULLMENU, 2, {
85ca828a 294 {"delete", "Delete this cluster"},
08345b74 295 {"name", "Cluster's Name: "}
296 } },
0a2c64cb 297 SUBMENU("mappings","Machine To Cluster Mappings Menu", &mappings_menu),
298 SUBMENU("c_data","Cluster Data Menu", &cluster_data_menu),
299 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
08345b74 300 }
301};
302
0a2c64cb 303/*
304 * Filesystem Menu
305 */
306
307Menu filesys_menu = {
308 NULLFUNC,
309 NULLFUNC,
310 "Filesystem Menu",
311 10,
08345b74 312 {
0a2c64cb 313 { GetFS, NULLMENU, 2, {
314 {"get", "Get Filesystem Name Information"},
315 {"name", "Name of Filesystem: "}
08345b74 316 } },
0a2c64cb 317 { AddFS, NULLMENU, 2, {
318 {"add", "Add New Filesystem to Database"},
319 {"name", "name: "},
08345b74 320 } },
0a2c64cb 321 { ChangeFS, NULLMENU, 2, {
322 {"change", "Update Filesystem Information"},
323 {"name", "name: "},
324 } },
325 { DeleteFS, NULLMENU, 2, {
326 {"delete", "Delete Filesystem"},
327 {"name", "Filesystem Name: "}
328 } },
329 { GetFSAlias, NULLMENU, 2, {
330 {"check", "Check An Association"},
331 {"name", "alias name : "}
332 } },
333 { CreateFSAlias, NULLMENU, 2, {
334 {"alias", "Associate with a Filesystem"},
335 {"name", "alias name : "},
336 } },
337 { DeleteFSAlias, NULLMENU, 2, {
338 {"unalias", "Disassociate from a Filesystem"},
339 {"name", "alias name : "},
08345b74 340 } },
0a2c64cb 341 SUBMENU("quotas","Quota Menu", &quota_menu),
342 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode),
343 SIMPLEFUNC("help", "Help ..", AttachHelp)
08345b74 344 }
345};
346
347/*
0a2c64cb 348 * Machine Menu
08345b74 349 */
350
0a2c64cb 351Menu machine_menu = {
08345b74 352 NULLFUNC,
353 NULLFUNC,
0a2c64cb 354 "Machine Menu",
355 6,
08345b74 356 {
0a2c64cb 357 { ShowMachineInfo, NULLMENU, 2, {
358 {"show","Get machine information"},
359 {"name","Machine's Name: "}
360 } },
361 { AddMachine, NULLMENU, 2, {
362 {"add","Add a new machine"},
363 {"name","Machine's Name: "},
364 } },
365 { UpdateMachine, NULLMENU, 2, {
366 {"update","Update machine information"},
367 {"name","Machine's Name: "},
368 } },
369 { DeleteMachine, NULLMENU, 2, {
370 {"delete","Delete this machine"},
371 {"name","Machine's Name: "}
372 } },
373 SUBMENU("mappings","Machine To Cluster Mappings Menu", &mappings_menu),
374 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
08345b74 375 }
376};
377
08345b74 378/*
0a2c64cb 379 * List Menu
08345b74 380 */
381
0a2c64cb 382Menu list_menu = {
08345b74 383 NULLFUNC,
384 NULLFUNC,
0a2c64cb 385 "List Menu",
386 10,
08345b74 387 {
08345b74 388 { ShowListInfo, NULLMENU, 2, {
389 {"show", "Display information about a list"},
390 {"list name", "Name of list: "}
391 } },
0a2c64cb 392 { NULLFUNC, &list_member_menu, 2, {
85ca828a 393 {"add", "Create new List"},
402461ad 394 {"list name", "Name of list: "}
85ca828a 395 } },
461c03b6 396 { UpdateList, NULLMENU, 2, {
08345b74 397 {"update", "Update characteristics of a list"},
398 {"list name", "Name of list: "}
399 } },
85ca828a 400 { DeleteList, NULLMENU, 2, {
401 {"delete", "Delete a List"},
402 {"list name", "Name of list: "}
403 } },
461c03b6 404 SIMPLEFUNC("query_remove",
405 "Interactively remove an item from all lists",
406 InterRemoveItemFromLists),
0a2c64cb 407 { NULLFUNC, &list_member_menu, 2, {
408 {"members", "Member Menu - Change/Show Members of a List."},
409 {"list name", "Name of list: "}
410 } },
411 SUBMENU("list_info", "List Info Menu",
412 &list_info_menu),
413 SUBMENU("quotas","Quota Menu", &quota_menu),
414 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode),
415 SIMPLEFUNC("help", "Print Help", ListHelp)
08345b74 416 }
417};
418
419/*
0a2c64cb 420 * NFS Physical Menu
08345b74 421 */
422
0a2c64cb 423Menu nfsphys_menu = {
08345b74 424 NULLFUNC,
425 NULLFUNC,
0a2c64cb 426 "NFS Physical Menu",
427 6,
08345b74 428 {
075fe5bb 429 { ShowNFSService, NULLMENU, 2, {
85ca828a 430 { "show", "Show an NFS server" },
08345b74 431 { "machine", "Machine Name: "},
08345b74 432 } },
075fe5bb 433 { AddNFSService, NULLMENU, 2, {
08345b74 434 { "add", "Add NFS server" },
435 { "machine", "Machine Name: "},
08345b74 436 } },
075fe5bb 437 { UpdateNFSService, NULLMENU, 2, {
08345b74 438 { "update", "Update NFS server"},
439 { "machine", "Machine Name: "},
08345b74 440 } },
075fe5bb 441 { DeleteNFSService, NULLMENU, 2, {
08345b74 442 { "delete", "Delete NFS server"},
443 {"machine", "Machine Name: "},
08345b74 444 } },
0a2c64cb 445 SUBMENU("quotas","Quota Menu", &quota_menu),
08345b74 446 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode),
461c03b6 447/* SIMPLEFUNC("help", "Help", NFSHelp), */
08345b74 448 }
449};
450
451/*
0a2c64cb 452 * User Menu
08345b74 453 */
454
0a2c64cb 455Menu user_menu = {
075fe5bb 456 NULLFUNC,
457 NULLFUNC,
0a2c64cb 458 "User Menu",
459 11,
08345b74 460 {
461 {ShowUserByLogin, NULLMENU, 2, {
462 {"login", "Show user information by login name"},
463 {"login name", "Desired login name: "}
464 } },
465 {ShowUserByName, NULLMENU, 3, {
075fe5bb 466 {"name", "Show user information by name"},
08345b74 467 {"first", "First name: "},
468 {"last", "Last name: "}
469 } },
470 {ShowUserByClass, NULLMENU, 2, {
075fe5bb 471 {"class", "Show names of users in a given class"},
08345b74 472 {"login name", "Desired class: "}
473 } },
075fe5bb 474 {UpdateUser, NULLMENU, 2, {
08345b74 475 {"modify", "Change all user fields"},
476 {"login", "Login name: "}
477 } },
478/* SIMPLEFUNC("chpw", "Change a user's password", change_user_password), */
075fe5bb 479 SIMPLEFUNC("adduser", "Add a new user to the database",
480 AddNewUser),
481 SIMPLEFUNC("register", "Register a user", RegisterUser),
a444fefe 482 {DeactivateUser, NULLMENU, 2, {
483 {"deactivate", "Deactivate user"},
484 {"login", "Login name: "},
485 } },
08345b74 486 {DeleteUser, NULLMENU, 2, {
a444fefe 487 {"expunge", "Expunge user"},
08345b74 488 {"login", "Login name: "}
489 } },
a444fefe 490/* {DeleteUserByUid, NULLMENU, 2, {
08345b74 491 {"udelete", "Delete user by uid"},
492 {"uid", "User ID (not MIT ID!): "}
a444fefe 493 } }, */
0a2c64cb 494 SUBMENU("pobox", "Post Office Box Menu", &pobox_menu),
495 SUBMENU("quota", "Quota Menu", &quota_menu),
496 SIMPLEFUNC("verbose", "Toggle Verbosity of Delete", ToggleVerboseMode)
08345b74 497 }
498};
499
e532b848 500Menu dcm_menu = {
501 NULLFUNC,
502 NULLFUNC,
503 "DCM Menu",
504 6,
505 {
506 SIMPLEFUNC("enable", "Enable/disable DCM", EnableDcm),
507 SUBMENU("service", "DCM Service Menu", &service_menu),
508 SUBMENU("host", "DCM Host Menu", &host_menu),
509 SIMPLEFUNC("active", "Display entries currently being updated",
510 InProgress),
511 SIMPLEFUNC("failed", "Display entries with errors to be reset",
512 DcmFailed),
513 SIMPLEFUNC("dcm", "Invoke a DCM update now", Dcm),
514 }
515};
516
517/*
518 * Printer Menu
519 */
520
521Menu printer_menu = {
522 NULLFUNC,
523 NULLFUNC,
524 "Printer Menu",
525 4,
526 {
527 { GetPcap, NULLMENU, 2, {
528 {"get", "Get Printcap Entry Information"},
529 {"name", "Name of Printer: "}
530 } },
531 { AddPcap, NULLMENU, 2, {
532 {"add", "Add New Printcap Entry to Database"},
533 {"name", "name: "},
534 } },
535 { ChngPcap, NULLMENU, 2, {
536 {"change", "Update Printer Information"},
537 {"name", "name: "},
538 } },
539 { DeletePcap, NULLMENU, 2, {
540 {"delete", "Delete Printcap Entry"},
541 {"name", "Printer Name: "}
542 } }
543 }
544};
545
0a2c64cb 546/* ------------------------- Root Menu ------------------------- */
547
08345b74 548/*
85ca828a 549 * Sms top menu
08345b74 550 */
551
85ca828a 552Menu sms_top_menu = {
08345b74 553 NULLFUNC,
554 NULLFUNC,
85ca828a 555 "Sms Database Manipulation",
e532b848 556 8,
08345b74 557 {
0a2c64cb 558 SUBMENU("cluster","Cluster Menu",&cluster_menu),
559 SUBMENU("filesys","Filesystem Menu", &filesys_menu),
560 SUBMENU("list","Lists and Group Menu", &list_menu),
561 SUBMENU("machine","Machine Menu",&machine_menu),
562 SUBMENU("nfs","NFS Physical Menu", &nfsphys_menu),
e532b848 563 SUBMENU("user","User Menu", &user_menu),
564 SUBMENU("printer", "Printer Menu", &printer_menu),
565 SUBMENU("dcm", "DCM Menu", &dcm_menu)
08345b74 566 }
567};
This page took 0.169699 seconds and 5 git commands to generate.