FreeBSD/Linux Kernel Cross Reference
sys/netncp/ncp_user.h
1 /*-
2 * Copyright (c) 1999, Boris Popov
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. All advertising materials mentioning features or use of this software
14 * must display the following acknowledgement:
15 * This product includes software developed by Boris Popov.
16 * 4. Neither the name of the author nor the names of any co-contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * $FreeBSD$
33 */
34 #ifndef _NETNCP_NCP_USER_H_
35 #define _NETNCP_NCP_USER_H_
36
37 /*
38 * "ncp" interface to kernel, this can be done via syscalls but may eat
39 * a lot of them, so we select internal code, define req's and replays
40 * as necessary. Structure for call is simple:
41 * byte=NCP_CONN
42 * byte=NCP_CONN_SUBFN
43 * ....=data
44 */
45 #define NCP_CONN 0xF5 /* change if that will occupied */
46 #define NCP_CONN_READ 0x01 /* read from file handle */
47 #define NCP_CONN_WRITE 0x02 /* write to file handle */
48 #define NCP_CONN_SETFLAGS 0x03 /* word mask, word flags */
49 #define NCP_CONN_LOGIN 0x04 /* bind login on handle */
50 #define NCP_CONN_GETINFO 0x05 /* get information about connection */
51 #define NCP_CONN_GETUSER 0x06 /* get user name for connection */
52 #define NCP_CONN_CONN2REF 0x07 /* convert handle to reference */
53 #define NCP_CONN_CONNCLOSE 0x08 /* release connection handle */
54 #define NCP_CONN_FRAG 0x09 /* ncp fragmented request */
55 #define NCP_CONN_DUP 0x0A /* get an additional handle */
56 #define NCP_CONN_GETDATA 0x0B /* retrieve NCP_CD_* vals */
57 #define NCP_CONN_SETDATA 0x0C /* store NCP_CD_* vals */
58
59 /*
60 * Internal connection data can be set by owner or superuser and retrieved
61 * only by superuser
62 */
63 #define NCP_CD_NDSLOGINKEY 0x01
64 #define NCP_CD_NDSPRIVATEKEY 0x02
65 #define NCP_CD_NDSUFLAGS 0x03
66
67 /* user side structures to issue fragmented ncp calls */
68 typedef struct {
69 char *fragAddress;
70 u_int32_t fragSize;
71 } NW_FRAGMENT;
72
73
74 struct ncp_rw {
75 ncp_fh nrw_fh;
76 char *nrw_base;
77 off_t nrw_offset;
78 int nrw_cnt;
79 };
80
81 struct ncp_conn_login {
82 char *username;
83 int objtype;
84 char *password;
85 };
86
87 struct ncp_conn_frag {
88 int cc; /* completion code */
89 int cs; /* connection state */
90 int fn;
91 int rqfcnt;
92 NW_FRAGMENT *rqf;
93 int rpfcnt;
94 NW_FRAGMENT *rpf;
95 };
96
97 #endif
Cache object: bbd2ebf17d741a7eb54494b961c61ee7
|