ksocket.h revision 3076c25a759075dcc052165713ce638ecf989184
/*
* 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 2011 Nexenta Systems, Inc. All rights reserved.
*/
#ifndef _SYS_KSOCKET_H_
#define _SYS_KSOCKET_H_
#ifdef __cplusplus
extern "C" {
#endif
/* Opaque kernel socket type */
struct nmsghdr;
/* flag bit for each Callback Event */
#define KSOCKET_CB_CONNECTED 0x00000001
#define KSOCKET_CB_CONNECTFAILED 0x00000002
#define KSOCKET_CB_DISCONNECTED 0x00000004
#define KSOCKET_CB_NEWDATA 0x00000008
#define KSOCKET_CB_NEWCONN 0x00000010
#define KSOCKET_CB_CANSEND 0x00000020
#define KSOCKET_CB_OOBDATA 0x00000040
#define KSOCKET_CB_CANTSENDMORE 0x00000080
#define KSOCKET_CB_CANTRECVMORE 0x00000100
#define KSOCKET_CB_ERROR 0x00000200
/*
* Kernel Socket Callback Events
*/
typedef enum ksocket_event {
void *, uintptr_t);
typedef struct ksocket_callbacks {
#define KSOCKET_SLEEP SOCKET_SLEEP
#define KSOCKET_NOSLEEP SOCKET_NOSLEEP
struct cred *);
struct cred *);
struct cred *);
struct cred *);
struct cred *);
struct cred *);
struct cred *);
extern int ksocket_setsockopt(ksocket_t, int, int, const void *, int,
struct cred *);
extern int ksocket_getsockopt(ksocket_t, int, int, void *, int *,
struct cred *);
struct cred *);
struct cred *);
struct cred *);
extern void ksocket_hold(ksocket_t);
extern void ksocket_rele(ksocket_t);
#ifdef __cplusplus
}
#endif
#endif /* _SYS_KSOCKET_H_ */