
horms at verge
Oct 15, 2008, 12:02 AM
Post #1 of 4
(937 views)
Permalink
|
|
[patch 4/6] Remove heartbeat/hb_api_core.h and heartebat/hb_api.h
|
|
It seems that heartbeat/hb_api_core.h and heartebat/hb_api.h are out of date copies of files in include/. I'm not sure why this hasn't happened before, but today they are causing my build to fail. Removing heartbeat/hb_api_core.h resolves the following warnings and errors: #make [snip] gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../include -I../include -I../include -I../linux-ha -I../linux-ha -I../libltdl -I../libltdl -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libxml2 -g -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wdeclaration-after-statement -Wpointer-arith -Wwrite-strings -Wcast-qual -Wcast-align -Wbad-function-cast -Winline -Wmissing-format-attribute -Wformat=2 -Wformat-security -Wformat-nonliteral -Wno-long-long -Wno-strict-aliasing -ggdb3 -funsigned-char -g -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wdeclaration-after-statement -Wpointer-arith -Wwrite-strings -Wcast-qual -Wcast-align -Wbad-function-cast -Winline -Wmissing-format-attribute -Wformat=2 -Wformat-security -Wformat-nonliteral -Wno-long-long -Wno-strict-aliasing -ggdb3 -funsigned-char -MT heartbeat-heartbeat.o -MD -MP -MF .deps/heartbeat-heartbeat.Tpo -c -o heartbeat-heartbeat.o `test -f 'heartbeat.c' || echo './'`heartbeat.c heartbeat.c: In function 'SetupFifoChild': heartbeat.c:703: error: 'PRI_FIFOMSG' undeclared (first use in this function) heartbeat.c:703: error: (Each undeclared identifier is reported only once heartbeat.c:703: error: for each function it appears in.) heartbeat.c: In function 'make_io_childpair': heartbeat.c:874: error: 'PRI_SENDPKT' undeclared (first use in this function) heartbeat.c:889: error: 'PRI_READPKT' undeclared (first use in this function) heartbeat.c: In function 'master_control_process': heartbeat.c:1515: error: 'PRI_WRITECACHE' undeclared (first use in this function) heartbeat.c:1606: error: 'PRI_SENDSTATUS' undeclared (first use in this function) heartbeat.c:1610: error: 'PRI_AUDITCLIENT' undeclared (first use in this function) heartbeat.c:1619: warning: passing argument 3 of 'Gmain_timeout_add_full' from incompatible pointer type heartbeat.c:1630: error: 'PRI_CHECKSIGS' undeclared (first use in this function) heartbeat.c:1634: error: 'PRI_FREEMSG' undeclared (first use in this function) heartbeat.c:1639: error: 'PRI_DUMPSTATS' undeclared (first use in this function) heartbeat.c: In function 'comm_now_up': heartbeat.c:1919: error: 'API_REGSOCK' undeclared (first use in this function) heartbeat.c:1955: error: 'PRI_APIREGISTER' undeclared (first use in this function) heartbeat.c:1956: warning: passing argument 1 of 'G_main_add_IPC_WaitConnection' makes integer from pointer without a cast heartbeat.c: In function 'update_ackseq': heartbeat.c:2432: warning: implicit declaration of function 'all_clients_resume' heartbeat.c: In function 'HBDoMsg_T_QCSTATUS': heartbeat.c:3264: warning: implicit declaration of function 'find_client' heartbeat.c:3264: warning: comparison between pointer and integer heartbeat.c: In function 'add2_xmit_hist': heartbeat.c:6247: warning: implicit declaration of function 'all_clients_pause' make[1]: *** [heartbeat-heartbeat.o] Error 1 make[1]: Leaving directory `/home/horms/projects/linux-ha/hg/horms/lha-dev/heartbeat' make: *** [all-recursive] Error 1 Removing heartbeat/hb_api.h resolves the following error: #make [snip] gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../include -I../include -I../include -I../linux-ha -I../linux-ha -I../libltdl -I../libltdl -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libxml2 -g -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wdeclaration-after-statement -Wpointer-arith -Wwrite-strings -Wcast-qual -Wcast-align -Wbad-function-cast -Winline -Wmissing-format-attribute -Wformat=2 -Wformat-security -Wformat-nonliteral -Wno-long-long -Wno-strict-aliasing -ggdb3 -funsigned-char -g -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wdeclaration-after-statement -Wpointer-arith -Wwrite-strings -Wcast-qual -Wcast-align -Wbad-function-cast -Winline -Wmissing-format-attribute -Wformat=2 -Wformat-security -Wformat-nonliteral -Wno-long-long -Wno-strict-aliasing -ggdb3 -funsigned-char -MT heartbeat-heartbeat.o -MD -MP -MF .deps/heartbeat-heartbeat.Tpo -c -o heartbeat-heartbeat.o `test -f 'heartbeat.c' || echo './'`heartbeat.c heartbeat.c: In function 'main': heartbeat.c:4887: error: 'KEY_HBVERSION' undeclared (first use in this function) heartbeat.c:4887: error: (Each undeclared identifier is reported only once heartbeat.c:4887: error: for each function it appears in.) make[1]: *** [heartbeat-heartbeat.o] Error 1 make[1]: Leaving directory `/home/horms/projects/linux-ha/hg/horms/lha-dev/heartbeat' make: *** [all-recursive] Error 1 Signed-off-by: Simon Horman <horms [at] verge> Index: lha-dev/heartbeat/hb_api.h =================================================================== --- lha-dev.orig/heartbeat/hb_api.h 2008-10-15 16:24:37.000000000 +1100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,232 +0,0 @@ -/* - * Client-side Low-level clustering API for heartbeat. - * - * Copyright (C) 2000 Alan Robertson <alanr [at] unix> - * - * 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 - * - */ - -/* - * Currently the client-side heartbeat API needs to write in the /var/lock - * directory for non-casual (named) clients. This has implications for the - * euid, egid that we run as. - * - * Expect to set make your binaries setgid to uucp, or allow the uid - * they run as to join the group uucp (or whatever your local system - * has it set up as). - * - * Additionally, you must belong to the group hbapi. Fortunately, UNIX - * group permissions are quite flexible, and you can do both. - */ - -/* - * Known deficiencies of this API: - * - * Each of the various set..callback functions should probably return - * the current callback and private data parameter, so the caller can - * restore them later. - * - */ - -#ifndef __HB_API_H -# define __HB_API_H 1 -#include <ha_msg.h> - -#define LLC_PROTOCOL_VERSION 1 - -typedef void (*llc_msg_callback_t) (const struct ha_msg* msg -, void* private_data); - -typedef void (*llc_nstatus_callback_t) (const char *node, const char * status -, void* private_data); - -typedef void (*llc_ifstatus_callback_t) (const char *node -, const char * interface, const char * status -, void* private_data); - -typedef struct ll_cluster { - void * ll_cluster_private; - struct llc_ops* llc_ops; -}ll_cluster_t; - -struct llc_ops { - int (*signon) (ll_cluster_t*, const char * service); - int (*signoff) (ll_cluster_t*); - int (*delete) (ll_cluster_t*); - -/* - ************************************************************************* - * Status Update Callbacks - ************************************************************************* - */ - -/* - * set_msg_callback: Define callback for the given message type - * - * msgtype: Type of message being handled. - * Messages intercepted by nstatus_callback or - * ifstatus_callback functions won't be handled here. - * - * callback: callback function. - * - * p: private data - later passed to callback. - */ - int (*set_msg_callback) (ll_cluster_t*, const char * msgtype - , llc_msg_callback_t callback, void * p); - -/* - * set_nstatus_callback: Define callback for node status messages - * This is a message of type "status" - * - * cbf: callback function. - * - * p: private data - later passed to callback. - */ - - int (*set_nstatus_callback) (ll_cluster_t* - , llc_nstatus_callback_t cbf, void * p); -/* - * set_ifstatus_callback: Define callback for interface status messages - * This is a message of type "ifstat" - * These messages are received whenever an interface goes - * dead or becomes active again. - * - * cbf: callback function. - * - * p: private data - later passed to callback. - */ - int (*set_ifstatus_callback) (ll_cluster_t* -, llc_ifstatus_callback_t cbf, void * p); - - -/************************************************************************* - * Getting Current Information - *************************************************************************/ - -/* - * init_nodewalk: Initialize walk through list of list of known nodes - */ - int (*init_nodewalk)(ll_cluster_t*); -/* - * nextnode: Return next node in the list of known nodes - */ - const char * (*nextnode)(ll_cluster_t*); -/* - * end_nodewalk: End walk through the list of known nodes - */ - int (*end_nodewalk)(ll_cluster_t*); -/* - * node_status: Return most recent heartbeat status of the given node - */ - const char * (*node_status)(ll_cluster_t*, const char * nodename); -/* - * init_ifwalk: Initialize walk through list of list of known interfaces - */ - int (*init_ifwalk)(ll_cluster_t*, const char * node); -/* - * nextif: Return next node in the list of known interfaces on node - */ - const char * (*nextif)(ll_cluster_t*); -/* - * end_ifwalk: End walk through the list of known interfaces - */ - int (*end_ifwalk)(ll_cluster_t*); -/* - * if_status: Return current status of the given interface - */ - const char* (*if_status)(ll_cluster_t*, const char * nodename -, const char *iface); - -/************************************************************************* - * Intracluster messaging - *************************************************************************/ - -/* - * sendclustermsg: Send the given message to all cluster members - */ - int (*sendclustermsg)(ll_cluster_t* -, struct ha_msg* msg); -/* - * sendnodemsg: Send the given message to the given node in cluster. - */ - int (*sendnodemsg)(ll_cluster_t* -, struct ha_msg* msg -, const char * nodename); - -/* - * inputfd: Return fd which can be given to select(2) or poll(2) - * for determining when messages are ready to be read. - * Only to be used in select() or poll(), please... - */ - int (*inputfd)(ll_cluster_t*); -/* - * msgready: Returns TRUE (1) when a message is ready to be read. - */ - int (*msgready)(ll_cluster_t*); -/* - * setmsgsignal: Associates the given signal with the "message waiting" - * condition. - */ - int (*setmsgsignal)(ll_cluster_t*, int signo); -/* - * rcvmsg: Cause the next message to be read - activating callbacks for - * processing the message. If no callback processes the message - * it will be ignored. The message is automatically disposed of. - * It returns 1 if a message was received. - */ - int (*rcvmsg)(ll_cluster_t*, int blocking); - -/* - * Return next message not intercepted by a callback. - * NOTE: you must dispose of this message by calling ha_msg_del(). - */ - struct ha_msg* (*readmsg)(ll_cluster_t*, int blocking); - -/* - ************************************************************************* - * Debugging - ************************************************************************* - * - * setfmode: Set filter mode. Analagous to promiscous mode in TCP. - * Gotta be root to turn on debugging! - * - * LLC_FILTER_DEFAULT (default) - * In this mode, all messages destined for this pid - * are received, along with all that don't go to specific pids. - * - * LLC_FILTER_PMODE See all messages, but filter heart beats - * - * that don't tell us anything new. - * LLC_FILTER_ALLHB See all heartbeats, including those that - * don't change status. - * LLC_FILTER_RAW See all packets, from all interfaces, even - * dups. Pkts with auth errors are still ignored. - * - * Set filter mode. Analagous to promiscous mode in TCP. - * - */ -# define LLC_FILTER_DEFAULT 0 -# define LLC_FILTER_PMODE 1 -# define LLC_FILTER_ALLHB 2 -# define LLC_FILTER_RAW 3 - - int (*setfmode)(ll_cluster_t*, int mode); - - const char * (*errmsg)(ll_cluster_t*); -}; - -ll_cluster_t* ll_cluster_new(const char * llctype); -#endif /* __HB_API_H */ Index: lha-dev/heartbeat/hb_api_core.h =================================================================== --- lha-dev.orig/heartbeat/hb_api_core.h 2008-10-15 16:19:37.000000000 +1100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,161 +0,0 @@ -/* - * hb_api_core_h: Internal definitions and functions for the heartbeat API - * - * Copyright (C) 2000 Alan Robertson <alanr [at] unix> - * - * - * 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 _HB_API_CORE_H -# define _HB_API_CORE_H 1 -#include <sys/types.h> -#include <clplumbing/longclock.h> -#include <ha_msg.h> - -/* - * Per-client API data structure. - */ - -typedef struct client_process { - char client_id[32]; /* Client identification */ - pid_t pid; /* PID of client process */ - uid_t uid; /* UID of client process */ - int iscasual; /* 1 if this is a "casual" client */ - int beingremoved; /* 1 if client is being removed */ - FILE* input_fifo; /* Input FIFO file pointer */ - GList* msgQ; /* Queue of msgs for client */ - int msgcount; /* length of client message queue */ - int signal; /* What signal to indicate new msgs */ - int desired_types; /* A bit mask of desired message types*/ - struct client_process* next; - GPollFD gpfd; /* Glib main Poll file descriptor */ - guint g_source_id; /* return from g_source_add */ - guint g_app_hb_id; /* Application heartbeat timer id */ - longclock_t next_app_hb; /* Next application heartbeat time */ - longclock_t app_hb_ticks; /* ticks between app heartbeats */ -}client_proc_t; - -/* - * Types of messages. - * DROPIT and/or DUPLICATE are only used when a debugging callback - * is registered. - */ - - -/* - * This next set of defines is for the types of packets that come through - * heartbeat. - * - * Any given packet behaves like an enumeration (should only have one bit - * on), but the options from client software treat them more like a set - * (bit field), with more than one at a time being on. Normally the - * client only requests KEEPIT packets, but for debugging may want to - * ask to see the others too. - */ -#define KEEPIT 0x01 /* A set of bits */ -#define NOCHANGE 0x02 -#define DROPIT 0x04 -#define DUPLICATE 0x08 -#define APICALL 0x10 -#define PROTOCOL 0x20 -#define DEBUGTREATMENTS (DROPIT|DUPLICATE|APICALL|NOCHANGE|PROTOCOL) -#define ALLTREATMENTS (DEBUGTREATMENTS|KEEPIT) -#define DEFAULTREATMENT (KEEPIT) - -#define API_SIGNON "signon" -#define API_SIGNOFF "signoff" -#define API_SETFILTER "setfilter" -# define F_FILTERMASK "fmask" -#define API_SETSIGNAL "setsignal" -# define F_SIGNAL "signal" -#define API_NODELIST "nodelist" -# define F_NODENAME "node" -#define API_NODELIST_END "nodelist-end" -#define API_NODESTATUS "nodestatus" - -#define API_IFLIST "iflist" -# define F_IFNAME "ifname" -#define API_IFLIST_END "iflist-end" -#define API_IFSTATUS "ifstatus" - - -#define API_OK "OK" -#define API_FAILURE "fail" -#define API_BADREQ "badreq" -#define API_MORE "ok/more" - -#define API_FIFO_DIR VAR_LIB_D "/api" -#define API_FIFO_LEN (sizeof(API_FIFO_DIR)+32) - -#define NAMEDCLIENTDIR API_FIFO_DIR -#define CASUALCLIENTDIR VAR_LIB_D "/casual" - -#define REQ_SUFFIX ".req" -#define RSP_SUFFIX ".rsp" - -#ifndef API_REGFIFO -# define API_REGFIFO VAR_LIB_D "/register" -#endif - -void api_heartbeat_monitor(struct ha_msg *msg, int msgtype, const char *iface); -void api_process_registration(struct ha_msg *msg); -void process_api_msgs(fd_set* inputs, fd_set* exceptions); -int compute_msp_fdset(fd_set* set, int fd1, int fd2); -void api_audit_clients(void); - -/* Return code for API query handlers */ - -#define I_API_RET 0 /* acknowledge client of successful API query */ -#define I_API_IGN 1 /* do nothing */ -#define I_API_BADREQ 2 /* send error msg to client with "failreason" as error reason */ - -/* Handler of API query */ -typedef int (*api_query_handler_t) (const struct ha_msg* msg - , struct ha_msg *resp, client_proc_t* client - , const char **failreason); - -struct api_query_handler { - const char *queryname; - api_query_handler_t handler; -}; - -/* Definitions of API query handlers */ - -int api_signoff (const struct ha_msg* msg, struct ha_msg* resp -, client_proc_t* client, const char **failreason); - -int api_setfilter (const struct ha_msg* msg, struct ha_msg* resp -, client_proc_t* client, const char **failreason); - -int api_setsignal (const struct ha_msg* msg, struct ha_msg* resp -, client_proc_t* client, const char** failreason); - -int api_nodelist (const struct ha_msg* msg, struct ha_msg* resp -, client_proc_t* client, const char** failreason); - -int api_nodestatus (const struct ha_msg* msg, struct ha_msg* resp -, client_proc_t* client, const char** failreason); - -int api_ifstatus (const struct ha_msg* msg, struct ha_msg* resp -, client_proc_t* client, const char** failreason); - -int api_iflist (const struct ha_msg* msg, struct ha_msg* resp -, client_proc_t* client, const char** failreason); - -void ProcessAnAPIRequest(client_proc_t* client); - -#endif /* _HB_API_CORE_H */ -- -- Simon Horman VA Linux Systems Japan K.K., Sydney, Australia Satellite Office H: www.vergenet.net/~horms/ W: www.valinux.co.jp/en _______________________________________________________ Linux-HA-Dev: Linux-HA-Dev [at] lists http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev Home Page: http://linux-ha.org/
|