wd.c File Reference
`#include <config.h>`
`#include <unistd.h>`
`#include <fcntl.h>`
`#include <sys/ioctl.h>`
`#include <linux/types.h>`
`#include <linux/watchdog.h>`
`#include <sys/reboot.h>`
`#include <corosync/corotypes.h>`
`#include <corosync/corodefs.h>`
`#include <corosync/coroapi.h>`
`#include <qb/qblist.h>`
`#include <corosync/logsys.h>`
`#include <corosync/icmap.h>`
`#include "fsm.h"`
`#include "service.h"`
Include dependency graph for wd.c:

Go to the source code of this file.

## Data Structures

struct | resource

## Macros

#define | WD_DEFAULT_TIMEOUT_SEC 6
#define | WD_DEFAULT_TIMEOUT_MS (WD_DEFAULT_TIMEOUT_SEC * CS_TIME_MS_IN_SEC)
#define | WD_MIN_TIMEOUT_MS 500
#define | WD_MAX_TIMEOUT_MS (120 * CS_TIME_MS_IN_SEC)

## Enumerations

enum | wd_resource_state_t { WD_RESOURCE_GOOD , WD_RESOURCE_FAILED , WD_RESOURCE_STATE_UNKNOWN , WD_RESOURCE_NOT_MONITORED }
enum | wd_resource_state { WD_S_RUNNING , WD_S_FAILED , WD_S_STOPPED }
enum | wd_resource_event { WD_E_FAILURE , WD_E_CONFIG_CHANGED }

## Functions

| LOGSYS_DECLARE_SUBSYS ("WD")
struct corosync_service_engine * | wd_get_service_engine_ver0 (void)

## Variables

struct corosync_service_engine | wd_service_engine
const char * | wd_running_str = "running"
const char * | wd_failed_str = "failed"
const char * | wd_failure_str = "failure"
const char * | wd_stopped_str = "stopped"
const char * | wd_config_changed_str = "config_changed"
struct cs_fsm_entry | wd_fsm_table []

## Macro Definition Documentation

## WD_DEFAULT_TIMEOUT_MS

#define WD_DEFAULT_TIMEOUT_MS (WD_DEFAULT_TIMEOUT_SEC * CS_TIME_MS_IN_SEC)

Definition at line 84 of file wd.c.

## WD_DEFAULT_TIMEOUT_SEC

#define WD_DEFAULT_TIMEOUT_SEC 6

Definition at line 83 of file wd.c.

## WD_MAX_TIMEOUT_MS

#define WD_MAX_TIMEOUT_MS (120 * CS_TIME_MS_IN_SEC)

Definition at line 86 of file wd.c.

## WD_MIN_TIMEOUT_MS

#define WD_MIN_TIMEOUT_MS 500

Definition at line 85 of file wd.c.

## Enumeration Type Documentation

## wd_resource_event

enum wd_resource_event

Enumerator
WD_E_FAILURE |
WD_E_CONFIG_CHANGED |

Definition at line 126 of file wd.c.

## wd_resource_state

enum wd_resource_state

Enumerator
WD_S_RUNNING |
WD_S_FAILED |
WD_S_STOPPED |

Definition at line 120 of file wd.c.

## wd_resource_state_t

enum wd_resource_state_t

Enumerator
WD_RESOURCE_GOOD |
WD_RESOURCE_FAILED |
WD_RESOURCE_STATE_UNKNOWN |
WD_RESOURCE_NOT_MONITORED |

Definition at line 54 of file wd.c.

## Function Documentation

## LOGSYS_DECLARE_SUBSYS()

LOGSYS_DECLARE_SUBSYS | ( | "WD" |  | ) |

## wd_get_service_engine_ver0()

struct corosync_service_engine * wd_get_service_engine_ver0 | ( | void |  | ) |

Definition at line 146 of file wd.c.

References wd_service_engine.

## Variable Documentation

## wd_config_changed_str

const char* wd_config_changed_str = "config_changed"

Definition at line 135 of file wd.c.

## wd_failed_str

const char* wd_failed_str = "failed"

Definition at line 132 of file wd.c.

## wd_failure_str

const char* wd_failure_str = "failure"

Definition at line 133 of file wd.c.

## wd_fsm_table

struct cs_fsm_entry wd_fsm_table[]

Initial value:
= {
{ WD_S_STOPPED, WD_E_CONFIG_CHANGED, wd_config_changed, {WD_S_STOPPED, WD_S_RUNNING, -1} },
{ WD_S_STOPPED, WD_E_FAILURE, NULL, {-1} },
{ WD_S_RUNNING, WD_E_CONFIG_CHANGED, wd_config_changed, {WD_S_RUNNING, WD_S_STOPPED, -1} },
{ WD_S_RUNNING, WD_E_FAILURE, wd_resource_failed, {WD_S_FAILED, -1} },
{ WD_S_FAILED, WD_E_CONFIG_CHANGED, wd_config_changed, {WD_S_RUNNING, WD_S_STOPPED, -1} },
{ WD_S_FAILED, WD_E_FAILURE, NULL, {-1} },
}
nodeid
unsigned int nodeid
Definition coroapi.h:0
WD_S_STOPPED
@ WD_S_STOPPED
Definition wd.c:123
WD_S_FAILED
@ WD_S_FAILED
Definition wd.c:122
WD_S_RUNNING
@ WD_S_RUNNING
Definition wd.c:121
WD_E_FAILURE
@ WD_E_FAILURE
Definition wd.c:127
WD_E_CONFIG_CHANGED
@ WD_E_CONFIG_CHANGED
Definition wd.c:128

Definition at line 137 of file wd.c.

## wd_running_str

const char* wd_running_str = "running"

Definition at line 131 of file wd.c.

## wd_service_engine

struct corosync_service_engine wd_service_engine

Initial value:
= {
.name = "corosync watchdog service",
.id = WD_SERVICE,
.priority = 1,
.private_data_size = 0,
.flow_control = CS_LIB_FLOW_CONTROL_NOT_REQUIRED,
.lib_init_fn = NULL,
.lib_exit_fn = NULL,
.lib_engine = NULL,
.lib_engine_count = 0,
.exec_engine = NULL,
.exec_engine_count = 0,
.confchg_fn = NULL,
.exec_init_fn = wd_exec_init_fn,
.exec_exit_fn = wd_exec_exit_fn,
.exec_dump_fn = NULL
}
CS_LIB_FLOW_CONTROL_NOT_REQUIRED
@ CS_LIB_FLOW_CONTROL_NOT_REQUIRED
Definition coroapi.h:153
WD_SERVICE
@ WD_SERVICE
Definition corodefs.h:51

Definition at line 94 of file wd.c.

Referenced by wd_get_service_engine_ver0().

## wd_stopped_str

const char* wd_stopped_str = "stopped"

Definition at line 134 of file wd.c.