[1912] in Moira
new network status
daemon@ATHENA.MIT.EDU (Garry Zacheiss)
Tue Jan 15 15:35:46 2002
Message-Id: <200201152035.PAA10750@brad-majors.mit.edu>
To: moiradev@MIT.EDU
Date: Tue, 15 Jan 2002 15:35:39 -0500
From: Garry Zacheiss <zacheiss@MIT.EDU>
Apparently GigE private subnets will be an option sometime in
the near future. Here are patches to the client and server to deal with
them.
Index: include/moira_site.h
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/include/moira_site.h,v
retrieving revision 1.42
diff -u -r1.42 moira_site.h
--- moira_site.h 2001/10/17 21:33:13 1.42
+++ moira_site.h 2002/01/15 20:26:22
@@ -345,13 +345,14 @@
#define SN_END 15
/* Subnet statuses */
-#define SNET_STATUS_RESERVED 0
-#define SNET_STATUS_BILLABLE 1
-#define SNET_STATUS_PRIVATE_10MBPS 2
-#define SNET_STATUS_PRIVATE_100MBPS 3
-#define SNET_STATUS_PRIVATE_OTHER 4
-#define SNET_STATUS_RESNET 5
-#define SNET_STATUS_INFRASTRUCTURE 6
+#define SNET_STATUS_RESERVED 0
+#define SNET_STATUS_BILLABLE 1
+#define SNET_STATUS_PRIVATE_10MBPS 2
+#define SNET_STATUS_PRIVATE_100MBPS 3
+#define SNET_STATUS_PRIVATE_OTHER 4
+#define SNET_STATUS_RESNET 5
+#define SNET_STATUS_INFRASTRUCTURE 6
+#define SNET_STATUS_PRIVATE_1000MBPS 7
/* User Information queries, v3 */
Index: clients/moira/cluster.c
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/clients/moira/cluster.c,v
retrieving revision 1.60
diff -u -r1.60 cluster.c
--- cluster.c 2001/09/24 08:02:02 1.60
+++ cluster.c 2002/01/15 20:32:55
@@ -90,7 +90,8 @@
"Private, 100 Mbps (3)",
"Private, Other (4)",
"Resnet (5)",
- "Infrastructure (6)"
+ "Infrastructure (6)",
+ "Private, 1000 Mbps (7)"
};
static char *MacState(int state)
@@ -109,7 +110,7 @@
{
static char buf[BUFSIZ];
- if (state < 0 || state > 6)
+ if (state < 0 || state > 7)
{
sprintf(buf, "Unknown (%d)", state);
return buf;
@@ -298,7 +299,8 @@
if (stat)
com_err(program_name, stat, " looking up subnet info");
else if (atoi(((char **)elem2->q_data)[2]) == SNET_STATUS_PRIVATE_10MBPS ||
- atoi(((char **)elem2->q_data)[2]) == SNET_STATUS_PRIVATE_100MBPS)
+ atoi(((char **)elem2->q_data)[2]) == SNET_STATUS_PRIVATE_100MBPS ||
+ atoi(((char **)elem2->q_data)[2]) == SNET_STATUS_PRIVATE_1000MBPS)
{
Put_message("");
sprintf(buf, "Warning: This host is on a private subnet.");
@@ -734,7 +736,7 @@
if (isdigit(info[SN_STATUS][0]))
break;
Put_message("Valid status numbers:");
- for (i = 0; i < 7; i++)
+ for (i = 0; i < 8; i++)
Put_message(subnet_states[i]);
}
if (GetValueFromUser("Network's contact", &info[SN_CONTACT]) == SUB_ERROR)
Index: clients/stella/stella.c
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/clients/stella/stella.c,v
retrieving revision 1.17
diff -u -r1.17 stella.c
--- stella.c 2001/09/24 08:02:24 1.17
+++ stella.c 2002/01/15 20:24:49
@@ -695,7 +695,8 @@
if (status)
com_err(whoami, status, "while getting subnet information");
if (atoi(argv[SN_STATUS]) == SNET_STATUS_PRIVATE_10MBPS ||
- atoi(argv[SN_STATUS]) == SNET_STATUS_PRIVATE_100MBPS)
+ atoi(argv[SN_STATUS]) == SNET_STATUS_PRIVATE_100MBPS ||
+ atoi(argv[SN_STATUS]) == SNET_STATUS_PRIVATE_1000MBPS)
{
fprintf(stderr, "\nWarning: This host is on a private subnet.\n");
fprintf(stderr, "Billing information shown is superseded by billing information for the subnet.\n");
Index: server/qsetup.pc
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/server/qsetup.pc,v
retrieving revision 2.48
diff -u -r2.48 qsetup.pc
--- qsetup.pc 2001/12/14 21:05:35 2.48
+++ qsetup.pc 2002/01/15 20:26:50
@@ -264,7 +264,8 @@
* number.
*/
if (status == SNET_STATUS_PRIVATE_10MBPS ||
- status == SNET_STATUS_PRIVATE_100MBPS)
+ status == SNET_STATUS_PRIVATE_100MBPS ||
+ status == SNET_STATUS_PRIVATE_1000MBPS)
{
EXEC SQL SELECT account_number FROM accountnumbers
WHERE account_number = :account_number;