summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/sys/t_kuser.h
blob: da749ac81bd88e1154d770f6c1c80e5b891a7e66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (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
 * or http://www.opensolaris.org/os/licensing.
 * 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 1998 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 */

/*	Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T	*/
/*	  All Rights Reserved  	*/

/*
 * University Copyright- Copyright (c) 1982, 1986, 1988
 * The Regents of the University of California
 * All Rights Reserved
 *
 * University Acknowledgment- Portions of this document are derived from
 * software developed by the University of California, Berkeley, and its
 * contributors.
 */

#ifndef	_SYS_T_KUSER_H
#define	_SYS_T_KUSER_H

#pragma ident	"%Z%%M%	%I%	%E% SMI"

#include <sys/types.h>
#include <sys/file.h>
#include <sys/cred.h>
#include <sys/stream.h>
#include <sys/tiuser.h>

#ifdef	__cplusplus
extern "C" {
#endif

/*
 * Note this structure will need to be expanded to handle data
 * related to connection orientated transports.
 */
typedef struct tiuser {
	struct	file *fp;
	struct	t_info tp_info;	/* Transport provider Info. */
	int	flags;
} TIUSER;
#define		TIUSERSZ	sizeof (TIUSER)

struct knetbuf {
	mblk_t   *udata_mp;	/* current receive streams block */
	unsigned int maxlen;
	unsigned int len;
	char	*buf;
};

struct t_kunitdata {
	struct netbuf addr;
	struct netbuf opt;
	struct knetbuf udata;
};


#ifdef KTLIDEBUG
extern int	ktli_log();
extern int	ktlilog;

#define		KTLILOG(A, B, C) ((void)((ktlilog) && ktli_log((A), (B), (C))))
#else
#define		KTLILOG(A, B, C)
#endif

/*
 * flags
 */
#define		MADE_FP		0x02


#ifdef __STDC__

extern int	t_kalloc(TIUSER *, int, int, char **);
extern int	t_kbind(TIUSER *, struct t_bind *, struct t_bind *);
extern int	t_kclose(TIUSER *, int);
extern int	t_kconnect(TIUSER *, struct t_call *, struct t_call *);
extern int	t_kfree(TIUSER *, char *, int);
extern int	t_kgetstate(TIUSER *, int *);
extern int	t_kopen(struct file *, dev_t, int, TIUSER **, struct cred *);
extern int	t_krcvudata(TIUSER *, struct t_kunitdata *, int *, int *);
extern int	t_ksndudata(TIUSER *, struct t_kunitdata *, frtn_t *);
extern int	t_kspoll(TIUSER *, int, int, int *);
extern int	t_kunbind(TIUSER *);
extern int	tli_send(TIUSER *, mblk_t *, int);
extern int	tli_recv(TIUSER *, mblk_t **, int);
extern int	t_tlitosyserr(int);
extern int	get_ok_ack(TIUSER *, int, int);

#else

extern int	t_kalloc();
extern int	t_kbind();
extern int	t_kclose();
extern int	t_kconnect();
extern int	t_kfree();
extern int	t_kgetstate();
extern int	t_kopen();
extern int	t_krcvudata();
extern int	t_ksndudata();
extern int	t_kspoll();
extern int	t_kunbind();
extern int	tli_send();
extern int	tli_recv();
extern int	t_tlitosyserr();
extern int	get_ok_ack();
#endif	/* __STDC__ */

/*
 * these make life a lot easier
 */
#define		TCONNREQSZ	sizeof (struct T_conn_req)
#define		TCONNRESSZ	sizeof (struct T_conn_res)
#define		TDISCONREQSZ	sizeof (struct T_discon_req)
#define		TDATAREQSZ	sizeof (struct T_data_req)
#define		TEXDATAREQSZ	sizeof (struct T_exdata_req)
#define		TINFOREQSZ	sizeof (struct T_info_req)
#define		TBINDREQSZ	sizeof (struct T_bind_req)
#define		TUNBINDREQSZ	sizeof (struct T_unbind_req)
#define		TUNITDATAREQSZ	sizeof (struct T_unitdata_req)
#define		TOPTMGMTREQSZ	sizeof (struct T_optmgmt_req)
#define		TORDRELREQSZ	sizeof (struct T_ordrel_req)
#define		TCONNINDSZ	sizeof (struct T_conn_ind)
#define		TCONNCONSZ	sizeof (struct T_conn_con)
#define		TDISCONINDSZ	sizeof (struct T_discon_ind)
#define		TDATAINDSZ	sizeof (struct T_data_ind)
#define		TEXDATAINDSZ	sizeof (struct T_exdata_ind)
#define		TINFOACKSZ	sizeof (struct T_info_ack)
#define		TBINDACKSZ	sizeof (struct T_bind_ack)
#define		TERRORACKSZ	sizeof (struct T_error_ack)
#define		TOKACKSZ	sizeof (struct T_ok_ack)
#define		TUNITDATAINDSZ	sizeof (struct T_unitdata_ind)
#define		TUDERRORINDSZ	sizeof (struct T_uderror_ind)
#define		TOPTMGMTACKSZ	sizeof (struct T_optmgmt_ack)
#define		TORDRELINDSZ	sizeof (struct T_ordrel_ind)
#define		TPRIMITIVES	sizeof (struct T_primitives)

#ifdef	__cplusplus
}
#endif

#endif	/* _SYS_T_KUSER_H */