Data Structures

The VCSAgResState enumeration supports the following return codes from the monitor entry point.

// Values for the reason why the clean entry point

// is called.

enum VCSAgWhyClean {

VCSAgCleanOfflineHung, // offline entry point did

// not complete within the

// expected time.

VCSAgCleanOfflineIneffective, // offline entry point

// was ineffective.

VCSAgCleanOnlineHung, // online entry point did

// not complete within the

// expected time.

VCSAgCleanOnlineIneffective, // online entry point

// was ineffective.

VCSAgCleanUnexpectedOffline, // the resource became

// offline unexpectedly.

VCSAgCleanMonitorHung // monitor entry point did

// not complete within the

// expected time.

};

// Structure used to register the entry points.

typedef struct {

void (*open)(const char *res_name, void **attr_val);

void (*close)(const char *res_name, void **attr_val);

VCSAgResState (*monitor)(const char *res_name,

void **attr_val, int, *conf_level);

unsigned int (*online)(const char *res_name,

void **attr_val);

unsigned int (*offline)(const char *res_name,

void **attr_val);

unsigned int (*action) (const char *res_name, const char

*action_token, void **attr_val, char

**action_args, char *action_output);

unsigned int (*info) (const char *res_name, VCSAgResInfoOp

resinfo_op, void **attr_val, char **info_output,

char ***opt_update_args, char ***opt_add_args);

void (*attr_changed)(const char *res_name,

const char *changed_res_name, const char

*changed_attr_name, void **new_val);

unsigned int (*clean)(const char *res_name,

VCSAgWhyClean reason, void **attr_val);

void (*shutdown) ();

} VCSAgV40EntryPointStruct;

The structure VCSAgV40EntryPointStruct consists of function pointers, one for each entry point except VCSAgStartup. The VCSAgStartup entry point is called by name, and therefore must be implemented using C++ and named VCSAgStartup.