[Ocfs2-tools-commits] jlbec commits r1391 - in branches/cman-based: libo2cb libo2cb/include ocfs2_controld

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Thu Aug 16 13:46:51 PDT 2007


Author: jlbec
Date: 2007-08-16 13:46:48 -0700 (Thu, 16 Aug 2007)
New Revision: 1391

Added:
   branches/cman-based/libo2cb/client_proto.c
   branches/cman-based/libo2cb/include/o2cb_client_proto.h
Removed:
   branches/cman-based/ocfs2_controld/client_proto.c
   branches/cman-based/ocfs2_controld/ocfs2_controld.h
Modified:
   branches/cman-based/libo2cb/Makefile
   branches/cman-based/ocfs2_controld/Makefile
   branches/cman-based/ocfs2_controld/action.c
   branches/cman-based/ocfs2_controld/main.c
   branches/cman-based/ocfs2_controld/test_client.c
Log:

Move the ocfs2_controld client protocol into libo2cb.  Here everyone can
get at it.



Modified: branches/cman-based/libo2cb/Makefile
===================================================================
--- branches/cman-based/libo2cb/Makefile	2007-08-16 20:25:21 UTC (rev 1390)
+++ branches/cman-based/libo2cb/Makefile	2007-08-16 20:46:48 UTC (rev 1391)
@@ -36,6 +36,8 @@
 
 endif
 
+PROTO_CFILES = client_proto.c
+
 CFILES = 		\
 	o2cb_abi.c	\
 	o2cb_crc32.c
@@ -44,6 +46,7 @@
 	include/ocfs2_nodemanager.h	\
 	include/ocfs2_heartbeat.h	\
 	include/o2cb_abi.h		\
+	include/o2cb_client_proto.h	\
 	include/o2cb_crc32.h		\
 	include/o2cb.h			\
 	include/sparse_endian_types.h
@@ -57,6 +60,11 @@
 OBJS = $(subst .c,.o,$(CFILES)) \
 	o2cb_err.o
 
+ifneq ($(BUILD_CMAN_SUPPORT),)
+DEFINES += -DHAVE_CMAN
+OBJS += $(subst .c,.o,$(PROTO_CFILES))
+endif
+
 $(OBJS): $(HFILES_GEN)
 
 include/o2cb_err.h: o2cb_err.h
@@ -70,7 +78,7 @@
 	$(AR) r $@ $^
 	$(RANLIB) $@
 
-DIST_FILES = $(CFILES) $(HFILES) o2cb_err.et
+DIST_FILES = $(CFILES) $(PROTO_CFILES) $(HFILES) o2cb_err.et
 
 DIST_RULES = dist-subdircreate
 

Copied: branches/cman-based/libo2cb/client_proto.c (from rev 1388, branches/cman-based/ocfs2_controld/client_proto.c)
===================================================================
--- branches/cman-based/ocfs2_controld/client_proto.c	2007-08-16 01:51:45 UTC (rev 1388)
+++ branches/cman-based/libo2cb/client_proto.c	2007-08-16 20:46:48 UTC (rev 1391)
@@ -0,0 +1,265 @@
+/* -*- mode: c; c-basic-offset: 8; -*-
+ * vim: noexpandtab sw=8 ts=8 sts=0:
+ *
+ * Copyright (C) 2007 Oracle.  All rights reserved.
+ *
+ *  This copyrighted material is made available to anyone wishing to use,
+ *  modify, copy, or redistribute it subject to the terms and conditions
+ *  of the GNU General Public License v.2.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdarg.h>
+#include <unistd.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+
+#include "o2cb_client_proto.h"
+
+struct client_message {
+	char *cm_command;
+	int cm_argcount;
+	char *cm_format;
+};
+
+#define BEGIN_MESSAGES(_list) struct client_message _list[] = {
+#define END_MESSAGES(_list) }; \
+	int _list##_len = sizeof(_list) / sizeof(_list[0]);
+#define DEFINE_MESSAGE(_name, _argcount, _format) [CM_##_name] = {	\
+	.cm_command = #_name, 				\
+	.cm_argcount = _argcount,			\
+	.cm_format = #_name " " _format,		\
+},
+
+BEGIN_MESSAGES(message_list)
+DEFINE_MESSAGE(MOUNT, 5, "%s %s %s %s %s")
+DEFINE_MESSAGE(MRESULT, 4, "%s %s %d %s")
+DEFINE_MESSAGE(UNMOUNT, 3, "%s %s %s")
+DEFINE_MESSAGE(STATUS, 2, "%d %s")
+END_MESSAGES(message_list)
+
+const char *message_to_string(client_message message)
+{
+	return message_list[message].cm_command;
+}
+
+/* No short reads allowed */
+static int full_read(int fd, void *buf, size_t count)
+{
+	size_t off = 0;
+	ssize_t rc = 0;
+
+	while (off < count) {
+		rc = read(fd, buf + off, count - off);
+		if (rc == 0)
+			return -EPIPE;
+		if (rc == -1) {
+			rc = -errno;
+			if (rc == -EINTR)
+				continue;
+			break;
+		}
+		off += rc;
+		rc = 0;
+	}
+	return rc;
+}
+
+/* No short writes allowed */
+static int full_write(int fd, void *buf, size_t count)
+{
+	size_t off = 0;
+	ssize_t rc = 0;
+
+	while (off < count) {
+		rc = write(fd, buf + off, count - off);
+		if (rc == 0)
+			return -EPIPE;
+		if (rc == -1) {
+			rc = -errno;
+			if (rc == -EINTR)
+				continue;
+			break;
+		}
+		off += rc;
+		rc = 0;
+	}
+	return rc;
+}
+
+int send_message(int fd, client_message message, ...)
+{
+	int rc;
+	va_list args;
+	char mbuf[OCFS2_CONTROLD_MAXLINE];
+
+	memset(mbuf, 0, OCFS2_CONTROLD_MAXLINE);
+	va_start(args, message);
+	rc = vsnprintf(mbuf, OCFS2_CONTROLD_MAXLINE,
+		       message_list[message].cm_format, args);
+	va_end(args);
+	if (rc >= OCFS2_CONTROLD_MAXLINE)
+		rc = -E2BIG;
+	else
+		rc = full_write(fd, mbuf, OCFS2_CONTROLD_MAXLINE);
+
+	return rc;
+}
+
+static char *get_args(char *buf, int *argc, char **argv, char sep, int want)
+{
+	char *p = buf, *rp = NULL;
+	int i = 0;
+
+	/* Skip the first word, which is the command */
+	p = strchr(buf, sep);
+	if (!p)
+		goto out;
+	p += 1;
+	argv[0] = p;
+
+	for (i = 1; i < OCFS2_CONTROLD_MAXARGS; i++) {
+		p = strchr(p, sep);
+		if (!p) {
+			rp = p + 1;
+			break;
+		}
+
+		if (want == i)
+			break;
+
+		*p = '\0';
+		p += 1;
+		argv[i] = p;
+	}
+
+out:
+	if (argc)
+		*argc = i;
+
+	/* Terminate the list, the caller expects us to */
+	argv[i] = NULL;
+
+	/* we ended by hitting \0, return the point following that */
+	if (!rp)
+		rp = strchr(buf, '\0') + 1;
+
+	return rp;
+}
+
+int receive_message_full(int fd, char *buf, client_message *message,
+			 char **argv, char **rest)
+{
+	int i, rc, len, count;
+	client_message msg;
+	char *r;
+
+	rc = full_read(fd, buf, OCFS2_CONTROLD_MAXLINE);
+	if (rc)
+		goto out;
+
+	/* Safety first */
+	buf[OCFS2_CONTROLD_MAXLINE - 1] = '\0';
+	fprintf(stderr, "Got messsage \"%s\"\n", buf);
+
+
+	for (i = 0; i < message_list_len; i++) {
+		len = strlen(message_list[i].cm_command);
+		if (!strncmp(buf, message_list[i].cm_command, len) &&
+		    (buf[len] == ' '))
+			break;
+	}
+	if (i >= message_list_len) {
+		rc = -EBADMSG;
+		goto out;
+	}
+	msg = i;
+	
+	r = get_args(buf, &count, argv, ' ',
+		     message_list[msg].cm_argcount);
+	if (count != message_list[msg].cm_argcount) {
+		rc = -EBADMSG;
+	} else {
+		for (i = 0; i < count; i++)
+			fprintf(stderr, "Arg %d: \"%s\"\n", i, argv[i]);
+		if (message)
+			*message = msg;
+		if (rest)
+			*rest = r;
+	}
+
+out:
+	return rc;
+}
+
+int receive_message(int fd, char *buf, client_message *message, char **argv)
+{
+	return receive_message_full(fd, buf, message, argv, NULL);
+}
+
+int client_listen(void)
+{
+	struct sockaddr_un addr;
+	socklen_t addrlen;
+	int rv, s;
+
+	/* we listen for new client connections on socket s */
+
+	s = socket(AF_LOCAL, SOCK_STREAM, 0);
+	if (s < 0) {
+		/* log_error("socket error %d %d", s, errno); */
+		return s;
+	}
+
+	memset(&addr, 0, sizeof(addr));
+	addr.sun_family = AF_LOCAL;
+	strcpy(&addr.sun_path[1], OCFS2_CONTROLD_SOCK_PATH);
+	addrlen = sizeof(sa_family_t) + strlen(addr.sun_path+1) + 1;
+
+	rv = bind(s, (struct sockaddr *) &addr, addrlen);
+	if (rv < 0) {
+		/* log_error("bind error %d %d", rv, errno); */
+		close(s);
+		return rv;
+	}
+
+	rv = listen(s, 5);
+	if (rv < 0) {
+		/* log_error("listen error %d %d", rv, errno); */
+		close(s);
+		return rv;
+	}
+
+	/* log_debug("listen %d", s); */
+
+	return s;
+}
+
+int client_connect(void)
+{
+	struct sockaddr_un sun;
+	socklen_t addrlen;
+	int rv, fd;
+
+	fd = socket(PF_UNIX, SOCK_STREAM, 0);
+	if (fd < 0) {
+		fd = -errno;
+		goto out;
+	}
+
+	memset(&sun, 0, sizeof(sun));
+	sun.sun_family = AF_UNIX;
+	strcpy(&sun.sun_path[1], OCFS2_CONTROLD_SOCK_PATH);
+	addrlen = sizeof(sa_family_t) + strlen(sun.sun_path+1) + 1;
+
+	rv = connect(fd, (struct sockaddr *) &sun, addrlen);
+	if (rv < 0) {
+		close(fd);
+		fd = -errno;
+	}
+ out:
+	return fd;
+}

Copied: branches/cman-based/libo2cb/include/o2cb_client_proto.h (from rev 1389, branches/cman-based/ocfs2_controld/ocfs2_controld.h)
===================================================================
--- branches/cman-based/ocfs2_controld/ocfs2_controld.h	2007-08-16 20:19:51 UTC (rev 1389)
+++ branches/cman-based/libo2cb/include/o2cb_client_proto.h	2007-08-16 20:46:48 UTC (rev 1391)
@@ -0,0 +1,55 @@
+/* -*- mode: c; c-basic-offset: 8; -*-
+ * vim: noexpandtab sw=8 ts=8 sts=0:
+ */
+
+/******************************************************************************
+*******************************************************************************
+**
+**  Copyright (C) 2005 Red Hat, Inc.  All rights reserved.
+**  
+**  This copyrighted material is made available to anyone wishing to use,
+**  modify, copy, or redistribute it subject to the terms and conditions
+**  of the GNU General Public License v.2.
+**
+*******************************************************************************
+******************************************************************************/
+
+/*
+ * Copyright (C) 2007 Oracle.  All rights reserved.
+ *
+ *  This copyrighted material is made available to anyone wishing to use,
+ *  modify, copy, or redistribute it subject to the terms and conditions
+ *  of the GNU General Public License v.2.
+ */
+
+#ifndef __O2CB_CLIENT_PROTO_H
+#define __O2CB_CLIENT_PROTO_H
+
+#ifdef HAVE_CMAN
+
+/* Basic communication properties */
+#define OCFS2_CONTROLD_MAXLINE		256
+#define OCFS2_CONTROLD_MAXARGS		16
+#define OCFS2_CONTROLD_SOCK_PATH	"ocfs2_controld_sock"
+#define OCFS2_FSTYPE "ocfs2"
+
+/* Client messages */
+typedef enum {
+	CM_MOUNT,
+	CM_MRESULT,
+	CM_UNMOUNT,
+	CM_STATUS,
+} client_message;
+
+int client_listen(void);
+int client_connect(void);
+const char *message_to_string(client_message message);
+int send_message(int fd, client_message message, ...);
+int receive_message(int fd, char *buf, client_message *message,
+		    char **argv);
+int receive_message_full(int fd, char *buf, client_message *message,
+			 char **argv, char **rest);
+
+#endif  /* HAVE_CMAN */
+
+#endif  /* __O2CB_CLIENT_PROTO_H */

Modified: branches/cman-based/ocfs2_controld/Makefile
===================================================================
--- branches/cman-based/ocfs2_controld/Makefile	2007-08-16 20:25:21 UTC (rev 1390)
+++ branches/cman-based/ocfs2_controld/Makefile	2007-08-16 20:46:48 UTC (rev 1391)
@@ -24,26 +24,22 @@
            -Wmissing-declarations
 
 DEFINES = -DOCFS2_FLAT_INCLUDES -DO2DLM_FLAT_INCLUDES \
-	  -DO2CB_FLAT_INCLUDES -DVERSION=\"$(VERSION)\"
+	  -DO2CB_FLAT_INCLUDES -DHAVE_CMAN -DVERSION=\"$(VERSION)\"
 
-PROTO_CFILES = client_proto.c
 DAEMON_CFILES = group.c main.c member_cman.c action.c
 
 
-HFILES = ocfs2_controld.h
 UNINST_HFILES = ocfs2_controld_internal.h
 
 TEST_CFILES = test_client.c
 
-DAEMON_OBJS = $(subst .c,.o,$(DAEMON_CFILES) $(PROTO_CFILES))
+DAEMON_OBJS = $(subst .c,.o,$(DAEMON_CFILES))
 TEST_OBJS = $(subst .c,.o,$(TEST_CFILES) $(PROTO_CFILES))
 MANS =
 
 DIST_FILES =				\
-	$(PROTO_CFILES)			\
 	$(DAEMON_CFILES)		\
 	$(TEST_CFILES)			\
-	$(HFILES)			\
 	$(UNINST_HFILES)		\
 	$(addsuffix .in,$(MANS))
 

Modified: branches/cman-based/ocfs2_controld/action.c
===================================================================
--- branches/cman-based/ocfs2_controld/action.c	2007-08-16 20:25:21 UTC (rev 1390)
+++ branches/cman-based/ocfs2_controld/action.c	2007-08-16 20:46:48 UTC (rev 1391)
@@ -28,7 +28,7 @@
 #include <assert.h>
 
 #include "o2cb.h"
-#include "ocfs2_controld.h"
+#include "o2cb_client_proto.h"
 #include "ocfs2_controld_internal.h"
 
 
@@ -97,11 +97,6 @@
 	return mg_statep(mg, MG_JOINING, 0);
 }
 
-static int mg_leaving(struct mountgroup *mg)
-{
-	return mg_statep(mg, MG_LEAVING, 0);
-}
-
 static void notify_mount_client(struct mountgroup *mg)
 {
 	int error = mg->error;

Deleted: branches/cman-based/ocfs2_controld/client_proto.c
===================================================================
--- branches/cman-based/ocfs2_controld/client_proto.c	2007-08-16 20:25:21 UTC (rev 1390)
+++ branches/cman-based/ocfs2_controld/client_proto.c	2007-08-16 20:46:48 UTC (rev 1391)
@@ -1,265 +0,0 @@
-/* -*- mode: c; c-basic-offset: 8; -*-
- * vim: noexpandtab sw=8 ts=8 sts=0:
- *
- * Copyright (C) 2007 Oracle.  All rights reserved.
- *
- *  This copyrighted material is made available to anyone wishing to use,
- *  modify, copy, or redistribute it subject to the terms and conditions
- *  of the GNU General Public License v.2.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdarg.h>
-#include <unistd.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-
-#include "ocfs2_controld.h"
-
-struct client_message {
-	char *cm_command;
-	int cm_argcount;
-	char *cm_format;
-};
-
-#define BEGIN_MESSAGES(_list) struct client_message _list[] = {
-#define END_MESSAGES(_list) }; \
-	int _list##_len = sizeof(_list) / sizeof(_list[0]);
-#define DEFINE_MESSAGE(_name, _argcount, _format) [CM_##_name] = {	\
-	.cm_command = #_name, 				\
-	.cm_argcount = _argcount,			\
-	.cm_format = #_name " " _format,		\
-},
-
-BEGIN_MESSAGES(message_list)
-DEFINE_MESSAGE(MOUNT, 5, "%s %s %s %s %s")
-DEFINE_MESSAGE(MRESULT, 4, "%s %s %d %s")
-DEFINE_MESSAGE(UNMOUNT, 3, "%s %s %s")
-DEFINE_MESSAGE(STATUS, 2, "%d %s")
-END_MESSAGES(message_list)
-
-const char *message_to_string(client_message message)
-{
-	return message_list[message].cm_command;
-}
-
-/* No short reads allowed */
-static int full_read(int fd, void *buf, size_t count)
-{
-	size_t off = 0;
-	ssize_t rc = 0;
-
-	while (off < count) {
-		rc = read(fd, buf + off, count - off);
-		if (rc == 0)
-			return -EPIPE;
-		if (rc == -1) {
-			rc = -errno;
-			if (rc == -EINTR)
-				continue;
-			break;
-		}
-		off += rc;
-		rc = 0;
-	}
-	return rc;
-}
-
-/* No short writes allowed */
-static int full_write(int fd, void *buf, size_t count)
-{
-	size_t off = 0;
-	ssize_t rc = 0;
-
-	while (off < count) {
-		rc = write(fd, buf + off, count - off);
-		if (rc == 0)
-			return -EPIPE;
-		if (rc == -1) {
-			rc = -errno;
-			if (rc == -EINTR)
-				continue;
-			break;
-		}
-		off += rc;
-		rc = 0;
-	}
-	return rc;
-}
-
-int send_message(int fd, client_message message, ...)
-{
-	int rc;
-	va_list args;
-	char mbuf[OCFS2_CONTROLD_MAXLINE];
-
-	memset(mbuf, 0, OCFS2_CONTROLD_MAXLINE);
-	va_start(args, message);
-	rc = vsnprintf(mbuf, OCFS2_CONTROLD_MAXLINE,
-		       message_list[message].cm_format, args);
-	va_end(args);
-	if (rc >= OCFS2_CONTROLD_MAXLINE)
-		rc = -E2BIG;
-	else
-		rc = full_write(fd, mbuf, OCFS2_CONTROLD_MAXLINE);
-
-	return rc;
-}
-
-static char *get_args(char *buf, int *argc, char **argv, char sep, int want)
-{
-	char *p = buf, *rp = NULL;
-	int i = 0;
-
-	/* Skip the first word, which is the command */
-	p = strchr(buf, sep);
-	if (!p)
-		goto out;
-	p += 1;
-	argv[0] = p;
-
-	for (i = 1; i < OCFS2_CONTROLD_MAXARGS; i++) {
-		p = strchr(p, sep);
-		if (!p) {
-			rp = p + 1;
-			break;
-		}
-
-		if (want == i)
-			break;
-
-		*p = '\0';
-		p += 1;
-		argv[i] = p;
-	}
-
-out:
-	if (argc)
-		*argc = i;
-
-	/* Terminate the list, the caller expects us to */
-	argv[i] = NULL;
-
-	/* we ended by hitting \0, return the point following that */
-	if (!rp)
-		rp = strchr(buf, '\0') + 1;
-
-	return rp;
-}
-
-int receive_message_full(int fd, char *buf, client_message *message,
-			 char **argv, char **rest)
-{
-	int i, rc, len, count;
-	client_message msg;
-	char *r;
-
-	rc = full_read(fd, buf, OCFS2_CONTROLD_MAXLINE);
-	if (rc)
-		goto out;
-
-	/* Safety first */
-	buf[OCFS2_CONTROLD_MAXLINE - 1] = '\0';
-	fprintf(stderr, "Got messsage \"%s\"\n", buf);
-
-
-	for (i = 0; i < message_list_len; i++) {
-		len = strlen(message_list[i].cm_command);
-		if (!strncmp(buf, message_list[i].cm_command, len) &&
-		    (buf[len] == ' '))
-			break;
-	}
-	if (i >= message_list_len) {
-		rc = -EBADMSG;
-		goto out;
-	}
-	msg = i;
-	
-	r = get_args(buf, &count, argv, ' ',
-		     message_list[msg].cm_argcount);
-	if (count != message_list[msg].cm_argcount) {
-		rc = -EBADMSG;
-	} else {
-		for (i = 0; i < count; i++)
-			fprintf(stderr, "Arg %d: \"%s\"\n", i, argv[i]);
-		if (message)
-			*message = msg;
-		if (rest)
-			*rest = r;
-	}
-
-out:
-	return rc;
-}
-
-int receive_message(int fd, char *buf, client_message *message, char **argv)
-{
-	return receive_message_full(fd, buf, message, argv, NULL);
-}
-
-int client_listen(void)
-{
-	struct sockaddr_un addr;
-	socklen_t addrlen;
-	int rv, s;
-
-	/* we listen for new client connections on socket s */
-
-	s = socket(AF_LOCAL, SOCK_STREAM, 0);
-	if (s < 0) {
-		/* log_error("socket error %d %d", s, errno); */
-		return s;
-	}
-
-	memset(&addr, 0, sizeof(addr));
-	addr.sun_family = AF_LOCAL;
-	strcpy(&addr.sun_path[1], OCFS2_CONTROLD_SOCK_PATH);
-	addrlen = sizeof(sa_family_t) + strlen(addr.sun_path+1) + 1;
-
-	rv = bind(s, (struct sockaddr *) &addr, addrlen);
-	if (rv < 0) {
-		/* log_error("bind error %d %d", rv, errno); */
-		close(s);
-		return rv;
-	}
-
-	rv = listen(s, 5);
-	if (rv < 0) {
-		/* log_error("listen error %d %d", rv, errno); */
-		close(s);
-		return rv;
-	}
-
-	/* log_debug("listen %d", s); */
-
-	return s;
-}
-
-int client_connect(void)
-{
-	struct sockaddr_un sun;
-	socklen_t addrlen;
-	int rv, fd;
-
-	fd = socket(PF_UNIX, SOCK_STREAM, 0);
-	if (fd < 0) {
-		fd = -errno;
-		goto out;
-	}
-
-	memset(&sun, 0, sizeof(sun));
-	sun.sun_family = AF_UNIX;
-	strcpy(&sun.sun_path[1], OCFS2_CONTROLD_SOCK_PATH);
-	addrlen = sizeof(sa_family_t) + strlen(sun.sun_path+1) + 1;
-
-	rv = connect(fd, (struct sockaddr *) &sun, addrlen);
-	if (rv < 0) {
-		close(fd);
-		fd = -errno;
-	}
- out:
-	return fd;
-}

Modified: branches/cman-based/ocfs2_controld/main.c
===================================================================
--- branches/cman-based/ocfs2_controld/main.c	2007-08-16 20:25:21 UTC (rev 1390)
+++ branches/cman-based/ocfs2_controld/main.c	2007-08-16 20:46:48 UTC (rev 1391)
@@ -22,7 +22,7 @@
  *  of the GNU General Public License v.2.
  */
 
-#include "ocfs2_controld.h"
+#include "o2cb_client_proto.h"
 #include "ocfs2_controld_internal.h"
 
 #define OPTION_STRING			"DhVw"

Deleted: branches/cman-based/ocfs2_controld/ocfs2_controld.h
===================================================================
--- branches/cman-based/ocfs2_controld/ocfs2_controld.h	2007-08-16 20:25:21 UTC (rev 1390)
+++ branches/cman-based/ocfs2_controld/ocfs2_controld.h	2007-08-16 20:46:48 UTC (rev 1391)
@@ -1,50 +0,0 @@
-/* -*- mode: c; c-basic-offset: 8; -*-
- * vim: noexpandtab sw=8 ts=8 sts=0:
- */
-
-/******************************************************************************
-*******************************************************************************
-**
-**  Copyright (C) 2005 Red Hat, Inc.  All rights reserved.
-**  
-**  This copyrighted material is made available to anyone wishing to use,
-**  modify, copy, or redistribute it subject to the terms and conditions
-**  of the GNU General Public License v.2.
-**
-*******************************************************************************
-******************************************************************************/
-
-/*
- * Copyright (C) 2007 Oracle.  All rights reserved.
- *
- *  This copyrighted material is made available to anyone wishing to use,
- *  modify, copy, or redistribute it subject to the terms and conditions
- *  of the GNU General Public License v.2.
- */
-
-#ifndef __OCFS2_CONTROLD_H
-#define __OCFS2_CONTROLD_H
-
-/* Basic communication properties */
-#define OCFS2_CONTROLD_MAXLINE		256
-#define OCFS2_CONTROLD_MAXARGS		16
-#define OCFS2_CONTROLD_SOCK_PATH	"ocfs2_controld_sock"
-
-/* Client messages */
-typedef enum {
-	CM_MOUNT,
-	CM_MRESULT,
-	CM_UNMOUNT,
-	CM_STATUS,
-} client_message;
-
-int client_listen(void);
-int client_connect(void);
-const char *message_to_string(client_message message);
-int send_message(int fd, client_message message, ...);
-int receive_message(int fd, char *buf, client_message *message,
-		    char **argv);
-int receive_message_full(int fd, char *buf, client_message *message,
-			 char **argv, char **rest);
-
-#endif

Modified: branches/cman-based/ocfs2_controld/test_client.c
===================================================================
--- branches/cman-based/ocfs2_controld/test_client.c	2007-08-16 20:25:21 UTC (rev 1390)
+++ branches/cman-based/ocfs2_controld/test_client.c	2007-08-16 20:46:48 UTC (rev 1391)
@@ -20,9 +20,8 @@
 #include "o2cb.h"
 #include "ocfs2_fs.h"
 #include "ocfs2.h"
-#include "ocfs2_controld.h"
+#include "o2cb_client_proto.h"
 
-#define OCFS2_FSTYPE "ocfs2"
 
 
 static int parse_status(char **args, int *error, char **error_msg)




More information about the Ocfs2-tools-commits mailing list