/*
* Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2.1 of the GNU Lesser General Public
* License as published by the Free Software Foundation.
*
* This program is distributed in the hope that it would be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* Further, this software is distributed without any warranty that it is
* free of the rightful claim of any third person regarding infringement
* or the like. Any license provided herein, whether implied or
* otherwise, applies only to this software file. Patent licenses, if
* any, provided herein do not apply to combinations of this program with
* other software, or any other product whatsoever.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307,
* USA.
*
* Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
* Mountain View, CA 94043, or:
*
* http://www.sgi.com
*
* For further information regarding this notice, see:
*
* http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
/*
* cms_timeout.h
*
* Data structures and other definitions for cms timeout
* verification and computation.
*/
#ident "$Id: cms_timeout.h,v 1.1 2000/08/31 19:16:32 vasa Exp $"
/* All time periods in this file are in milliseconds */
#define INVALID_TIME_PERIOD (-1)
/* The order in which the timeouts are listed here is important.
* Please do not mess with it without first consulting cms_timeout.c */
typedef enum {
CMS_NODETOI, /* If we do not hear from a node for this
* period we will assume the node is dead. */
CMS_SENDPERIOD, /* We will send heartbeat messages this
* often. */
CMS_INTFTOI, /* If a message sent to this address is
* not acked within this time period, we will
* assume something has gone wrong with the
* interface. */
CMS_INITTOI, /* During initial coming up we will wait
* for this period to hear from others.
* If we don't see someone else assuming the
* role of the leader, we will become the leader. */
CMS_WAITFORALLTOI, /* When a cmsd is coming up for the first time
* and has become a leader, it will wait for
* at least this long (since the cmsd started)
* for all nodes to comeup before internally
* delivering a membership.
* If all nodes do not come up within this time
* interval and go ahead and deliver a membership
* with whatever majority it has. */
CMS_REINITTOI, /* After becoming leader if we are not able
* to internally deliver a membership after this
* long (unless we become a follower), we will go
* into the lonely state and restart after
* notifying our clients. */
CMS_LINGERTOI, /* After we have decided we are lonely, we
* will give our clients this much time to
* unregister. If they don't unregister we
* will exit anyway. After this it will our
* client's responsibilty to recover from
* failed unregisters. */
CMS_TIETOI, /* If there is a tie and we are the second
* preference partition, we will wait this
* long before proposing this membership. */
CMS_RESETTOI, /* If reply to a reset request did not arrive
* within this period, the reset operation will
* be assumed to have failed. */
CMS_NEWCONFTOI, /* We will wait this long after all nodes
* in the membership have agreed upon the
* new configuration before starting to use
* the new configuration. */
CMS_REAPPERIOD, /* Cmsd checks the presence of its clients
* in /proc this often and reclaims resources
* held by missing clients. */
CMS_FLINKPERIOD, /* The failed link simulation file will be
* checked for changes this often. */
CMS_MONITORPERIOD, /* Cmsd checks for new_info calls from clients
* this often. */
CMS_SERVICEPERIOD, /* Cmsd checks for client requests this often. */
CMS_NUMTOIS
} cms_timeout_types_t;
typedef struct cms_timeout_typa_val_s {
cms_timeout_types_t type;
int val;
} cms_timeout_type_val_t;
typedef struct cms_timeout_s {
int minimum; /* Absolute permissible minimum */
int maximum; /* Absolute permissible maximum */
int deflt; /* Deflt value */
int suggested; /* Current suggested value, default or computed
* based on already specified values for other
* timeouts */
int input; /* Value input by the user */
int actual; /* The actual current value, specified or computed */
} cms_timeout_t;
typedef struct cms_timeout_set_s {
int nnodes;
cms_timeout_t toa[CMS_NUMTOIS];
} cms_timeout_set_t;
void cms_timeouts_init(cms_timeout_set_t *tosp, int nnodes);
void cms_timeouts_clear(cms_timeout_set_t *tosp);
void cms_timeouts_compute_bounds_and_suggested
(cms_timeout_set_t *tosp, cms_timeout_types_t type);
ci_err_t cms_timeout_verify(cms_timeout_set_t *tosp,
cms_timeout_types_t type);
ci_err_t cms_timeouts_verify(cms_timeout_set_t *tosp, ci_set_t *iset);
ci_err_t cms_timeouts_commit(cms_timeout_set_t *tosp,
boolean_t verify, ci_set_t *iset);
ci_err_t cms_timeout_set(cms_timeout_set_t *tosp,
cms_timeout_types_t type, int tval,
boolean_t verify, ci_set_t *iset);
ci_err_t cms_timeouts_set(cms_timeout_set_t *tosp,
cms_timeout_type_val_t *tva,
int tvcount, ci_set_t *iset);
void cms_timeout_get(cms_timeout_set_t *tosp,
cms_timeout_types_t type,
cms_timeout_t *top);
void cms_timeouts_print(cms_timeout_set_t *tosp, int dbg_lvl);
const char * cms_timeouts_error(void);