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 (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
23 */
24
25 #ifndef _SYS_SOCKET_PROTO_H_
26 #define _SYS_SOCKET_PROTO_H_
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 #include <sys/socket.h>
33
34 /*
35 * Generation count
36 */
37 typedef uint64_t sock_connid_t;
38
39 #define SOCK_CONNID_INIT(id) { \
40 (id) = 0; \
41 }
42 #define SOCK_CONNID_BUMP(id) (++(id))
43 #define SOCK_CONNID_LT(id1, id2) ((int64_t)((id1)-(id2)) < 0)
44
45 /* Socket protocol properties */
46 struct sock_proto_props {
47 uint_t sopp_flags; /* options to set */
48 ushort_t sopp_wroff; /* write offset */
49 ssize_t sopp_txhiwat; /* tx hi water mark */
50 ssize_t sopp_txlowat; /* tx lo water mark */
51 ssize_t sopp_rxhiwat; /* recv high water mark */
52 ssize_t sopp_rxlowat; /* recv low water mark */
183 } sock_opctl_action_t;
184
185 struct sock_upcalls_s {
186 sock_upper_handle_t (*su_newconn)(sock_upper_handle_t,
187 sock_lower_handle_t, sock_downcalls_t *, cred_t *, pid_t,
188 sock_upcalls_t **);
189 void (*su_connected)(sock_upper_handle_t, sock_connid_t, cred_t *,
190 pid_t);
191 int (*su_disconnected)(sock_upper_handle_t, sock_connid_t, int);
192 void (*su_opctl)(sock_upper_handle_t, sock_opctl_action_t,
193 uintptr_t);
194 ssize_t (*su_recv)(sock_upper_handle_t, mblk_t *, size_t, int,
195 int *, boolean_t *);
196 void (*su_set_proto_props)(sock_upper_handle_t,
197 struct sock_proto_props *);
198 void (*su_txq_full)(sock_upper_handle_t, boolean_t);
199 void (*su_signal_oob)(sock_upper_handle_t, ssize_t);
200 void (*su_zcopy_notify)(sock_upper_handle_t);
201 void (*su_set_error)(sock_upper_handle_t, int);
202 void (*su_closed)(sock_upper_handle_t);
203 };
204
205 #define SOCK_UC_VERSION sizeof (sock_upcalls_t)
206 #define SOCK_DC_VERSION sizeof (sock_downcalls_t)
207
208 #define SOCKET_RECVHIWATER (48 * 1024)
209 #define SOCKET_RECVLOWATER 1024
210
211 #define SOCKET_NO_RCVTIMER 0
212 #define SOCKET_TIMER_INTERVAL 50
213
214 #endif /* _KERNEL */
215
216 #ifdef __cplusplus
217 }
218 #endif
219
220 #endif /* _SYS_SOCKET_PROTO_H_ */
|
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 (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
23 */
24
25 #ifndef _SYS_SOCKET_PROTO_H_
26 #define _SYS_SOCKET_PROTO_H_
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 #include <sys/socket.h>
33 #include <sys/pidnode.h>
34
35 /*
36 * Generation count
37 */
38 typedef uint64_t sock_connid_t;
39
40 #define SOCK_CONNID_INIT(id) { \
41 (id) = 0; \
42 }
43 #define SOCK_CONNID_BUMP(id) (++(id))
44 #define SOCK_CONNID_LT(id1, id2) ((int64_t)((id1)-(id2)) < 0)
45
46 /* Socket protocol properties */
47 struct sock_proto_props {
48 uint_t sopp_flags; /* options to set */
49 ushort_t sopp_wroff; /* write offset */
50 ssize_t sopp_txhiwat; /* tx hi water mark */
51 ssize_t sopp_txlowat; /* tx lo water mark */
52 ssize_t sopp_rxhiwat; /* recv high water mark */
53 ssize_t sopp_rxlowat; /* recv low water mark */
184 } sock_opctl_action_t;
185
186 struct sock_upcalls_s {
187 sock_upper_handle_t (*su_newconn)(sock_upper_handle_t,
188 sock_lower_handle_t, sock_downcalls_t *, cred_t *, pid_t,
189 sock_upcalls_t **);
190 void (*su_connected)(sock_upper_handle_t, sock_connid_t, cred_t *,
191 pid_t);
192 int (*su_disconnected)(sock_upper_handle_t, sock_connid_t, int);
193 void (*su_opctl)(sock_upper_handle_t, sock_opctl_action_t,
194 uintptr_t);
195 ssize_t (*su_recv)(sock_upper_handle_t, mblk_t *, size_t, int,
196 int *, boolean_t *);
197 void (*su_set_proto_props)(sock_upper_handle_t,
198 struct sock_proto_props *);
199 void (*su_txq_full)(sock_upper_handle_t, boolean_t);
200 void (*su_signal_oob)(sock_upper_handle_t, ssize_t);
201 void (*su_zcopy_notify)(sock_upper_handle_t);
202 void (*su_set_error)(sock_upper_handle_t, int);
203 void (*su_closed)(sock_upper_handle_t);
204 mblk_t *(*su_get_sock_pid_mblk)(sock_upper_handle_t);
205 };
206
207 #define SOCK_UC_VERSION sizeof (sock_upcalls_t)
208 #define SOCK_DC_VERSION sizeof (sock_downcalls_t)
209
210 #define SOCKET_RECVHIWATER (48 * 1024)
211 #define SOCKET_RECVLOWATER 1024
212
213 #define SOCKET_NO_RCVTIMER 0
214 #define SOCKET_TIMER_INTERVAL 50
215
216 #endif /* _KERNEL */
217
218 #ifdef __cplusplus
219 }
220 #endif
221
222 #endif /* _SYS_SOCKET_PROTO_H_ */
|