xref: /titanic_50/usr/src/uts/common/fs/sockfs/nl7c.h (revision d7ddd43c70ebe97a1118be9f663a54d0d1d89fe6)
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 2008 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 #ifdef	__cplusplus
30 extern "C" {
31 #endif
32 
33 #include <sys/types.h>
34 #include <sys/atomic.h>
35 #include <sys/cmn_err.h>
36 #include <sys/stropts.h>
37 #include <sys/socket.h>
38 #include <sys/socketvar.h>
39 
40 
41 /*
42  * NCA_DEV	NCA device
43  *
44  * NCA_INET_DEV	TPI device for the INET based transport that NCA will use.
45  */
46 #define	NCA_DEV		"/dev/nca"
47 #define	NCA_INET_DEV	"/dev/tcp"
48 
49 /*
50  * NL7C (uint64_t)(sotpi_info_t).sti_nl7c_flags:
51  */
52 
53 #define	NL7C_ENABLED	0x00000001 /* NL7C enabled socket */
54 #define	NL7C_SOPERSIST	0x00000002 /* NL7C socket is persistent */
55 #define	NL7C_WAITWRITE	0x00000004 /* NL7C waiting first write */
56 #define	NL7C_AF_NCA	0x00000008 /* NL7C enabled socket via AF_NCA */
57 #define	NL7C_POLLIN	0x00000010 /* poll() POLLIN prior to read */
58 #define	NL7C_CLOSE	0x00000020 /* NL7C close needed */
59 
60 #define	NL7C_SCHEMEPRIV	0xFFFF0000 /* NL7C scheme private state */
61 
62 #define	NL7C_UNUSED	0xFFFFFFFF00000000 /* Unused bits */
63 
64 /*
65  * Globals ...
66  */
67 
68 extern boolean_t	nl7c_enabled;
69 extern clock_t		nl7c_uri_ttl;
70 
71 /*
72  * Function prototypes ...
73  */
74 
75 boolean_t	nl7c_process(struct sonode *, boolean_t);
76 int		nl7c_data(struct sonode *, uio_t *);
77 void		nl7c_urifree(struct sonode *);
78 void		nl7c_close(struct sonode *);
79 boolean_t	nl7c_parse(struct sonode *, boolean_t, boolean_t *);
80 
81 extern		void *nl7c_lookup_addr(void *, t_uscalar_t);
82 extern		void *nl7c_add_addr(void *, t_uscalar_t);
83 extern		void nl7c_listener_addr(void *, struct sonode *);
84 
85 #ifdef	__cplusplus
86 }
87 #endif
88 
89 #endif	/* _SYS_SOCKFS_NL7C_H */
90