xref: /titanic_41/usr/src/uts/common/fs/sockfs/socktpi_impl.h (revision 3afe87ebb25691cb6d158edaa34a6fb9b703a691)
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 2008 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _SOCKFS_SOCKTPI_IMPL_H
28 #define	_SOCKFS_SOCKTPI_IMPL_H
29 
30 #include <sys/socketvar.h>
31 #include <fs/sockfs/socktpi.h>
32 
33 #ifdef	__cplusplus
34 extern "C" {
35 #endif
36 
37 /*
38  * so_priv will always be set to &st_info
39  */
40 typedef struct sotpi_sonode {
41 	struct sonode st_sonode;
42 	struct sotpi_info st_info;
43 } sotpi_sonode_t;
44 
45 extern void	so_proc_tcapability_ack(struct sonode *,
46 		    struct T_capability_ack *);
47 extern void	so_basic_strinit(struct sonode *);
48 extern void 	so_alloc_addr(struct sonode *, t_uscalar_t);
49 extern int	so_set_events(struct sonode *, vnode_t *, cred_t *);
50 extern int	so_sock2stream(struct sonode *);
51 extern void	so_stream2sock(struct sonode *);
52 
53 extern int	so_strinit(struct sonode *, struct sonode *);
54 extern void	so_update_attrs(struct sonode *, int);
55 extern int	sogetrderr(vnode_t *, int, int *);
56 extern int	sogetwrerr(vnode_t *, int, int *);
57 extern int	so_addr_verify(struct sonode *, const struct sockaddr *,
58 			socklen_t);
59 extern int	so_ux_addr_xlate(struct sonode *, struct sockaddr *,
60 			socklen_t, int, void **, socklen_t *);
61 extern void	so_unix_close(struct sonode *);
62 
63 extern int	sowaitprim(struct sonode *, t_scalar_t, t_scalar_t,
64 			t_uscalar_t, mblk_t **, clock_t);
65 extern int	sowaitokack(struct sonode *, t_scalar_t);
66 extern int	sowaitack(struct sonode *, mblk_t **, clock_t);
67 extern void	soqueueack(struct sonode *, mblk_t *);
68 extern int	sowaitconnind(struct sonode *, int, mblk_t **);
69 extern void	soqueueconnind(struct sonode *, mblk_t *);
70 extern int	soflushconnind(struct sonode *, t_scalar_t);
71 extern void	so_drain_discon_ind(struct sonode *);
72 extern void	so_flush_discon_ind(struct sonode *);
73 
74 extern mblk_t	*soallocproto(size_t, int);
75 extern mblk_t	*soallocproto1(const void *, ssize_t, ssize_t, int);
76 extern void	soappendmsg(mblk_t *, const void *, ssize_t);
77 extern mblk_t	*soallocproto2(const void *, ssize_t, const void *, ssize_t,
78 			ssize_t, int);
79 extern mblk_t	*soallocproto3(const void *, ssize_t, const void *, ssize_t,
80 			const void *, ssize_t, ssize_t, int);
81 
82 extern int	so_set_asyncsigs(vnode_t *, pid_t, int, int, cred_t *);
83 extern int	so_flip_async(struct sonode *, vnode_t *, int, cred_t *);
84 extern int	so_set_siggrp(struct sonode *, vnode_t *, pid_t, int, cred_t *);
85 
86 extern void	so_installhooks(struct sonode *);
87 
88 extern int 	kstrwritemp(struct vnode *, mblk_t *, ushort_t);
89 extern int	sostream_direct(struct sonode *, struct uio *,
90 		    mblk_t *, cred_t *);
91 extern int	sosend_dgram(struct sonode *, struct sockaddr *,
92 		    socklen_t, struct uio *, int);
93 extern int	sosend_svc(struct sonode *, struct uio *, t_scalar_t, int, int);
94 
95 #ifdef	__cplusplus
96 }
97 #endif
98 
99 #endif /* _SOCKFS_SOCKTPI_IMPL_H */
100