mirror of
https://github.com/samba-team/samba.git
synced 2025-03-01 04:58:35 +03:00
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 (This used to be ctdb commit 660bf30db713f0680acd3f74275ad603b35a0c24)
This commit is contained in:
parent
b00348d869
commit
a3e4e204dc
@ -162,6 +162,7 @@ ctdb_control_getnodemap(struct ctdb_context *ctdb, uint32_t opcode, TDB_DATA ind
|
||||
node_map = (struct ctdb_node_map *)outdata->dptr;
|
||||
node_map->num = num_nodes;
|
||||
for (i=0; i<num_nodes; i++) {
|
||||
inet_aton(ctdb->nodes[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;
|
||||
}
|
||||
|
@ -243,17 +243,8 @@ int ctdb_ctrl_getdbmap(struct ctdb_context *ctdb,
|
||||
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);
|
||||
|
@ -869,6 +869,21 @@ struct ctdb_control_set_dmaster {
|
||||
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);
|
||||
|
@ -292,7 +292,8 @@ static int control_status(struct ctdb_context *ctdb, int argc, const char **argv
|
||||
if(options.machinereadable){
|
||||
printf(":Node:Status:\n");
|
||||
for(i=0;i<nodemap->num;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 @@ static int control_status(struct ctdb_context *ctdb, int argc, const char **argv
|
||||
|
||||
printf("Number of nodes:%d\n", nodemap->num);
|
||||
for(i=0;i<nodemap->num;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)":"");
|
||||
|
Loading…
x
Reference in New Issue
Block a user