Rev 451: merged from ronnie in http://samba.org/~tridge/ctdb ------------------------------------------------------------
revno: 451
revision-id: tridge@samba.org-20070604033427-lmkyet1lja4tn7oz
parent: tridge@samba.org-20070603121148-m0aa9lmi03v67ys8
parent: sahlberg@ronnie-20070604032607-vw1k1pwe21lrhh1z
committer: Andrew Tridgell 
branch nick: tridge
timestamp: Mon 2007-06-04 13:34:27 +1000
message:
  merged from ronnie
modified:
  common/ctdb_recover.c          ctdb_recover.c-20070503002147-admmfgt1oj6gexfo-1
  include/ctdb.h                 ctdb.h-20061117234101-o3qt14umlg9en8z0-11
  include/ctdb_private.h         ctdb_private.h-20061117234101-o3qt14umlg9en8z0-13
  tools/ctdb_control.c           ctdb_control.c-20070426122705-9ehj1l5lu2gn9kuj-1
    ------------------------------------------------------------
    revno: 432.1.15
    merged: sahlberg@ronnie-20070604032607-vw1k1pwe21lrhh1z
    parent: sahlberg@ronnie-20070604014836-izop6kwcq59tt8uh
    committer: Ronnie Sahlberg 
    branch nick: ctdb
    timestamp: Mon 2007-06-04 13:26:07 +1000
    message:
      add the ip address to the nodemap structure we pull from a server and 
      display the physical address of a node when we do a ctdb status
    ------------------------------------------------------------
    revno: 432.1.14
    merged: sahlberg@ronnie-20070604014836-izop6kwcq59tt8uh
    parent: sahlberg@ronnie-20070603113045-6ayhg8s3iinomj3n
    parent: tridge@samba.org-20070603121148-m0aa9lmi03v67ys8
    committer: Ronnie Sahlberg 
    branch nick: ctdb
    timestamp: Mon 2007-06-04 11:48:36 +1000
    message:
      merge from tridge
    ------------------------------------------------------------
    revno: 432.1.13
    merged: sahlberg@ronnie-20070603113045-6ayhg8s3iinomj3n
    parent: sahlberg@ronnie-20070603095051-58zzq6mxi86c40zq
    parent: tridge@samba.org-20070603105424-u3l4oixhczc2triy
    committer: Ronnie Sahlberg 
    branch nick: ctdb
    timestamp: Sun 2007-06-03 21:30:45 +1000
    message:
      merge from tridge
=== modified file 'common/ctdb_recover.c'
--- a/common/ctdb_recover.c	2007-06-03 00:29:14 +0000
+++ b/common/ctdb_recover.c	2007-06-04 03:26:07 +0000
@@ -162,6 +162,7 @@
 	node_map = (struct ctdb_node_map *)outdata->dptr;
 	node_map->num = num_nodes;
 	for (i=0; inodes[i]->address.address, &node_map->nodes[i].sin.sin_addr);
 		node_map->nodes[i].vnn   = ctdb->nodes[i]->vnn;
 		node_map->nodes[i].flags = ctdb->nodes[i]->flags;
 	}

=== modified file 'include/ctdb.h'
--- a/include/ctdb.h	2007-06-02 03:31:36 +0000
+++ b/include/ctdb.h	2007-06-04 03:26:07 +0000
@@ -243,17 +243,8 @@
 	TALLOC_CTX *mem_ctx, struct ctdb_dbid_map **dbmap);
 
 
-/* table that contains a list of all nodes a ctdb knows about and their 
-   status
- */
-struct ctdb_node_and_flags {
-	uint32_t vnn;
-	uint32_t flags;
-};
-struct ctdb_node_map {
-	uint32_t num;
-	struct ctdb_node_and_flags nodes[1];
-};
+struct ctdb_node_map;
+
 int ctdb_ctrl_getnodemap(struct ctdb_context *ctdb, 
 		    struct timeval timeout, uint32_t destnode, 
 		    TALLOC_CTX *mem_ctx, struct ctdb_node_map **nodemap);

=== modified file 'include/ctdb_private.h'
--- a/include/ctdb_private.h	2007-06-02 03:31:36 +0000
+++ b/include/ctdb_private.h	2007-06-04 03:26:07 +0000
@@ -869,6 +869,21 @@
 	uint32_t dmaster;
 };
 
+/* table that contains a list of all nodes a ctdb knows about and their 
+   status
+ */
+struct ctdb_node_and_flags {
+	uint32_t vnn;
+	uint32_t flags;
+	struct sockaddr_in sin;
+
+};
+
+struct ctdb_node_map {
+	uint32_t num;
+	struct ctdb_node_and_flags nodes[1];
+};
+
 int32_t ctdb_control_traverse_start(struct ctdb_context *ctdb, TDB_DATA indata, 
 				    TDB_DATA *outdata, uint32_t srcnode);
 int32_t ctdb_control_traverse_all(struct ctdb_context *ctdb, TDB_DATA data, TDB_DATA *outdata);

=== modified file 'tools/ctdb_control.c'
--- a/tools/ctdb_control.c	2007-06-03 09:50:51 +0000
+++ b/tools/ctdb_control.c	2007-06-04 03:26:07 +0000
@@ -292,7 +292,8 @@
 	if(options.machinereadable){
 		printf(":Node:Status:\\n");
 		for(i=0;inum;i++){
-			printf(":%d:%d:\\n", nodemap->nodes[i].vnn,
+			printf(":%d:%s:%d:\\n", nodemap->nodes[i].vnn,
+				inet_ntoa(nodemap->nodes[i].sin.sin_addr),
 				!!nodemap->nodes[i].flags&NODE_FLAGS_CONNECTED);
 		}
 		return 0;
@@ -300,7 +301,8 @@
 
 	printf("Number of nodes:%d\\n", nodemap->num);
 	for(i=0;inum;i++){
-		printf("vnn:%d %s%s\\n", nodemap->nodes[i].vnn,
+		printf("vnn:%d %16s %s%s\\n", nodemap->nodes[i].vnn,
+			inet_ntoa(nodemap->nodes[i].sin.sin_addr),
 			nodemap->nodes[i].flags&NODE_FLAGS_CONNECTED?
 				"CONNECTED":"UNAVAILABLE",
 			nodemap->nodes[i].vnn == myvnn?" (THIS NODE)":"");

