]> andersk Git - moira.git/blame - clients/moira/cluster.c
This version while still untested compiles and links almost
[moira.git] / clients / moira / cluster.c
CommitLineData
08345b74 1#ifndef lint
2 static char rcsid_module_c[] = "$Header$";
3#endif lint
4
5/* This is the file cluseter.c for allmaint, the SMS client that allows
6 * a user to maintaint most important parts of the SMS database.
7 * It Contains:
8 *
9 * Created: 4/22/88
10 * By: Chris D. Peterson
11 * Based upon: Clusermaint.c by marcus: 87/07/22
12 *
13 * $Source$
14 * $Author$
15 * $Header$
16 *
17 * Copyright 1987, 1988 by the Massachusetts Institute of Technology.
18 *
19 * For further information on copyright and distribution
20 * see the file mit-copyright.h
21 */
22
23/* BTW: for anyone who cares MCD is short for Machine, Cluster, Data. */
24
08345b74 25#include <stdio.h>
26#include <strings.h>
27#include <sms.h>
28#include <menu.h>
29
461c03b6 30#include "mit-copyright.h"
31#include "allmaint.h"
32#include "allmaint_funcs.h"
33#include "globals.h"
34#include "infodefs.h"
08345b74 35
461c03b6 36#define MACHINE 0
37#define CLUSTER 1
38#define DATA 2
39#define MAP 3
08345b74 40
41/* Function Name: PrintMachInfo
42 * Description: This function Prints out the Machine info in
43 * a coherent form.
44 * Arguments: info - array of information about a machine.
45 * Returns: none.
46 */
47
48void
49PrintMachInfo(info)
50char ** info;
51{
52 char buf[BUFSIZ];
53
54 sprintf(buf, "Machine: %s\tType: %s", info[M_NAME], info[M_TYPE]);
55 Put_message(buf);
56 sprintf(buf, "Last Modified at %s, by %s with %s",info[M_MODTIME],
57 info[M_MODBY], info[M_MODWITH]);
58 Put_message(buf);
59}
60
61/* Function Name: PrintClusterInfo
62 * Description: This function Prints out the cluster info
63 * in a coherent form.
64 * Arguments: info - array of information about a cluster.
65 * Returns: none.
66 */
67
68void
69PrintClusterInfo(info)
70char ** info;
71{
72 char buf[BUFSIZ];
73
74 sprintf(buf, "Cluster: %s", info[C_NAME]);
461c03b6 75 Put_message(buf);
08345b74 76 sprintf(buf,"Description: %-20s, Location: %-20s", info[C_DESCRIPT],
77 info[C_LOCATION]);
78 Put_message(buf);
79 sprintf(buf, "Last Modified at %s, by %s with %s",info[C_MODTIME],
80 info[C_MODBY], info[C_MODWITH]);
81 Put_message(buf);
82}
83
84/* Function Name: PrintClusterData
85 * Description: Prints the Data on a cluster
86 * Arguments: info a pointer to the data array.
87 * Returns: none
88 */
89
90void
91PrintClusterData(info)
92char ** info;
93{
94 char buf[BUFSIZ];
461c03b6 95 sprintf(buf, "Cluster: %-30s Label: %-20s Data: %-20s",
08345b74 96 info[CD_NAME], info[CD_LABEL], info[CD_DATA]);
97 Put_message(buf);
98}
99
461c03b6 100/* Function Name: PrintMCMap
101 * Description: Prints the data about a machine to cluster mapping.
102 * Arguments: info a pointer to the data array.
103 * Returns: none
104 */
105
106void
107PrintMCMap(info)
108char ** info;
109{
110 char buf[BUFSIZ];
111 sprintf(buf, "Cluster: %-30s Machine: %-20s",
112 info[MAP_CLUSTER], info[MAP_MACHINE]);
113 Put_message(buf);
114}
115
08345b74 116/* Function Name: GetMCInfo.
117 * Description: This function stores info about a machine.
118 * type - type of data we are trying to retrieve.
119 * name1 - the name of argv[0] for the call.
120 * name2 - the name of argv[1] for the call.
121 * Returns: the top element of a queue containing the data or NULL.
122 */
123
124struct qelem *
461c03b6 125GetMCInfo(type, name1, name2)
08345b74 126int type;
127char * name1, *name2;
128{
129
130 int stat;
131 struct qelem * elem = NULL;
132 char * args[2];
133
134 switch (type) {
461c03b6 135 case MACHINE:
08345b74 136 if ( (stat = sms_query("get_machine", 1, &name1,
137 StoreInfo, &elem)) != 0) {
461c03b6 138 com_err(program_name, stat, " in get_machine.");
08345b74 139 return(NULL);
140 }
141 break;
461c03b6 142 case CLUSTER:
08345b74 143 if ( (stat = sms_query("get_cluster", 1, &name1,
144 StoreInfo, &elem)) != 0) {
461c03b6 145 com_err(program_name, stat, " in get_cluster.");
08345b74 146 return(NULL);
147 }
148 break;
461c03b6 149 case MAP:
150 args[MAP_MACHINE] = name1;
151 args[MAP_CLUSTER] = name2;
08345b74 152 if ( (stat = sms_query("get_machine_to_cluster_map", 2, args,
153 StoreInfo, &elem)) != 0) {
461c03b6 154 com_err(program_name, stat, " in get_machine_to_cluster_map.");
08345b74 155 return(NULL);
156 }
157 break;
461c03b6 158 case DATA:
159 args[CD_NAME] = name1;
160 args[CD_LABEL] = name2;
08345b74 161 if ( (stat = sms_query("get_cluster_data", 2, args,
162 StoreInfo, &elem)) != 0) {
461c03b6 163 com_err(program_name, stat, " in get_cluster_data.");
08345b74 164 return(NULL);
165 }
166 }
167 return(QueueTop(elem));
168}
169
461c03b6 170/* Function Name: AskMCDInfo.
08345b74 171 * Description: This function askes the user for information about a
172 * machine and saves it into a structure.
173 * Arguments: info - a pointer the information to ask about
461c03b6 174 * type - type of information - MACHINE
175 * CLUSTER
176 * DATA
08345b74 177 * name - T/F : change the name of this type.
178 * Returns: none.
179 */
180
461c03b6 181char **
182AskMCDInfo(info, type, name)
183char ** info;
08345b74 184int type;
185Bool name;
186{
461c03b6 187 char temp_buf[BUFSIZ], *newname;
08345b74 188
189 switch (type) {
461c03b6 190 case MACHINE:
08345b74 191 sprintf(temp_buf, "Changing the information for the Machine %s.",
192 name);
193 break;
461c03b6 194 case CLUSTER:
08345b74 195 sprintf(temp_buf, "Changing the information for the Cluster %s.",
196 name);
197 break;
461c03b6 198 case DATA:
08345b74 199 sprintf(temp_buf, "Changing the Data for the Cluster %s.",
200 name);
201 break;
202 }
203 Put_message(temp_buf);
204
205 if (name) {
08345b74 206 switch (type) {
461c03b6 207 case MACHINE:
208 newname = Strsave(info[M_NAME]);
08345b74 209 GetValueFromUser("The new name for this machine? ",
461c03b6 210 &newname);
08345b74 211 break;
461c03b6 212 case CLUSTER:
213 newname = Strsave(info[C_NAME]);
08345b74 214 GetValueFromUser("The new name for this cluster? ",
461c03b6 215 &newname);
08345b74 216 break;
217 default:
461c03b6 218 Put_message("Unknown type in AskMCDInfo, programmer botch");
219 return(NULL);
08345b74 220 }
221 }
222
223 switch(type) {
461c03b6 224 case MACHINE:
225 GetValueFromUser("Machine's Type:", &info[M_TYPE]);
08345b74 226 FreeAndClear(&info[M_MODTIME], TRUE);
227 FreeAndClear(&info[M_MODBY], TRUE);
228 FreeAndClear(&info[M_MODWITH], TRUE);
229 break;
461c03b6 230 case CLUSTER:
231 GetValueFromUser("Cluster's Description:", &info[C_DESCRIPT]);
232 GetValueFromUser("Cluster's Location:", &info[C_LOCATION]);
08345b74 233 FreeAndClear(&info[C_MODTIME], TRUE);
234 FreeAndClear(&info[C_MODBY], TRUE);
235 FreeAndClear(&info[C_MODWITH], TRUE);
236 break;
461c03b6 237 case DATA:
238 GetValueFromUser("Label defining this data?", &info[CD_LABEL]);
239 GetValueFromUser("The data itself ? ", &info[CD_DATA]);
08345b74 240 break;
241 }
242
243/*
244 * Slide the newname into the #2 slot, this screws up all future references
245 * to this list.
246 */
247 if (name)
248 SlipInNewName(info, newname);
249
250 return(info);
251}
252
253/* ----------- Machine Menu ----------- */
254
255/* Function Name: ShowMachineInfo
256 * Description: This function shows the information about a machine.
257 * Arguments: argc, argv - the name of the machine in argv[1].
258 * Returns: DM_NORMAL.
259 */
260
261/* ARGSUSED */
262int
263ShowMachineInfo(argc, argv)
264int argc;
265char **argv;
266{
267 char **info;
268 struct qelem *elem, *top;
269
461c03b6 270 top = elem = GetMCInfo(MACHINE, CanonicalizeHostname(argv[1]),
271 (char *) NULL);
08345b74 272
273 while (elem != NULL) {
274 info = (char **) elem->q_data;
275 PrintMachInfo(info);
276 elem = elem->q_forw;
277 }
278
279 FreeQueue(top);
280 return(DM_NORMAL);
281}
282
283/* Function Name: AddMachine
284 * Description: This function adds a new machine to the database.
285 * Arguments: argc, argv - the name of the machine in argv[1].
286 * Returns: DM_NORMAL.
287 */
288
289/* ARGSUSED */
290int
291AddMachine(argc, argv)
292int argc;
293char **argv;
294{
295 char **args, *info[MAX_ARGS_SIZE], *name;
296 int stat;
297/*
298 * Check to see if this machine already exists.
299 */
300 name = CanonicalizeHostname(argv[1]);
301
302 if ( (stat = sms_query("get_machine", 1, &name, NullFunc, NULL)) == 0) {
303 Put_message("This machine already exists.");
304 return(DM_NORMAL);
305 }
461c03b6 306 else if (stat != SMS_NO_MATCH) {
307 com_err(program_name, stat, " in AddMachine.");
08345b74 308 return(DM_NORMAL);
309 }
310
311 info[0] = name;
461c03b6 312 args = AskMCDInfo(info, MACHINE, FALSE);
08345b74 313
314/*
315 * Actually create the new Machine.
316 */
317
318 if ( (stat = sms_query("add_machine", CountArgs(args),
461c03b6 319 args, Scream, NULL)) != 0)
320 com_err(program_name, stat, " in AddMachine.");
08345b74 321
322 FreeInfo(info);
323 return(DM_NORMAL);
324}
325
326/* Function Name: UpdateMachine
327 * Description: This function adds a new machine to the database.
328 * Arguments: argc, argv - the name of the machine in argv[1].
329 * Returns: DM_NORMAL.
330 */
331
332/* ARGSUSED */
333int
334UpdateMachine(argc, argv)
335int argc;
336char **argv;
337{
461c03b6 338 struct qelem *elem, *top;
08345b74 339 int stat;
340
461c03b6 341 elem = top = GetMCInfo( MACHINE, CanonicalizeHostname(argv[1]),
342 (char *) NULL);
08345b74 343
344 while (elem != NULL) {
461c03b6 345 char ** args;
346 char ** info = (char **) elem->q_data;
347 args = AskMCDInfo(info, MACHINE, TRUE);
08345b74 348 if ( (stat = sms_query("update_machine", CountArgs(args),
349 args, Scream, NULL)) != 0)
461c03b6 350 com_err(program_name, stat, " in UpdateMachine.");
08345b74 351 elem = elem->q_forw;
352 }
353
354 FreeQueue(top);
355 return(DM_NORMAL);
356}
357
358/* Function Name: DeleteMachine
359 * Description: This function removes a machine from the data base.
360 * Arguments: argc, argv - the machines name int argv[1].
361 * Returns: DM_NORMAL.
362 */
363
364/* ARGSUSED */
365int
461c03b6 366DeleteMachine(argc, argv)
08345b74 367int argc;
368char **argv;
369{
370 int stat;
461c03b6 371 char * args[2], *name, temp_buf[BUFSIZ];
372 struct qelem *top, *elem = NULL;
08345b74 373
374 name = CanonicalizeHostname(argv[1]);
375
376/* Should probabally check for wildcards, none allowed. */
377/* Perhaps we should remove the cluster if it has no machine now. */
378
461c03b6 379 args[0] = name;
08345b74 380 args[1] = "*";
461c03b6 381 stat = sms_query("get_machine_to_cluster_map", 2, args, StoreInfo, &elem);
382 if (stat && stat != SMS_NO_MATCH) {
383 com_err(program_name, stat, " in DeleteMachine.");
384 return(DM_NORMAL);
385 }
386 if (stat == 0) {
387 top = elem;
388 while (elem != NULL) {
389 sprintf(temp_buf, "%s is assigned to cluster %s.",
390 args[0], args[1]);
391 Put_message(temp_buf);
392 if ( YesNoQuestion(
393 "Would you like to remove it from this cluster?", FALSE)) {
394 if ( (stat = sms_query( "delete_machine_from_cluster",
395 1, args, Scream, NULL)) != 0)
396 com_err(program_name, stat,
397 " in delete_machine_from_cluster.");
398 else {
399 Put_message("Aborting...");
400 FreeQueue(top);
401 return(DM_NORMAL);
402 }
403 }
404 elem = elem->q_forw;
08345b74 405 }
406 }
407 if(Confirm("Are you sure that you want to delete this machine?")) {
461c03b6 408 if ( (stat = sms_query("delete_machine", 1, &name, Scream, NULL)) != 0)
409 com_err(program_name, stat, " in DeleteMachine.");
08345b74 410 }
411 else
412 Put_message("Operation aborted.");
413
414 return(DM_NORMAL);
415}
416
417/* Function Name: AddMachineToCluster
418 * Description: This function adds a machine to a cluster
419 * Arguments: argc, argv - The machine name is argv[1].
420 * The cluster name in argv[2].
421 * Returns: DM_NORMAL.
422 */
423
424/* ARGSUSED */
425int
426AddMachineToCluster(argc, argv)
427int argc;
428char ** argv;
429{
430 int stat;
431
461c03b6 432 if ( (stat = sms_query("add_machine_to_cluster", 2, argv + 1,
08345b74 433 Scream, NULL) != 0))
461c03b6 434 com_err(program_name, stat, " in AddMachineToCluster.");
08345b74 435
436 return(DM_NORMAL);
437}
438
439/* Function Name: RemoveMachineFromCluster
440 * Description: Removes this machine form a specific cluster.
441 * Arguments: argc, argv - Name of machine in argv[1].
442 * Returns: none.
443 */
444
445/* ARGSUSED */
446int
447RemoveMachineFromCluster(argc, argv)
448int argc;
449char ** argv;
450{
451 int stat, ans;
452 struct qelem *elem, *top;
461c03b6 453 char ** info, buf[BUFSIZ];
08345b74 454
461c03b6 455 elem = top = GetMCInfo(CLUSTER, CanonicalizeHostname(argv[1]), "*");
08345b74 456
457 Put_message("This machine is the following clusters:");
458 while (elem != NULL) {
461c03b6 459 info = (char **) elem->q_data;
08345b74 460 Put_message(info[MAP_CLUSTER]);
461 elem = elem->q_forw;
462 }
463 elem = top;
464
465 if ( Confirm("Remove this machine from ** ALL ** these clusters?") ) {
466 while (elem != NULL) { /* delete all */
461c03b6 467 info = (char **) elem->q_data;
08345b74 468 if ( (stat =sms_query("delete_machine_from_cluster", 2,
469 info, Scream, NULL)) != 0 )
461c03b6 470 com_err(program_name, stat, " in delete_machine_from_cluster");
08345b74 471 elem = elem->q_forw;
472 }
473 }
474 else
475 while (elem != NULL) { /* query delete. */
461c03b6 476 info = (char **) elem->q_data;
08345b74 477 sprintf(buf, "Remove %13s from the cluster %30s? (y/n/q)",
478 info[MAP_MACHINE], info[MAP_CLUSTER]);
479 ans = YesNoQuitQuestion(buf, FALSE);
480 if (ans == TRUE)
481 if ( (stat =sms_query("delete_machine_from_cluster", 2,
482 info, Scream, NULL)) != 0 )
461c03b6 483 com_err(program_name, stat, " in delete_machine_from_cluster");
08345b74 484 else if (ans != FALSE) /* quit. or ^C */
485 break;
486 elem = elem->q_forw;
487 }
488
489 FreeQueue(top);
490 return(DM_NORMAL);
491}
492
493/* ---------- Cluster Menu -------- */
494
495/* Function Name: ShowClusterInfo
496 * Description: Gets information about a cluser given its name.
497 * Arguments: argc, argc - the name of the cluster in in argv[1].
498 * Returns: DM_NORMAL.
499 */
500
501/* ARGSUSED */
502int
461c03b6 503ShowClusterInfo(argc, argv)
08345b74 504int argc;
505char ** argv;
506{
507 char **info;
508 struct qelem *elem, *top;
509
461c03b6 510 top = elem = GetMCInfo( MACHINE, CanonicalizeHostname(argv[1]),
511 (char *) NULL);
08345b74 512 while (elem != NULL) {
513 info = (char **) elem->q_data;
514 PrintClusterInfo(info);
515 elem = elem->q_forw;
516 }
517 FreeQueue(top);
518 return(DM_NORMAL);
519}
520
521/* Function Name: AddCluster
522 * Description: Creates a new cluster.
523 * Arguments: argc, argv - the name of the new cluster is argv[1].
524 * Returns: DM_NORMAL.
525 */
526
527/* ARGSUSED */
528int
529AddCluster(argc, argv)
530int argc;
531char ** argv;
532{
533 char **args, *info[MAX_ARGS_SIZE], *name;
534 int stat;
535/*
536 * Check to see if this machine already exists.
537 */
538 name = argv[1];
539
540 if ( (stat = sms_query("get_cluster", 1, &name, NullFunc, NULL)) == 0) {
541 Put_message("This cluster already exists.");
542 return(DM_NORMAL);
543 }
461c03b6 544 else if (stat != SMS_NO_MATCH) {
545 com_err(program_name, stat, " in AddCluster.");
08345b74 546 return(DM_NORMAL);
547 }
548
549 info[0] = name;
461c03b6 550 args = AskMCDInfo(info, CLUSTER, FALSE);
08345b74 551
552/*
553 * Actually create the new Cluster.
554 */
555
556 if ( (stat = sms_query("add_cluster", CountArgs(args),
557 args, Scream, NULL)) != 0)
461c03b6 558 com_err(program_name, stat, " in AddCluster.");
08345b74 559
560 FreeInfo(info);
561 return(DM_NORMAL);
562}
563
564/* Function Name: UpdateCluster
565 * Description: This Function Updates a cluster
566 * Arguments: name of the cluster in argv[1].
567 * Returns: DM_NORMAL.
568 */
569
570/* ARGSUSED */
571int
572UpdateCluster(argc, argv)
573int argc;
574char ** argv;
575{
576 struct qelem *elem, *top;
577 char **args, **info;
578 int stat;
579
461c03b6 580 elem = top = GetMCInfo( CLUSTER, argv[1], (char *) NULL );
08345b74 581
582 while (elem != NULL) {
583 info = (char **) elem->q_data;
461c03b6 584 args = AskMCDInfo(info, CLUSTER, TRUE);
08345b74 585 if ( (stat = sms_query("update_cluter", CountArgs(args),
586 args, Scream, NULL)) != 0)
461c03b6 587 com_err(program_name, stat, " in UpdateCluster.");
08345b74 588 elem = elem->q_forw;
589 }
590
591 FreeQueue(top);
592 return(DM_NORMAL);
593}
594
595/* Function Name: DeleteCluster
596 * Description: This function removes a cluster from the database.
597 * Arguments: argc, argv - the name of the cluster is stored in argv[1].
598 * Returns: DM_NORMAL.
599 */
600
601/* ARGSUSED */
602int
461c03b6 603DeleteCluster(argc, argv)
08345b74 604int argc;
605char ** argv;
606{
461c03b6 607 char * args[3], temp_buf[BUFSIZ];
608 int stat;
08345b74 609
610/* Should probabally check for wildcards, none allowed. */
611
612 args[MAP_MACHINE] = "*";
613 args[MAP_CLUSTER] = argv[1];
614
461c03b6 615 stat = sms_query("get_machine_to_cluster_map", 2, args,
616 NullFunc, (char *) NULL);
617 if (stat & stat != SMS_NO_MATCH) {
618 com_err(program_name, stat, " in DeleteCluster.");
619 return(DM_NORMAL);
620 }
08345b74 621 if (stat != SMS_NO_MATCH) {
461c03b6 622 sprintf(temp_buf, "Cluster %s still has machines in it.",argv[1]);
08345b74 623 Put_message(temp_buf);
461c03b6 624 if ( YesNoQuestion("Would you like a list? (y/n)", TRUE) == TRUE ) {
08345b74 625 args[0] = "foo"; /* not used. */
626 args[1] = "*";
627 args[2] = argv[1];
628 MachineToClusterMap(3, args);
629 }
630 return(DM_NORMAL);
631 }
632 if(Confirm("Are you sure that you want to delete this cluster? ")) {
633 if ( (stat = sms_query("delete_cluster",
634 1, &args[MAP_CLUSTER], Scream, NULL)) != 0)
461c03b6 635 com_err(program_name, stat, " in DeleteCluster.");
08345b74 636 }
637 else
638 Put_message("Operation aborted.");
639
640 return(DM_NORMAL);
641}
642
643/* ----------- Cluster Data Menu -------------- */
644
645/* Function Name: ShowClusterData
646 * Description: This function shows the services for one cluster.
647 * Arguments: argc, argv - The name of the cluster is argv[1].
461c03b6 648 * The label of the data in argv[2].
08345b74 649 * Returns: DM_NORMAL.
650 */
651
652int
653ShowClusterData(argc, argv)
654int argc;
655char ** argv;
656{
657 struct qelem *elem, *top;
658 char **info;
659
461c03b6 660 top = elem = GetMCInfo(DATA, argv[1], argv[2]);
08345b74 661 while (elem != NULL) {
662 info = (char **) elem->q_data;
663 PrintClusterData(info);
461c03b6 664 elem = elem->q_forw;
08345b74 665 }
666 FreeQueue(top);
667 return(DM_NORMAL);
668}
669
670/* Function Name: AddClusterData
671 * Description: This function adds some data to the cluster.
672 * Arguments: argv, argc: argv[1] - the name of the cluster.
673 * argv[2] - the label of the data.
674 * argv[3] - the data.
675 * Returns: DM_NORMAL.
676 */
677
678/* ARGSUSED */
679int
680AddClusterData(argc, argv)
681int argc;
682char ** argv;
683{
461c03b6 684 int stat;
685
08345b74 686 if( (stat = sms_query("add_cluster_data", 3, argv + 1,
687 Scream, (char *) NULL)) != 0)
461c03b6 688 com_err(program_name, stat, " in AddClusterData.");
08345b74 689
690}
691
461c03b6 692/* Function Name: RemoveClusterData
693 * Description: This function removes data on a given cluster.
08345b74 694 * Arguments: argv, argc: argv[1] - the name of the cluster.
695 * argv[2] - the label of the data.
696 * argv[3] - the data.
697 * Returns: DM_NORMAL.
698 */
699
700/* ARGSUSED */
461c03b6 701int
702RemoveClusterData(argc, argv)
08345b74 703int argc;
704char ** argv;
705{
706 int stat;
707
708 if(Confirm("Do you really want to delete this data?")) {
709 if( (stat = sms_query("delete_cluster_data", 3, argv + 1,
710 Scream, (char *) NULL)) != 0)
461c03b6 711 com_err(program_name, stat, " in DeleteClusterData.");
08345b74 712 } else
713 Put_message("Operation aborted.\n");
714
715 return(DM_NORMAL);
716}
717
718/* Perhaps an interactive delete cluster data would be nice. */
719
720/* Function Name: MachineToClusterMap
721 * Description: This Retrieves the mapping between machine and cluster
722 * Arguments: argc, argv - argv[1] -> machine name or wildcard.
723 * argv[2] -> cluster name or wildcard.
724 * Returns: none.
725 */
726
727/* ARGSUSED */
728int
729MachineToClusterMap(argc,argv)
730int argc;
731char **argv;
732{
461c03b6 733 struct qelem *elem, *top;
08345b74 734
461c03b6 735 top = elem = GetMCInfo(MAP, CanonicalizeHostname(argv[1]), argv[2]);
08345b74 736
461c03b6 737 while (elem != NULL) {
738 char ** info = (char **) elem->q_data;
739 PrintMCMap(info);
740 elem = elem->q_forw;
741 }
742
743 FreeQueue(top);
744 return(DM_NORMAL);
745}
08345b74 746
461c03b6 747/* Function Name: MachinesInCluster
748 * Description: Shows all machines in a give cluster.
749 * Arguments: argv, argc - name of cluster in argv[1].
750 * Returns: DM_NORMAL;
751 */
752
753/* ARGSUSED */
754int
755MachinesInCluster(argv,argc)
756int argc;
757char **argv;
758{
759 char *info[10];
760 info[0] = argv[0];
761 info[2] = argv[1];
762 info[1] = "*";
763 return(MachineToClusterMap(3, info));
08345b74 764}
765
766/*
767 * Local Variables:
768 * mode: c
769 * c-indent-level: 4
770 * c-continued-statement-offset: 4
771 * c-brace-offset: -4
772 * c-argdecl-indent: 4
773 * c-label-offset: -4
774 * End:
775 */
776
777
778
This page took 0.590872 seconds and 5 git commands to generate.