From: fabbione@sourceware.org <fabbione@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/ccs/ccs_tool ccs_tool.c update.c
Date: 3 May 2007 09:06:40 -0000 [thread overview]
Message-ID: <20070503090640.25151.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: fabbione at sourceware.org 2007-05-03 09:06:40
Modified files:
ccs/ccs_tool : ccs_tool.c update.c
Log message:
Readd ipv6 support to ccs_tool update and add verbose option
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/ccs/ccs_tool/ccs_tool.c.diff?cvsroot=cluster&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/ccs/ccs_tool/update.c.diff?cvsroot=cluster&r1=1.10&r2=1.11
--- cluster/ccs/ccs_tool/ccs_tool.c 2006/09/19 13:17:04 1.5
+++ cluster/ccs/ccs_tool/ccs_tool.c 2007/05/03 09:06:39 1.6
@@ -10,6 +10,8 @@
static void print_usage(FILE *stream);
+int globalverbose=0;
+
int main(int argc, char *argv[])
{
optind = 1;
@@ -26,6 +28,10 @@
}
if(optind < argc){
+ if(!strcmp(argv[optind], "-verbose")){
+ optind++;
+ globalverbose=1;
+ }
if(!strcmp(argv[optind], "help")){
print_usage(stdout);
exit(EXIT_SUCCESS);
@@ -106,6 +112,7 @@
" ccs_tool [options] <command>\n"
"\n"
"Options:\n"
+ " -verbose Make some operations print more details.\n"
" -h Print this usage and exit.\n"
" -V Print version information and exit.\n"
"\n"
--- cluster/ccs/ccs_tool/update.c 2007/01/26 22:13:20 1.10
+++ cluster/ccs/ccs_tool/update.c 2007/05/03 09:06:39 1.11
@@ -19,6 +19,9 @@
#include <libxml/tree.h>
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <arpa/inet.h>
#include "comm_headers.h"
#include "ccs.h"
@@ -49,6 +52,8 @@
static int ipv6_connect(struct in6_addr *addr, uint16_t port, int timeout);
static int connect_nb(int fd, struct sockaddr *addr, socklen_t len, int timeout);
+extern int globalverbose;
+
int cluster_base_port = 50008;
static int get_doc_version(xmlDocPtr ldoc)
@@ -659,12 +664,43 @@
static int ccs_open(cman_node_t node, uint16_t port, int timeout)
{
struct in_addr *addr;
- int fd;
+ struct in6_addr *addr6;
+ int fd, family;
+ char buf[INET6_ADDRSTRLEN];
- addr = &(((struct sockaddr_in *)&(node.cn_address.cna_address))->sin_addr);
+ if (globalverbose) {
+ memset(buf, 0, sizeof(buf));
+ printf("Processing node: %s\n", node.cn_name);
+ }
+
+ family = ((struct sockaddr *)&(node.cn_address.cna_address))->sa_family;
+
+ if (family == AF_INET6) {
+
+ addr6 = &(((struct sockaddr_in6 *)&(node.cn_address.cna_address))->sin6_addr);
+
+ if (globalverbose) {
+ inet_ntop(family, addr6, buf, sizeof(buf));
+ printf(" family: ipv6\n address: %s\n", buf);
+ }
+
+ if ((fd = ipv6_connect(addr6, port, timeout)) < 0) {
+ return -1;
+ }
+
+ } else {
+
+ addr = &(((struct sockaddr_in *)&(node.cn_address.cna_address))->sin_addr);
+
+ if (globalverbose) {
+ inet_ntop(family, addr, buf, sizeof(buf));
+ printf(" family: ipv4\n address: %s\n", buf);
+ }
+
+ if ((fd = ipv4_connect(addr, port, timeout)) < 0) {
+ return -1;
+ }
- if ((fd = ipv4_connect(addr, port, timeout)) < 0) {
- return -1;
}
return fd;
reply other threads:[~2007-05-03 9:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070503090640.25151.qmail@sourceware.org \
--to=fabbione@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).