Print this page
1575 untangle libmlrpc ... (libmlrpc)
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/smbsrv/ndl/ndrtypes.ndl
+++ new/usr/src/lib/libmlrpc/common/ndrtypes.ndl
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
↓ open down ↓ |
13 lines elided |
↑ open up ↑ |
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 23 * Use is subject to license terms.
24 + *
25 + * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
24 26 */
25 27
26 -#ifndef _NDR_TYPES_NDL_
27 -#define _NDR_TYPES_NDL_
28 +#ifndef _NDRTYPES_NDL_
29 +#define _NDRTYPES_NDL_
28 30
31 +/*
32 + * Type definitions (and related) used in NDL files and the
33 + * NDL run-time support libraries. See also: libmlrpc.h
34 + */
35 +
29 36 #define TYPEINFO(TYPE) ndt__##TYPE
30 37
31 38 #ifdef NDRGEN
32 39
33 40 #define ALIGN(X) [align(X)]
34 41 #define OPERATION(X) [operation(X)]
35 42 #define IN [in]
36 43 #define OUT [out]
37 44 #define INOUT [in out]
38 45
39 46 #define STRING [string]
40 47 #define SIZE_IS(X) [size_is(X)]
41 48
42 49 #define SWITCH(X) [switch_is(X)]
43 50 #define CASE(X) [case(X)]
44 51 #define DEFAULT [default]
45 52
46 53 #define INTERFACE(X) [interface(X)]
47 54 #define UUID(X) [uuid(X)]
48 55
49 56 #define ARG_IS(X) [arg_is(X)]
50 57
51 58 #define REFERENCE [reference]
52 59 #define REF [reference]
53 60 #define UNIQUE [unique]
54 61 #define PTR [ptr]
55 62 #define POINTER_DEFAULT(X) [pointer_default(X)]
56 63
57 64 #define ANY_SIZE_ARRAY *
58 65
59 66 #define IMPORT_EXTERN [extern]
60 67
61 68 #define BYTE uchar
↓ open down ↓ |
23 lines elided |
↑ open up ↑ |
62 69 #define WORD ushort
63 70 #define DWORD ulong
64 71 #define ntstatus_t ulong
65 72
66 73 #define LPTSTR STRING wchar *
67 74
68 75 #define LPBYTE uchar *
69 76 #define LPWORD ushort *
70 77 #define LPDWORD ulong *
71 78
72 -/*
73 - * Opaque context handle.
74 - */
75 -#ifndef CONTEXT_HANDLE
76 -#define CONTEXT_HANDLE(NAME) \
77 - struct NAME { \
78 - DWORD data1; \
79 - DWORD data2; \
80 - WORD data3[2]; \
81 - BYTE data4[8]; \
82 - }; \
83 - typedef struct NAME
84 -#endif /* CONTEXT_HANDLE */
85 -
86 79 #define EXTERNTYPEINFO(TYPE)
87 80
88 81 #else /* NDRGEN */
89 82
90 83 #define ALIGN(X)
91 84 #define OPERATION(X)
92 85 #define IN
93 86 #define OUT
94 87 #define INOUT
95 88
96 89 #define STRING
97 90 #define SIZE_IS(X)
98 91
99 92 #define SWITCH(X)
100 93 #define CASE(X)
101 94 #define DEFAULT
102 95
103 96 #define INTERFACE(X)
104 97 #define UUID(X)
105 98
106 99 #define ARG_IS(X)
107 100
108 101 #define REFERENCE
↓ open down ↓ |
13 lines elided |
↑ open up ↑ |
109 102 #define REF
110 103 #define UNIQUE
111 104 #define PTR
112 105 #define POINTER_DEFAULT(X)
113 106
114 107 #define IMPORT_EXTERN
115 108
116 109 /*
117 110 * When not using ndrgen, get BYTE, WORD, DWORD definitions from wintypes.h.
118 111 */
119 -#include <smbsrv/wintypes.h>
112 +#include <smb/wintypes.h>
120 113
121 114 #define EXTERNTYPEINFO(TYPE) extern struct ndr_typeinfo TYPEINFO(TYPE);
122 115
123 116
124 117 /*
125 118 ***********************************************************************
126 119 * There is a bug in the way that midl and the marshalling code handles
127 120 * unions so we need to fix some of the data offsets at runtime. The
128 121 * following macros and the fixup function handle the correction.
129 122 ***********************************************************************
130 123 */
131 124
132 125 /*
133 126 * DECL_FIXUP_STRUCT allows us to declare external references to data
134 127 * structures generated by ndrgen in the _ndr.c file.
135 128 */
136 129 #define DECL_FIXUP_STRUCT(NAME) extern struct ndr_typeinfo ndt__##NAME
137 130
138 131 /*
139 132 * CASE_INFO_ENT is intended to simplify the declaration of the case
140 133 * statement in the fixup function. Assuming you have followed the
141 134 * convention for naming the individual structures all you have to do
142 135 * is add a single line to the fixup function for each new case.
143 136 */
144 137 #define CASE_INFO_ENT(NAME,N) \
145 138 case N: size1 = sizeof (struct NAME##N); \
146 139 break
147 140
148 141 /*
149 142 * FIXUP_PDU_SIZE is used to patch the appropriate structures (identified
150 143 * by DECL_FIXUP_STRUCT) at runtime. The values are based on the
151 144 * switch_index.
152 145 */
153 146 #define FIXUP_PDU_SIZE(NAME,SIZE) { \
154 147 ndt__##NAME.pdu_size_fixed_part = SIZE; \
155 148 ndt__##NAME.c_size_fixed_part = SIZE; \
156 149 }
157 150
158 151
159 152 #endif /* NDRGEN */
↓ open down ↓ |
30 lines elided |
↑ open up ↑ |
160 153
161 154 /*
162 155 * UNION_INFO_ENT is intended to simplify adding new entries to a union.
163 156 * If the entry structures are named using the form FunctionNameX,
164 157 * where X is the sitch_value, you can just add a single line. Note
165 158 * that you must also update the fixup function in mlsvc_xxx.c.
166 159 */
167 160 #define UNION_INFO_ENT(N,NAME) CASE(N) struct NAME##N info##N
168 161 #define UNION_INFO_PTR(N,NAME) CASE(N) struct NAME##N *info##N
169 162
170 -#endif /* _NDR_TYPES_NDL_ */
163 +/*
164 + * Opaque context handle.
165 + */
166 +#ifndef CONTEXT_HANDLE
167 +#define CONTEXT_HANDLE(NAME) \
168 + struct NAME { \
169 + DWORD data1; \
170 + DWORD data2; \
171 + WORD data3[2]; \
172 + BYTE data4[8]; \
173 + }; \
174 + typedef struct NAME
175 +#endif /* CONTEXT_HANDLE */
176 +
177 +#endif /* _NDRTYPES_NDL_ */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX