socktpi_impl.h revision 8348:4137e18bfaf0
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
34extern "C" {
35#endif
36
37/*
38 * so_priv will always be set to &st_info
39 */
40typedef struct sotpi_sonode {
41	struct sonode st_sonode;
42	struct sotpi_info st_info;
43} sotpi_sonode_t;
44
45extern void	so_proc_tcapability_ack(struct sonode *,
46		    struct T_capability_ack *);
47extern void	so_basic_strinit(struct sonode *);
48extern void 	so_alloc_addr(struct sonode *, t_uscalar_t);
49extern int	so_set_events(struct sonode *, vnode_t *, cred_t *);
50extern int	so_sock2stream(struct sonode *);
51extern void	so_stream2sock(struct sonode *);
52
53extern int	so_strinit(struct sonode *, struct sonode *);
54extern void	so_update_attrs(struct sonode *, int);
55extern int	sogetrderr(vnode_t *, int, int *);
56extern int	sogetwrerr(vnode_t *, int, int *);
57extern int	so_addr_verify(struct sonode *, const struct sockaddr *,
58			socklen_t);
59extern int	so_ux_addr_xlate(struct sonode *, struct sockaddr *,
60			socklen_t, int, void **, socklen_t *);
61extern void	so_unix_close(struct sonode *);
62
63extern int	sowaitprim(struct sonode *, t_scalar_t, t_scalar_t,
64			t_uscalar_t, mblk_t **, clock_t);
65extern int	sowaitokack(struct sonode *, t_scalar_t);
66extern int	sowaitack(struct sonode *, mblk_t **, clock_t);
67extern void	soqueueack(struct sonode *, mblk_t *);
68extern int	sowaitconnind(struct sonode *, int, mblk_t **);
69extern void	soqueueconnind(struct sonode *, mblk_t *);
70extern int	soflushconnind(struct sonode *, t_scalar_t);
71extern void	so_drain_discon_ind(struct sonode *);
72extern void	so_flush_discon_ind(struct sonode *);
73
74extern mblk_t	*soallocproto(size_t, int);
75extern mblk_t	*soallocproto1(const void *, ssize_t, ssize_t, int);
76extern void	soappendmsg(mblk_t *, const void *, ssize_t);
77extern mblk_t	*soallocproto2(const void *, ssize_t, const void *, ssize_t,
78			ssize_t, int);
79extern mblk_t	*soallocproto3(const void *, ssize_t, const void *, ssize_t,
80			const void *, ssize_t, ssize_t, int);
81
82extern int	so_set_asyncsigs(vnode_t *, pid_t, int, int, cred_t *);
83extern int	so_flip_async(struct sonode *, vnode_t *, int, cred_t *);
84extern int	so_set_siggrp(struct sonode *, vnode_t *, pid_t, int, cred_t *);
85
86extern void	so_installhooks(struct sonode *);
87
88extern int 	kstrwritemp(struct vnode *, mblk_t *, ushort_t);
89extern int	sostream_direct(struct sonode *, struct uio *,
90		    mblk_t *, cred_t *);
91extern int	sosend_dgram(struct sonode *, struct sockaddr *,
92		    socklen_t, struct uio *, int);
93extern 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