socket_proto.h revision 081c0aa8fd8d801a6b12e7245814d260095dc103
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_SOCKET_PROTO_H_
#define _SYS_SOCKET_PROTO_H_
#ifdef __cplusplus
extern "C" {
#endif
/*
* Generation count
*/
typedef uint64_t sock_connid_t;
#define SOCK_CONNID_INIT(id) { \
(id) = 0; \
}
/* Socket protocol properties */
struct sock_proto_props {
};
/* flags to determine which socket options are set */
#define SOCKOPT_RCVTIMER 0x0100
#define SOCKOPT_RCVTHRESH 0x0200
#ifdef _KERNEL
struct T_capability_ack;
typedef struct sock_upcalls_s sock_upcalls_t;
typedef struct sock_downcalls_s sock_downcalls_t;
/*
* Upcall and downcall handle for sockfs and transport layer.
*/
typedef struct __sock_upper_handle *sock_upper_handle_t;
typedef struct __sock_lower_handle *sock_lower_handle_t;
struct sock_downcalls_s {
sock_upcalls_t *, int, cred_t *);
cred_t *);
int (*sd_getsockopt)(sock_lower_handle_t, int, int, void *,
int (*sd_setsockopt)(sock_lower_handle_t, int, int, const void *,
cred_t *);
cred_t *);
cred_t *);
void (*sd_clr_flowctrl)(sock_lower_handle_t);
};
typedef sock_lower_handle_t (*so_proto_create_func_t)(int, int, int,
/*
* Upcalls and related information
*/
/*
* su_opctl() actions
*/
typedef enum sock_opctl_action {
struct sock_upcalls_s {
sock_upcalls_t **);
pid_t);
int *, boolean_t *);
void (*su_set_proto_props)(sock_upper_handle_t,
struct sock_proto_props *);
void (*su_zcopy_notify)(sock_upper_handle_t);
void (*su_set_error)(sock_upper_handle_t, int);
};
#define SOCK_UC_VERSION sizeof (sock_upcalls_t)
#define SOCK_DC_VERSION sizeof (sock_downcalls_t)
#define SOCKET_RECVLOWATER 1024
#define SOCKET_NO_RCVTIMER 0
#define SOCKET_TIMER_INTERVAL 50
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_SOCKET_PROTO_H_ */