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

File: [Development] / failsafe / FailSafe / cluster_services / include / cms_msg.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_msg.h
 *
 * what's in this file?
 */
#ident "$Id: cms_msg.h,v 1.1 2000/08/31 19:16:32 vasa Exp $"


/* The largest message is the CMS stats message cms_stats_t. Sizeof
 * of cms_stats_t is ~512 bytes per CI_MAX_NODES */
#define CMS_MSG_SIZE    (CI_MAX_NODES*512)

#define	CMS_OFF		0
#define	CMS_ON		1

#define CMS_AUTH_BASE	0x03081962
#define CMS_AUTH_SPEC	0x03081962

#define	CMSD_SERVICE_VERSION	1

#define	CMSD_SERVICE_TYPE_REPLY_DELTA		1000
#define CMSD_STR(type)			((type) + CMSD_SERVICE_TYPE_REPLY_DELTA) 
#define	CMSD_SERVICE_TYPE_REPLY(type)	((cmsd_service_type_t)CMSD_STR((uint_t)(type)))

typedef enum {
	CMSD_SERVICE_TYPE_REQUEST_REGISTER	=	1,
	CMSD_SERVICE_TYPE_REQUEST_UNREGISTER	=	2,
	CMSD_SERVICE_TYPE_REQUEST_MONITOR	=	3,
	CMSD_SERVICE_TYPE_REQUEST_NOTIFY	=	4,
	CMSD_SERVICE_TYPE_REQUEST_DATA		=	5,
	CMSD_SERVICE_TYPE_REQUEST_STATS		=	6,	
	CMSD_SERVICE_TYPE_REQUEST_PULSE		=	7,
	CMSD_SERVICE_TYPE_REQUEST_ADMIN		=	8,
	CMSD_SERVICE_TYPE_REQUEST_LONELY	=	9,	/* dummy */
	CMSD_SERVICE_TYPE_REQUEST_NONE		=      10,	/* dummy */
	CMSD_SERVICE_TYPE_REPLY_REGISTER	=	CMSD_STR(1),
	CMSD_SERVICE_TYPE_REPLY_UNREGISTER	=	CMSD_STR(2),
	CMSD_SERVICE_TYPE_REPLY_MONITOR		=	CMSD_STR(3),
	CMSD_SERVICE_TYPE_REPLY_NOTIFY		=	CMSD_STR(4),
	CMSD_SERVICE_TYPE_REPLY_DATA		=	CMSD_STR(5),
	CMSD_SERVICE_TYPE_REPLY_STATS		=	CMSD_STR(6),
	CMSD_SERVICE_TYPE_REPLY_PULSE		=	CMSD_STR(7), /*dummy*/
	CMSD_SERVICE_TYPE_REPLY_ADMIN		=	CMSD_STR(8),
	CMSD_SERVICE_TYPE_REPLY_LONELY		=	CMSD_STR(9),
	CMSD_SERVICE_TYPE_REPLY_NONE		=	CMSD_STR(10)
} cmsd_service_type_t;

typedef	enum {
	CMS_ADMIN_INVALID		=	0,
	CMS_ADMIN_PARAM_GET		=	4,
	CMS_ADMIN_NODE_SUSPEND		=	5,
	CMS_ADMIN_FSTOP_SUSPEND		=	7,
	CMS_ADMIN_TIMEOUT_SUSPEND	=	11,
	CMS_ADMIN_TIMEOUT_RESUME	=	12,
	CMS_ADMIN_TIMEOUT_ALL_SUSPEND	=	13,
	CMS_ADMIN_TIMEOUT_ALL_RESUME	=	14
} cms_admin_cmd_t;


typedef struct cmsd_service_hdr_s {
	uint_t			magic;
	uint_t			version;
	cmsd_service_type_t	type;
	ci_err_t		error;
	ci_nodeid_t		nodeid;
	uint_t			clientid;
	uint_t			domain;
	uint_t			node_cnt;
	uint_t			sqn;
	uint_t			global_sqn;
  	uint_t			change;	/* What has changed in the new info */
	struct timeval		tv;	/* Time since this membership has
					 * been valid. */
} cmsd_service_hdr_t;

typedef struct cmsd_service_msg_s {
	cmsd_service_hdr_t	hdr;
	char			data[1];
} cmsd_service_msg_t;

typedef enum {
	CLIENT_TYPE_ADMIN	=	1,	/* An admin client is a client
						 * that does not need to see
						 * all membership changes. 
						 * Cmsd does not buffer 
						 * membership changes for such
						 * clients. At any point only
						 * the last confirmed 
						 * memberships are delivered.
						 * Example: cms_info */

	CLIENT_TYPE_NORMAL	=	2,	/* Normal clients are those
						 * clients that must see *all*
						 * membership changes. Cmsd
						 * will buffer all membership
						 * changes for each normal
						 * client. It is imperative
						 * that normale clients 
						 * retrieve memberships at 
						 * least as fast as cmsd
						 * generated them so that cmsd
						 * does not run out of space.
						 * Cmsd can buffer upto
						 * CMSD_MEMB_FREELIST_NUM
						 * memberships at a time
						 * (see cmsd_memb.[ch]).
						 * Example: gcd */

	CLIENT_TYPE_MONITOR	=	3,	/* Monitor clients are 
						 * somewhat in between admin 
						 * clients and normal clients.
						 * They need to see as many 
						 * membeship changes as 
						 * possible, however they do
						 * not promise they will be 
						 * pulling out memberships as
						 * at any given rate. On the
						 * other hand they can deal 
						 * with arbitrary number of 
						 * skipped memberships.
						 * Example: cam monitor */

	CLIENT_TYPE_STATS	=	4	/* This is a special client
						 * of the cms subsystem which 
						 * is not interested in the 
						 * memberships generated by 
						 * cmsd. Instead it needs 
						 * information about the
						 * network statistics gathered
						 * by cmsd during membership
						 * computation. 
						 * Example: PCP */
} cmsd_client_type_t;

#define CMSD_CLIENT_NAME_SIZE    32

typedef struct cmsd_service_register_msg_s {
	cmsd_client_type_t	type;
	char			name[CMSD_CLIENT_NAME_SIZE];
	uint_t			signal;
	uint_t			sigtimeout;
	uint_t			deadtimeout;
} cmsd_service_register_msg_t;

typedef	struct cmsd_service_notify_msg_s {
	uint_t			action;
	uint_t			signal;
} cmsd_service_notify_msg_t;

typedef	struct cmsd_service_monitor_msg_s {
	uint_t			magic;
	uint_t			action;
	uint_t			signal;
	uint_t			sigtimeout;
	uint_t			deadtimeout;
} cmsd_service_monitor_msg_t;

typedef struct cmsd_service_admin_hdr_s {
	uint_t			magic;
	cms_admin_cmd_t		cmd;
	size_t			size;
} cmsd_service_admin_hdr_t;

typedef struct cmsd_service_admin_msg_s {
	cmsd_service_admin_hdr_t	hdr;
	char			data[1];
} cmsd_service_admin_msg_t;

#define	CMS_ADMIN_ARG_SIZE	(CMS_MSG_SIZE - (sizeof(cmsd_service_hdr_t) + sizeof(cmsd_service_admin_hdr_t)))