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

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

Revision 1.1, Thu Aug 31 19:55:34 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 of the GNU 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 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
 */
/*
 * fs_admin.h
 *
 * This file contains all the interface constructs for administration functions
 */

#ifndef FS_ADMIN_H
#define FS_ADMIN_H
#ident "$Id: fs_admin.h,v 1.1 2000/08/31 19:55:34 vasa Exp $"

#include <fs_client.h>

#define FS_SERVER_SOCKET	CI_HACOMM_DIR "/" "fsd.server"
#define FSADM_VERSION		1
#define FSADM_REPLY_VERSION	1
#define FSADM_DEBUG_VERSION	1
#define FSADM_ADMIN_VERSION	1
#define FSADM_PERF_VERSION	1
#define FSADM_RGQUERY_VERSION	1
#define FSADM_CAM_REGISTER_VERSION 1
#define FSADM_CAM_REGISTER_REPLY_VERSION 1
#define FSADM_CAM_UNREGISTER_VERSION 1


/* Macros to allow rounding lengths to 4 byte boundaries */
#define ROUNDUP		4
#define FS_ROUND(x)	( ((x) % ROUNDUP) == 0 ? (x) : \
			  (((x) / ROUNDUP) + 1) * ROUNDUP)


/*
 * Administration Debug structure
 */
typedef struct fs_adm_debug_s {
    uint32_t			ad_version;
    fs_adm_debug_action_t	ad_action;
    uint32_t			ad_flags;
    uint32_t			ad_level;
} fs_adm_debug_t;


/*
 * A machine can only be MAXNAMELEN because that's the maximum length
 * of a filename in XFS, and our DB is currently built on top of XFS.
 *
 * If any fields in this change, then so must ftf_admin_actions_t in
 * fs_fsmsgs.h (daemon code).
 */
typedef struct fs_adm_admin_s {
    uint32_t			aa_version;
    fs_adm_admin_actions_t	aa_action;
    char			aa_rgname[FS_MAX_RESGRPNAMELEN];
    char			aa_cluster[MAXNAMELEN];
    char			aa_machine[MAXNAMELEN];
} fs_adm_admin_t;


typedef struct fs_adm_rgquery_s {
    uint32_t			argq_version;
    char			argq_rgname[FS_MAX_RESGRPNAMELEN];
    char			argq_cluster[MAXNAMELEN];
} fs_adm_rgquery_t;


/*
 * Administration performance interface structure
 */
typedef struct fs_adm_perf_s {
    uint32_t			ap_version;
    uint32_t			ap_foo;
} fs_adm_perf_t;


/*
 * CAM notification registration.  Keep all 3 structures the same size
 * and the version and handle fields in the same position w/in the structure.
 *
 * The fs_adm_cam_reg_t structure has an extra field which is used by the
 * server to keep track of incoming registration requests.  The server
 * uses the fd field in the top level request structure to store away the
 * socket descriptor for each connection.
 *
 * The fs_adm_cam_reg_reply_t structure has an extra field which is used by
 * the client library code to keep track of connection requests to the server.
 */
typedef struct fs_adm_cam_reg_s {
    uint32_t			acr_version;
    fs_cam_handle_t		acr_handle;	/* for internal use only */
    uint32_t			acr_flags;
    uint32_t			acr_unused[7];
} fs_adm_cam_reg_t;

typedef struct fs_adm_cam_reg_reply_s {
    uint32_t			acrr_version;
    fs_cam_handle_t		acrr_handle;
    int32_t			acrr_fd;	/* for internal use only */
    uint32_t			acrr_unused[7];
} fs_adm_cam_reg_reply_t;

typedef struct fs_adm_cam_unreg_s {
    uint32_t			acu_version;
    fs_cam_handle_t		acu_handle;
    uint32_t			acu_filler;
    uint32_t			acu_unused[7];
} fs_adm_cam_unreg_t;


/*
 * Possible Administration actions.  Leave some room at the front.
 * 1 is mapped to cdb notification.
 */
typedef enum {
    FSADM_NULL			= 0,
    FSADM_NOTIFY		= 1,	/* reserved by cdb notify */
    FSADM_MIN			= 100,
    FSADM_DEBUG			= 101,
    FSADM_ADMIN			= 102,
    FSADM_PERF			= 103,
    FSADM_RESGROUP_STATUS	= 104,
    FSADM_CAM_REGISTER		= 105,
    FSADM_CAM_UNREGISTER	= 106,
    FSADM_MAX			= 107
} fs_adm_action_t;


/*
 * Generic administration action request; this header can not change
 * because it maps identically to the notification header.
 */
typedef struct fs_header_s {
    uint32_t	h_type;
    uint32_t	h_version;
    uint32_t	h_size;
} fs_header_t;
#define a_version	a_head.h_version
#define a_size		a_head.h_size
#define a_action	a_head.h_type

/*
 * This structure can not change size unless internal daemon code is
 * changed.  See __ftf_send_admin_mesg() in fs_interprocess.c
 */
typedef struct fs_admin_req_s {
    fs_header_t			a_head;
    int32_t			a_cfd;	     /* internal use: fd for request */
    fs_adm_reply_status_t	a_status;    /* internal use: req status */
    uint32_t			a_unused[20];/* 40 bytes of total header */
    union {
	fs_adm_debug_t	   d_debug;
	fs_adm_admin_t	   d_admin;
	fs_adm_perf_t	   d_perf;
	fs_adm_rgquery_t   d_rgquery;
	fs_adm_cam_reg_t   d_cam_reg;
	fs_adm_cam_unreg_t d_cam_unreg;
    }				a_data;
} fs_admin_req_t;

fs_adm_reply_status_t	__fs_send_request(void *, uint32_t, void *, uint32_t);
fs_adm_reply_status_t	__fs_connect(int *cfd);
#endif /* FS_ADMIN_H */