[BACK]Return to cms_types.h CVS log [TXT][DIR] Up to [Development] / failsafe / FailSafe / cluster_services / include

File: [Development] / failsafe / FailSafe / cluster_services / include / cms_types.h (download)

Revision 1.1, Thu Aug 31 19:16:32 2000 UTC (17 years, 1 month ago) by vasa
Branch: MAIN
CVS Tags: HEAD

Initial checkin

/*
 * 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_types.h
 *
 * What's in this file?
 */

#ifndef CMS_TYPES_H
#define CMS_TYPES_H
#ident "$Id: cms_types.h,v 1.1 2000/08/31 19:16:32 vasa Exp $"

#include <sys/time.h>

#define	CMS_MAX_NODES	CI_MAX_NODES

typedef	ci_nodeid_t	cms_nodeid_t;

typedef enum {
	CMS_NODE_UNDEFINED	=	0,
	CMS_NODE_DOWN		=	1,
	CMS_NODE_UP		=	2,
	CMS_NODE_UNKNOWN	=	3
} cms_status_t;

typedef	ci_nodemode_t	cms_mode_t;

typedef struct cms_node_list_s {
	uint32_t		count;
	cms_nodeid_t		id[CMS_MAX_NODES];
} cms_node_list_t;

typedef struct cms_info_s {
	cms_nodeid_t		nodeid;
	char			name[CI_MAX_NODE_NAME];
	struct	in_addr		ip_addr;
	cms_status_t		status;
	cms_mode_t		mode;	/* Meaningless for cms clients */
	uint_t			incarnation;
	uint_t			age[2];	/* Only the first element is
					 * computed by cmsd, the second 
					 * element is provided by the cms 
					 * library, it is either 0 or 1. */
	ci_clock_t		time;
} cms_info_t;

#define	CMS_MEMBERSHIP	0x1
#define CMS_IPADDR	0x2
#define	CMS_CONFIG	0x4
#define CMS_SOMECHANGE	0x8	/* To be returned to admin clients only */

typedef struct cms_new_info_s {
  ci_err_t		err;	/* CI_SUCCESS, CI_UNCHANGED, .. */
  uint_t		change;	/* Flag indicating what has changed,
				 * could be any combination of CMS_MEMBERSHIP
				 * and CMS_IPADDR */
  uint_t		seq[2];	/* Sequence no of the current membership.
				 * Cmsd sends only the first element of this
				 * array, the second element is filled in
				 * by the cmslib. */
  uint64_t		global_seq;
				/* Global sequence number of the current
				 * membership. The high 32 bits are the
				 * global sequence number computed by the
				 * cmsd, age of the oldest node. The lower
				 * 32 bits represent the sequence number
				 * generated by the cms lib. 0 for total
				 * memberships and 0 or 1 for split
				 * memberships. This works because the
				 * sequence number computed by cmsd is 
				 * uint_t */
  uint_t		node_cnt;/* Number of nodes (up/down/unknown) in
				 * the cluster, i.e., the number of entries
				 * to be expected in the info array */
  cms_info_t		*info;	/* Array of info structs, copy the entire 
				 * membership info if this is not NULL,
				 * assume sufficient space is available */
  struct timeval 	tv;	/* Time since this membership has been 
				 * in place. */
} cms_new_info_t;

#endif