root/lrmd/lrmd_private.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  * Copyright (c) 2012 David Vossel <davidvossel@gmail.com>
   3  *
   4  * This library is free software; you can redistribute it and/or
   5  * modify it under the terms of the GNU Lesser General Public
   6  * License as published by the Free Software Foundation; either
   7  * version 2.1 of the License, or (at your option) any later version.
   8  *
   9  * This library is distributed in the hope that it will be useful,
  10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12  * Lesser General Public License for more details.
  13  *
  14  * You should have received a copy of the GNU Lesser General Public
  15  * License along with this library; if not, write to the Free Software
  16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  17  *
  18  */
  19 
  20 #ifndef LRMD_PVT__H
  21 #  define LRMD_PVT__H
  22 
  23 #  include <glib.h>
  24 #  include <crm/common/ipcs.h>
  25 #  include <crm/lrmd.h>
  26 #  include <crm/stonith-ng.h>
  27 
  28 #  ifdef HAVE_GNUTLS_GNUTLS_H
  29 #    undef KEYFILE
  30 #    include <gnutls/gnutls.h>
  31 #  endif
  32 
  33 #define LRMD_ISOLATION_PROVIDER ".isolation"
  34 
  35 GHashTable *rsc_list;
  36 
  37 typedef struct lrmd_rsc_s {
  38     char *rsc_id;
  39     char *class;
  40     char *provider;
  41     char *type;
  42 
  43     int call_opts;
  44 
  45     /* NEVER dereference this pointer,
  46      * It simply exists as a switch to let us know
  47      * when the currently active operation has completed */
  48     void *active;
  49 
  50     /* Operations in this list
  51      * have not been executed yet. */
  52     GList *pending_ops;
  53     /* Operations in this list are recurring operations
  54      * that have been handed off from the pending ops list. */
  55     GList *recurring_ops;
  56 
  57     int stonith_started;
  58 
  59     crm_trigger_t *work;
  60 } lrmd_rsc_t;
  61 
  62 #  ifdef HAVE_GNUTLS_GNUTLS_H
  63 /* in remote_tls.c */
  64 int lrmd_init_remote_tls_server(void);
  65 void lrmd_tls_server_destroy(void);
  66 
  67 /* Hidden in lrmd client lib */
  68 extern int lrmd_tls_send_msg(crm_remote_t * session, xmlNode * msg, uint32_t id,
  69                              const char *msg_type);
  70 extern int lrmd_tls_set_key(gnutls_datum_t * key);
  71 #  endif
  72 
  73 int lrmd_server_send_reply(crm_client_t * client, uint32_t id, xmlNode * reply);
  74 
  75 int lrmd_server_send_notify(crm_client_t * client, xmlNode * msg);
  76 
  77 void notify_of_new_client(crm_client_t *new_client);
  78 
  79 void process_lrmd_message(crm_client_t * client, uint32_t id, xmlNode * request);
  80 
  81 void free_rsc(gpointer data);
  82 
  83 void handle_shutdown_ack(void);
  84 
  85 void handle_shutdown_nack(void);
  86 
  87 void lrmd_client_destroy(crm_client_t *client);
  88 
  89 void client_disconnect_cleanup(const char *client_id);
  90 
  91 /*!
  92  * \brief Don't worry about freeing this connection. It is
  93  *        taken care of after mainloop exits by the main() function.
  94  */
  95 stonith_t *get_stonith_connection(void);
  96 
  97 /*!
  98  * \brief This is a callback that tells the lrmd
  99  * the current stonith connection has gone away. This allows
 100  * us to timeout any pending stonith commands
 101  */
 102 void stonith_connection_failed(void);
 103 
 104 #ifdef SUPPORT_REMOTE
 105 void ipc_proxy_init(void);
 106 void ipc_proxy_cleanup(void);
 107 void ipc_proxy_add_provider(crm_client_t *client);
 108 void ipc_proxy_remove_provider(crm_client_t *client);
 109 void ipc_proxy_forward_client(crm_client_t *client, xmlNode *xml);
 110 crm_client_t *ipc_proxy_get_provider(void);
 111 int ipc_proxy_shutdown_req(crm_client_t *ipc_proxy);
 112 #endif
 113 
 114 int process_lrmd_alert_exec(crm_client_t *client, uint32_t id, xmlNode *request);
 115 void lrmd_drain_alerts(GMainContext *ctx);
 116 #endif

/* [previous][next][first][last][top][bottom][index][help] */