[prev in list] [next in list] [prev in thread] [next in thread]
List: linux-ha-dev
Subject: RE: [Linux-ha-dev] PATCH: apphbd recovery manager include files
From: "Brugger, Andrea L" <andrea.l.brugger () intel ! com>
Date: 2003-01-28 22:47:26
[Download RAW message or body]
Ok, here goes again with the patch minus any .in files.
Thanks, Yixiong, for finding these.
Andrea
> -----Original Message-----
> From: Brugger, Andrea L [mailto:andrea.l.brugger@intel.com]
> Sent: Tuesday, January 28, 2003 11:46 AM
> To: 'linux-ha-dev@lists.community.tummy.com'
> Subject: [Linux-ha-dev] PATCH: apphbd recovery manager include files
>
>
> This patch adds a change to the apphb_notify.h file and
> includes the header
> files for the recovery manager library.
>
> Andrea
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Andrea Brugger
> Software Engineer
> Intel Corporation -- Telecom Software Programs
>
> This email message does not necessarily represent or express
> the opinions of
> Intel Corporation.
>
>
["include.patch" (application/octet-stream)]
diff -ruN include/Makefile.am ../linux-ha-include/include/Makefile.am
--- include/Makefile.am Sat Nov 30 20:00:20 2002
+++ ../linux-ha-include/include/Makefile.am Tue Jan 28 14:36:11 2003
@@ -25,6 +25,6 @@
includedir=$(base_includedir)/heartbeat
include_HEADERS = apphb.h apphb_notify.h HBauth.h HBcomm.h ha_msg.h heartbeat.h \
- ha_config.h hb_api.h
+ ha_config.h hb_api.h recoverymgr.h
SUBDIRS = clplumbing ocf pils stonith
diff -ruN include/apphb_notify.h ../linux-ha-include/include/apphb_notify.h
--- include/apphb_notify.h Sat Nov 30 20:00:20 2002
+++ ../linux-ha-include/include/apphb_notify.h Tue Jan 28 14:36:11 2003
@@ -37,4 +37,8 @@
int (*auth) (void * clienthandle
, uid_t * uidlist, gid_t* gidlist, int nuid, int ngid);
};
+
+#define APPHB_NOTIFY AppHBNotification
+#define APPHB_NOTIFY_S MKSTRING(AppHBNotification)
+
#endif
diff -ruN include/clplumbing/Makefile.am ../linux-ha-include/include/clplumbing/Makefile.am
--- include/clplumbing/Makefile.am Mon Oct 21 03:17:18 2002
+++ ../linux-ha-include/include/clplumbing/Makefile.am Tue Jan 28 14:36:11 2003
@@ -28,6 +28,7 @@
Gmain_timeout.h \
GSource.h \
apphb_cs.h \
+ recoverymgr_cs.h \
base64.h \
cl_log.h \
cl_poll.h \
diff -ruN include/clplumbing/recoverymgr_cs.h ../linux-ha-include/include/clplumbing/recoverymgr_cs.h
--- include/clplumbing/recoverymgr_cs.h Wed Dec 31 16:00:00 1969
+++ ../linux-ha-include/include/clplumbing/recoverymgr_cs.h Tue Jan 28 14:36:11 2003
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2002 Intel Corporation
+ * and
+ * Copyright (C) 2002 Alan Robertson <alanr@unix.sh>
+ * since the original code was taken from apphb_cs.h
+ * and modified for use with the recovery manager.
+ *
+ *
+ * This software licensed under the GNU LGPL.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#ifndef _CLPLUMBING_RECOVERYMGR_CS_H
+#define _CLPLUMBING_RECOVERYMGR_CS_H
+
+/* Internal client-server messages for recovery manager */
+
+#ifndef HA_VARLIBDIR
+#define HA_VARLIBDIR "/var/lib"
+#endif
+#define RECOVERYMGRSOCKPATH HA_VARLIBDIR "/heartbeat/recoverymgr.comm"
+/* #define RECOVERYMGRSOCKPATH "/tmp/recoverymgr.comm" */
+
+#define RECOVERYMGR_TLEN 8
+#define RECOVERYMGR_OLEN 256
+
+#define RECOVERYMGR_CONNECT "conn"
+#define RECOVERYMGR_DISCONNECT "disconn"
+#define RECOVERYMGR_EVENT "event"
+
+#include <apphb_notify.h>
+
+/** Generic (no parameter) recovery manager message */
+struct recoverymgr_msg {
+ char msgtype [RECOVERYMGR_TLEN];
+};
+
+/** Recovery manager connection message */
+struct recoverymgr_connectmsg {
+ char msgtype [RECOVERYMGR_TLEN];
+ char appname [RECOVERYMGR_OLEN];
+ char appinstance [RECOVERYMGR_OLEN];
+ pid_t pid;
+ uid_t uid;
+ gid_t gid;
+};
+
+/**
+ * The notification message used by
+ * the plugin to the recovery manager.
+ * Message contains the *client's* information, not the
+ * recovery manager's info
+ */
+struct recoverymgr_event_msg {
+ char msgtype [RECOVERYMGR_TLEN];
+ char appname [RECOVERYMGR_OLEN];
+ char appinstance [RECOVERYMGR_OLEN];
+ pid_t pid;
+ uid_t uid;
+ gid_t gid;
+ apphb_event_t event;
+};
+
+/** Recovery manager return code (errno) */
+struct recoverymgr_rc {
+ int rc;
+};
+#endif /* _CLPLUMBING_RECOVERYMGR_CS_H */
+
diff -ruN include/recoverymgr.h ../linux-ha-include/include/recoverymgr.h
--- include/recoverymgr.h Wed Dec 31 16:00:00 1969
+++ ../linux-ha-include/include/recoverymgr.h Tue Jan 28 14:36:11 2003
@@ -0,0 +1,81 @@
+/*
+ *
+ * Copyright (c) 2002 Intel Corporation
+ * This code is based on the apphbd library code
+ * which is Copyright (c) 2002 Alan Robertson
+ *
+ * This software licensed under the GNU LGPL.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ ****************************************************************
+ * Recover Manager API
+ *
+ * Success is indicated by a non-negative return value.
+ */
+
+#ifndef _RECOVERYMGR_H
+#define _RECOVERYMGR_H
+
+#include <apphb_notify.h>
+
+/**
+ * Registers a recovery manager with apphbd
+ *
+ * parameters:
+ * @param appname name this process that registered
+ * @param appinstance
+ * @param callback The function to be called for every client event
+ *
+ * @return zero or an errno value as follows:
+ * EEXIST: current process already connected to recovery manager
+ * EBADF: service not available
+ * EINVAL: NULL 'appname' argument
+ * ENOSPC: too many connections
+ * ENAMETOOLONG: appname or appinstance argument is too long.
+ */
+int recoverymgr_connect(const char * appname,
+ const char * appinstance);
+
+/**
+ * Unregister a recovery manager from the apphbd
+ * After this call, the client will no longer receive
+ * notifications regarding events from monitored processes.
+ *
+ * @return zero or an errno value as follows:
+ * EBADF: recovery manager service not available
+ * ESRCH: current process not connected to recovery manager
+ */
+int recoverymgr_disconnect(void);
+
+/**
+ * For each event you want to have passed to the
+ * recovery manager, this function should be called.
+ *
+ * @param client This is the information about the
+ * process that caused the apphbd to
+ * generate an event. It also
+ * contains the event information.
+ *
+ * @return zero or an errno value as follows:
+ * @TODO add errno values
+ */
+int recoverymgr_send_event(const char *appname, const char *appinst,
+ pid_t pid, uid_t uid, gid_t gid,
+ apphb_event_t event);
+
+
+#endif /* _RECOVERYMGR_H */
+
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev@lists.community.tummy.com
http://lists.community.tummy.com/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic