]> git.proxmox.com Git - mirror_corosync.git/commitdiff
The testcpg tool now prints IP addresses instead of a hex value indicating the
authorSteven Dake <sdake@redhat.com>
Thu, 6 Jul 2006 22:34:14 +0000 (22:34 +0000)
committerSteven Dake <sdake@redhat.com>
Thu, 6 Jul 2006 22:34:14 +0000 (22:34 +0000)
node id.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1103 fd59a12c-fef9-0310-b244-a6a79926bd2f

test/testcpg.c

index 0249bf36d331d796b7263a6079f6829e5fd1aa60..c5b52a021ddfab71cbc12bf51bfdbc4f470e1ac2 100644 (file)
@@ -42,6 +42,8 @@
 #include <sys/socket.h>
 #include <sys/select.h>
 #include <sys/un.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
 
 #include "saAis.h"
 #include "cpg.h"
@@ -76,18 +78,29 @@ void ConfchgCallback (
        struct cpg_address *joined_list, int joined_list_entries)
 {
        int i;
+       struct in_addr saddr;
 
 
        printf("\nConfchgCallback: group '"); print_cpgname(groupName); printf("'\n");
-       for (i=0; i<joined_list_entries; i++)
-               printf("joined node/pid: %d/%d reason: %d\n", joined_list[i].nodeid, joined_list[i].pid, joined_list[i].reason);
+       for (i=0; i<joined_list_entries; i++) {
+               saddr.s_addr = joined_list[i].nodeid;
+               printf("joined node/pid: %s/%d reason: %d\n",
+                       inet_ntoa (saddr), joined_list[i].pid,
+                       joined_list[i].reason);
+       }
 
-       for (i=0; i<left_list_entries; i++)
-               printf("left node/pid: %d/%d reason: %d\n", left_list[i].nodeid, left_list[i].pid, left_list[i].reason);
+       for (i=0; i<left_list_entries; i++) {
+               saddr.s_addr = left_list[i].nodeid;
+               printf("left node/pid: %s/%d reason: %d\n",
+                       inet_ntoa (saddr), left_list[i].pid,
+                       left_list[i].reason);
+       }
 
        printf("nodes in group now %d\n", member_list_entries);
        for (i=0; i<member_list_entries; i++) {
-               printf("node/pid: %d/%d\n", member_list[i].nodeid, member_list[i].pid);
+               saddr.s_addr = member_list[i].nodeid;
+               printf("node/pid: %s/%d\n",
+                       inet_ntoa (saddr), member_list[i].pid);
        }
 
        /* Is it us??