Home | History | Annotate | Download | only in nfs
      1 /*
      2  * CDDL HEADER START
      3  *
      4  * The contents of this file are subject to the terms of the
      5  * Common Development and Distribution License (the "License").
      6  * You may not use this file except in compliance with the License.
      7  *
      8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
      9  * or http://www.opensolaris.org/os/licensing.
     10  * See the License for the specific language governing permissions
     11  * and limitations under the License.
     12  *
     13  * When distributing Covered Code, include this CDDL HEADER in each
     14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     15  * If applicable, add the following below this CDDL HEADER, with the
     16  * fields enclosed by brackets "[]" replaced with your own identifying
     17  * information: Portions Copyright [yyyy] [name of copyright owner]
     18  *
     19  * CDDL HEADER END
     20  */
     21 
     22 /*
     23  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
     24  * Use is subject to license terms.
     25  */
     26 
     27 #ifndef _SPE_H
     28 #define	_SPE_H
     29 
     30 #ifndef _KERNEL
     31 #include <stddef.h>
     32 #endif
     33 
     34 #include <sys/sysmacros.h>
     35 #include <sys/types.h>
     36 
     37 #include <nfs/spe_prot.h>
     38 
     39 /*
     40  * Simple Policy Engine - spe
     41  *
     42  * This daemon is used to determine simple policies for pnfs layouts.
     43  */
     44 
     45 #ifdef	__cplusplus
     46 extern "C" {
     47 #endif
     48 
     49 /*
     50  * spe messages from the kernel to the daemon
     51  */
     52 #define	SPE_SPE_STATS		1
     53 #define	SPE_DS_ZPOOL		2
     54 #define	SPE_RE_EVENT		3
     55 #define	SPE_SS_EVENT		4
     56 
     57 /*
     58  * sped messages from the daemon to the kernel
     59  */
     60 #define	SPE_DOOR_MAP			1
     61 
     62 /*
     63  * The sped data structures...
     64  */
     65 
     66 #define	MAXBUFSIZE 1024
     67 
     68 #ifndef FALSE
     69 #define	FALSE 0
     70 #endif
     71 
     72 #ifndef TRUE
     73 #define	TRUE 1
     74 #endif
     75 
     76 typedef struct {
     77 	char	*path;
     78 	char	*ext;
     79 	char	*base;
     80 	char	*file;
     81 } spe_path;
     82 
     83 typedef struct {
     84 	uid_t		uid;
     85 	gid_t		gid;
     86 	int		day;
     87 	int		hour;
     88 	uint_t		addr;
     89 	uint_t		mask;
     90 	char		*weekday;
     91 	char		*user;
     92 	char		*group;
     93 	char		*host;
     94 	char		*domain;
     95 	char		*fqdn;
     96 	spe_path	sp_server;
     97 	spe_path	sp_client;
     98 } policy_attributes;
     99 
    100 #ifdef	__cplusplus
    101 }
    102 #endif
    103 
    104 #endif /* _SPE_H */
    105