sad.h revision d3e55dcdc881b833a707e39ae1e12d8d5d35ad2d
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#ifndef _SYS_SAD_H
#define _SYS_SAD_H
#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.5 */
#ifdef _KERNEL
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*
* Streams Administrative Driver
*/
/*
* As time has passed, it has become necessary to add members to some
* of the structures passed downstream with these ioctls. Currently,
* strapush structure), but the versioning mechanism is general enough
* to be applied to any SAD ioctls. This is done by repartitioning
* the SAD ioctl namespace to include a version number in addition to
* the command (see below).
*
* choose which "version" of the ioctl to use by #defining AP_VERSION
* before including this file. Old code implicitly has AP_VERSION set
* to 0, and even newly compiled code defaults to an AP_VERSION of 0,
* since it may not be aware of the new structure members and
* therefore not know to set them to reasonable values. In order for
* programs to make use of a newer version, they must explicitly
* #define AP_VERSION to the appropriate value. Note that the kernel
* always defaults to the latest version, since it is internally
* self-consistent.
*/
#ifndef AP_VERSION
#ifdef _KERNEL
#else
#define AP_VERSION 0 /* SVR4 version */
#endif
#endif
/*
* ioctl defines
*
* The layout for the low 16 bits is 01000101VVVVCCCC, where the
* first bitpattern is `D' in binary, followed by a 4 bit version
* field (limiting the number of versions to 16), followed by a
* 4 bit command field (limiting the number of commands to 16).
*/
/*
* Device naming and numbering conventions.
*/
#define USRMIN 0
#define ADMMIN 1
/*
* The maximum modules you can push on a stream using the autopush
* feature. This should be less than NSTRPUSH.
*/
#define MAXAPUSH 8
/*
* autopush info common to user and kernel
*/
struct apcommon {
};
/*
* New autopush information structure. This wouldn't be necessary
* except `struct apcommon' wasn't defined last in the `strapush'
* structure, making it difficult to grow the structure without
* breaking binary compatibility. Note that new members can be added
* to this structure in the future, at which point AP_VERSION should
* be incremented (of course, a new STRAPUSH_Vx_LEN macro should be
* added and sad.c should be changed to handle the new member).
*/
struct apdata {
};
/*
* ap_cmd: various flavors of autopush
*/
#define SAP_CLEAR 0 /* remove configuration list */
/*
* format for autopush ioctls
*/
struct strapush {
#if AP_VERSION > 0
#endif
};
#ifdef _KERNEL
/*
* state values for ioctls
*/
#define GETSTRUCT 1
#define GETRESULT 2
#define GETLIST 3
struct saddev {
int sa_flags; /* see below */
};
/*
* values for saddev flags field.
*/
#define SADPRIV 0x01
/*
* Module Autopush Cache
*/
struct autopush {
/* list of modules to push */
int ap_cnt; /* in use count */
};
/*
* The command issued by the user ultimately becomes
* the type of the autopush entry. Therefore, occurrences of
* "type" in the code refer to an existing autopush entry.
* Occurrences of "cmd" in the code refer to the command the
* user is currently trying to complete. types and cmds take
* on the same values.
*/
/*
* function prototypes
*/
struct strbuf;
unsigned char, int, int);
void audit_fdsend(int, struct file *, int);
void audit_fdrecv(int, struct file *);
extern void sad_initspace(str_stack_t *);
extern void sad_freespace(str_stack_t *);
/*
* The following interfaces do not care about ss_sad_lock.
*/
extern struct autopush *sad_ap_alloc(void);
extern int sad_apc_verify(struct apcommon *);
extern int sad_ap_verify(struct autopush *);
/*
* The following interfaces attempt to acquire ss_sad_lock.
*/
/*
* The following interfaces require ss_sad_lock to be held when invoked.
*/
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_SAD_H */