librpc/idl/echo.idl echo_StructPipe ...
[metze/samba/wip.git] / librpc / idl / echo.idl
1
2 [
3   uuid("60a15ec5-4de8-11d7-a637-005056a20182"),
4   endpoint("ncacn_np:[\\pipe\\rpcecho]", "ncacn_ip_tcp:", "ncalrpc:"),
5   pointer_default(unique),
6   version(1.0),
7   helpstring("Simple echo pipe")
8 ]
9 interface rpcecho
10 {
11         /* Add one to an integer */
12         void echo_AddOne(
13                 [in] uint32 in_data,
14                 [out] uint32 *out_data
15         );
16         /* Echo an array of bytes back at the caller */
17         void echo_EchoData(
18                 [in] uint32 len,
19                 [in] [size_is(len)] uint8 in_data[],
20                 [out] [size_is(len)] uint8 out_data[]
21         );
22         /* Sink data to the server */
23         void echo_SinkData(
24                 [in] uint32 len,
25                 [in,size_is(len)] uint8 data[]
26         );
27         /* Source data from server */
28         void echo_SourceData(
29                 [in] uint32 len,
30                 [out,size_is(len)] uint8 data[]
31         );
32
33         /* test strings */
34         void echo_TestCall (
35                 [in,string,charset(UTF16)]       uint16 *s1,
36                 [out,string,charset(UTF16)]      uint16 **s2
37                 );
38
39
40         /* test some alignment issues */
41         typedef [public] struct {
42                 uint8 v;
43         } echo_info1;
44
45         typedef struct {
46                 uint16 v;
47         } echo_info2;
48
49         typedef struct {
50                 uint32 v;
51         } echo_info3;
52
53         struct echo_info4 {
54                 hyper v;
55         };
56
57         typedef struct {
58                 uint8 v1;
59                 hyper v2;
60         } echo_info5;
61
62         typedef struct {
63                 uint8 v1;
64                 echo_info1 info1;
65         } echo_info6;
66
67         typedef struct {
68                 uint8 v1;
69                 struct echo_info4 info4;
70         } echo_info7;
71
72         typedef [switch_type(uint16)] union {
73                 [case(1)]  echo_info1 info1;
74                 [case(2)]  echo_info2 info2;
75                 [case(3)]  echo_info3 info3;
76                 [case(4)]  struct echo_info4 info4;
77                 [case(5)]  echo_info5 info5;
78                 [case(6)]  echo_info6 info6;
79                 [case(7)]  echo_info7 info7;
80         } echo_Info;
81
82         NTSTATUS echo_TestCall2 (
83                      [in]                    uint16 level,
84                      [out,switch_is(level)]  echo_Info *info
85                 );
86
87         uint32 echo_TestSleep(
88                 [in] uint32 seconds
89                 );
90
91         typedef enum {
92                 ECHO_ENUM1 = 1,
93                 ECHO_ENUM2 = 2
94         } echo_Enum1;
95
96         typedef [v1_enum] enum {
97                 ECHO_ENUM1_32 = 1,
98                 ECHO_ENUM2_32 = 2
99         } echo_Enum1_32;
100
101         typedef struct {
102                 echo_Enum1 e1;
103                 echo_Enum1_32 e2;
104         } echo_Enum2;
105
106         typedef [switch_type(uint16)] union {
107                 [case(ECHO_ENUM1)] echo_Enum1 e1;
108                 [case(ECHO_ENUM2)] echo_Enum2 e2;
109         } echo_Enum3;
110
111         void echo_TestEnum(
112                 [in,out,ref] echo_Enum1 *foo1,
113                 [in,out,ref] echo_Enum2 *foo2,
114                 [in,out,ref,switch_is(*foo1)] echo_Enum3 *foo3
115                 );
116
117         typedef struct {
118                 uint32 x;
119                 [size_is(x)] uint16 surrounding[*];
120         } echo_Surrounding;
121
122         void echo_TestSurrounding(
123                 [in,out,ref] echo_Surrounding *data
124         );
125
126         uint16 echo_TestDoublePointer([in] uint16 ***data);
127
128         typedef pipe uint8 echo_BytePipe;
129 /*      typedef struct {
130                 uint32 *ptr;
131                 uint8 *a;
132         } echo_Struct;
133         typedef pipe echo_Struct echo_StructPipe;
134 */
135         uint32 echo_BytePipeIn(
136                 [in] uint32 value,
137         //      [in,ref] echo_StructPipe *sp,
138                 [in,ref] echo_BytePipe *bp
139         );
140 }
141 #if 0
142         struct frstrans_BytePipe_chunk {
143                 uint32_t count;
144                 uint8_t *array;
145         };
146
147         struct frstrans_RdcGetFileDataAsync r;
148         struct frstrans_BytePipe_chunk chunk;
149         struct frstrans_BytePipe *p;
150
151         p = dcerpc_frstrans_BytePipe_create()..;
152
153         r.out.byte_pipe = p;
154
155         subreq = dceprc_frstrans_RdcGetFileDataAsync_send(..., r);
156
157         while (true) {
158                 subreq2 = dcerpc_frstrans_BytePipe_read_chunk_send(..., r.out.byte_pipe)
159
160                 dcerpc_frstrans_BytePipe_read_chunk_recv(subreq2, mem_ctx, &chunk);
161
162                 if (chunk.count == 0) {
163                         break;
164                 }
165         }
166         subreq = dceprc_frstrans_RdcGetFileDataAsync_recv(subreq);
167
168 // frstrans_metzeSomeStructExample
169
170         typedef struct {
171                 uint16 fixed[16];
172                 hyper bla;
173                 uint8 dummy;
174                 uint32 foo_bug[45];
175         } frstrans_Struct;
176         typedef pipe frstrans_Struct *frstrans_StructPipe;
177
178         WERROR frstrans_metzeSomeStructExample(
179                 [in,ref] policy_handle *server_context,
180                 [out,ref] frstrans_StructPipe *struct_pipe
181                 );
182
183         struct frstrans_StructPipe_chunk {
184                 uint32_t count;
185                 struct frstrans_Struct *array;
186         };
187
188         struct frstrans_metzeSomeStructExample r;
189         struct frstrans_StructPipe_chunk chunk;
190         struct frstrans_StructPipe *p;
191
192         p = dcerpc_frstrans_StructPipe_create()..;
193
194         r.out.byte_pipe = p;
195
196         subreq = dceprc_frstrans_metzeSomeStructExample_send(..., r);
197
198         while (true) {
199                 subreq2 = dcerpc_frstrans_StructPipe_read_chunk_send(..., r.out.byte_pipe)
200
201                 dcerpc_frstrans_StructPipe_read_chunk_recv(subreq2, mem_ctx, &chunk);
202
203                 if (chunk.count == 0) {
204                         break;
205                 }
206         }
207         subreq = dceprc_frstrans_metzeSomeStructExample_recv(subreq);
208 #endif