xref: /titanic_41/usr/src/uts/common/fs/sockfs/nl7c.h (revision 74e20cfe817b82802b16fac8690dadcda76f54f5)
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  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef _SYS_SOCKFS_NL7C_H
27 #define	_SYS_SOCKFS_NL7C_H
28 
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 #ifdef	__cplusplus
32 extern "C" {
33 #endif
34 
35 #include <sys/types.h>
36 #include <sys/atomic.h>
37 #include <sys/cmn_err.h>
38 #include <sys/stropts.h>
39 #include <sys/socket.h>
40 #include <sys/socketvar.h>
41 
42 /*
43  * NL7C (uint64_t)(struct sonode).so_nl7c_flags:
44  */
45 
46 #define	NL7C_ENABLED	0x00000001 /* NL7C enabled socket */
47 #define	NL7C_SOPERSIST	0x00000002 /* NL7C socket is persistent */
48 #define	NL7C_WAITWRITE	0x00000004 /* NL7C waiting first write */
49 #define	NL7C_AF_NCA	0x00000008 /* NL7C enabled socket via AF_NCA */
50 #define	NL7C_POLLIN	0x00000010 /* poll() POLLIN prior to read */
51 #define	NL7C_CLOSE	0x00000020 /* NL7C close needed */
52 
53 #define	NL7C_SCHEMEPRIV	0xFFFF0000 /* NL7C scheme private state */
54 
55 #define	NL7C_UNUSED	0xFFFFFFFF00000000 /* Unused bits */
56 
57 /*
58  * Globals ...
59  */
60 
61 extern boolean_t	nl7c_enabled;
62 extern clock_t		nl7c_uri_ttl;
63 
64 /*
65  * Function prototypes ...
66  */
67 
68 boolean_t	nl7c_process(struct sonode *, boolean_t);
69 int		nl7c_data(struct sonode *, uio_t *);
70 void		nl7c_urifree(struct sonode *);
71 void		nl7c_close(struct sonode *);
72 boolean_t	nl7c_parse(struct sonode *, boolean_t, boolean_t *);
73 
74 #ifdef	__cplusplus
75 }
76 #endif
77 
78 #endif	/* _SYS_SOCKFS_NL7C_H */
79