root/attrd/internal.h

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

INCLUDED FROM


   1 /*
   2  * Copyright (C) 2013-2017 Andrew Beekhof <andrew@beekhof.net>
   3  *
   4  * This program 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 of the License, or (at your option) any later version.
   8  *
   9  * This software 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  * 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 #include <attrd_common.h>
  20 
  21 typedef struct attribute_s {
  22     char *uuid; /* TODO: Remove if at all possible */
  23     char *id;
  24     char *set;
  25     GHashTable *values;
  26     int update;
  27     int timeout_ms;
  28 
  29     /* TODO: refactor these three as a bitmask */
  30     bool changed; /* whether attribute value has changed since last write */
  31     bool unknown_peer_uuids; /* whether we know we're missing a peer uuid */
  32     gboolean is_private; /* whether to keep this attribute out of the CIB */
  33 
  34     mainloop_timer_t *timer;
  35 
  36     char *user;
  37 
  38 } attribute_t;
  39 
  40 typedef struct attribute_value_s {
  41         uint32_t nodeid;
  42         gboolean is_remote;
  43         char *nodename;
  44         char *current;
  45         char *requested;
  46 } attribute_value_t;
  47 
  48 crm_cluster_t *attrd_cluster;
  49 GHashTable *attributes;
  50 election_t *writer;
  51 
  52 #define attrd_send_ack(client, id, flags) \
  53     crm_ipcs_send_ack((client), (id), (flags), "ack", __FUNCTION__, __LINE__)
  54 
  55 void write_attributes(bool all);
  56 void attrd_peer_message(crm_node_t *client, xmlNode *msg);
  57 void attrd_client_peer_remove(const char *client_name, xmlNode *xml);
  58 void attrd_client_clear_failure(xmlNode *xml);
  59 void attrd_client_update(xmlNode *xml);
  60 void attrd_client_refresh(void);
  61 void attrd_client_query(crm_client_t *client, uint32_t id, uint32_t flags, xmlNode *query);
  62 
  63 void free_attribute(gpointer data);
  64 
  65 gboolean attrd_election_cb(gpointer user_data);
  66 void attrd_peer_change_cb(enum crm_status_type type, crm_node_t *peer, const void *data);

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