~ampelbein/ubuntu/oneiric/heartbeat/lp-770743

« back to all changes in this revision

Viewing changes to snmp_subagent/hbagent.h

  • Committer: Bazaar Package Importer
  • Author(s): Ante Karamatic
  • Date: 2009-08-10 19:29:25 UTC
  • mfrom: (5.2.3 experimental)
  • Revision ID: james.westby@ubuntu.com-20090810192925-9zy2llcbgavbskf7
Tags: 2.99.2+sles11r9-5ubuntu1
* New upstream snapshot
* Adjusted heartbeat.install and rules for documentation path

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * hbagent.h:  heartbeat snmp subagnet header file.
3
 
 *
4
 
 * Copyright (c) 2004 Intel Corp.
5
 
 *
6
 
 * Author: Zou Yixiong (yixiong.zou@intel.com)
7
 
 *
8
 
 * This program is free software; you can redistribute it and/or modify
9
 
 * it under the terms of the GNU General Public License as published by
10
 
 * the Free Software Foundation; either version 2 of the License, or
11
 
 * (at your option) any later version.
12
 
 *
13
 
 * This program is distributed in the hope that it will be useful,
14
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 
 * GNU General Public License for more details.
17
 
 *
18
 
 * You should have received a copy of the GNU General Public License
19
 
 * along with this program; if not, write to the Free Software
20
 
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
 
 *
22
 
 */
23
 
 
24
 
#ifndef __hasubagent_h__
25
 
#define __hasubagent_h__
26
 
 
27
 
#include <stdio.h>
28
 
#ifdef HAVE_STDINT_H
29
 
#include <stdint.h>
30
 
#endif
31
 
 
32
 
#include <glib.h>
33
 
#include "saf/ais.h"
34
 
#include "snmp-config-resolve.h"
35
 
#include <clplumbing/cl_uuid.h>
36
 
 
37
 
#define CACHE_TIME_OUT 5
38
 
#define LHAAGENTID "lha-snmpagent"
39
 
#define DEFAULT_TIME_OUT 5 /* default timeout value for snmp in sec. */
40
 
 
41
 
typedef enum lha_group {
42
 
        LHA_CLUSTERINFO,
43
 
        LHA_NODEINFO,
44
 
        LHA_IFSTATUSINFO,
45
 
        LHA_RESOURCEINFO,
46
 
        LHA_MEMBERSHIPINFO,
47
 
        LHA_HBCONFIGINFO,
48
 
} lha_group_t;
49
 
 
50
 
typedef enum lha_attribute {
51
 
        /* LHA_CLUSTERINFO stats */
52
 
        TOTAL_NODE_COUNT,
53
 
        LIVE_NODE_COUNT,
54
 
        RESOURCE_GROUP_COUNT,
55
 
        CURRENT_NODE_ID,
56
 
 
57
 
        /* LHA_RESOURCEINFO stats */
58
 
        RESOURCE_STATUS,
59
 
} lha_attribute_t;
60
 
 
61
 
 
62
 
int get_int_value(lha_group_t group, lha_attribute_t attr, size_t index, uint32_t * value);
63
 
 
64
 
int get_str_value(lha_group_t group, lha_attribute_t attr, size_t index, char * * value);
65
 
 
66
 
int clusterinfo_get_int_value(lha_attribute_t attr, size_t index, uint32_t * value);
67
 
 
68
 
int rsinfo_get_int_value(lha_attribute_t attr, size_t index, uint32_t * value);
69
 
 
70
 
 
71
 
/* LHAHeartbeatConfigInfo partial-mode */
72
 
typedef enum lha_hbconfig {
73
 
        LHA_CONF_HBVERSION,
74
 
        LHA_CONF_KEEPALIVE,
75
 
        LHA_CONF_DEADTIME,
76
 
        LHA_CONF_DEADPING,
77
 
        LHA_CONF_WARNTIME,
78
 
        LHA_CONF_INITDEAD,
79
 
        LHA_CONF_BAUDRATE,
80
 
        LHA_CONF_AUTOFAIL,
81
 
        LHA_CONF_STONITH,
82
 
        LHA_CONF_STONITHHOST,
83
 
        LHA_CONF_RESPAWN,
84
 
        LHA_CONF_END
85
 
} lha_hbconfig_t;
86
 
 
87
 
int hbconfig_get_str(lha_hbconfig_t attr_no, char * * value);
88
 
 
89
 
 
90
 
GPtrArray * get_hb_info(lha_group_t group);
91
 
 
92
 
struct hb_nodeinfo {
93
 
        size_t id;
94
 
        char * name;
95
 
        uint32_t type;
96
 
        uint32_t status;
97
 
        size_t ifcount;
98
 
        cl_uuid_t uuid;
99
 
};
100
 
 
101
 
struct hb_ifinfo {
102
 
        size_t id;
103
 
        size_t nodeid;
104
 
        char * name;
105
 
        char * node;
106
 
        uint32_t status;
107
 
};
108
 
 
109
 
struct hb_rsinfo {
110
 
        size_t id;
111
 
        size_t masternodeid;
112
 
        char * resource;
113
 
        uint32_t status;
114
 
};
115
 
 
116
 
#endif /* __hasubagent_h__ */
117
 
 
118
 
 
119