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