c0a694389821b38f85f299003c49a423418047a5
[samba.git] / source4 / librpc / idl / echo.idl
1 #include "idl_types.h"
2
3
4 [
5   uuid("60a15ec5-4de8-11d7-a637-005056a20182"),
6   endpoint("ncacn_np:[\\pipe\\rpcecho]", "ncacn_ip_tcp:", "ncalrpc:"),
7   pointer_default(unique),
8   version(1.0),
9   helpstring("Simple echo pipe")
10 ]
11 interface rpcecho
12 {
13         /* Add one to an integer */
14         void echo_AddOne(
15                 [in,out,ref] uint32 *v
16         );
17         /* Echo an array of bytes back at the caller */
18         void echo_EchoData(
19                 [in] uint32 len,
20                 [in] [size_is(len)] uint8 in_data[],
21                 [out] [size_is(len)] uint8 out_data[]
22         );
23         /* Sink data to the server */
24         void echo_SinkData(
25                 [in] uint32 len,
26                 [in,ref,size_is(len)] uint8 *data
27         );
28         /* Source data from server */
29         void echo_SourceData(
30                 [in] uint32 len,
31                 [out,ref,size_is(len)] uint8 *data
32         );
33
34
35         /* test strings */
36         void echo_TestCall (
37                 [in]       unistr *s1,
38                 [out]      unistr *s2
39                 );
40
41
42         /* test some alignment issues */
43         typedef struct {
44                 uint8 v;
45         } echo_info1;
46
47         typedef struct {
48                 uint16 v;
49         } echo_info2;
50
51         typedef struct {
52                 uint32 v;
53         } echo_info3;
54
55         typedef struct {
56                 hyper v;
57         } echo_info4;
58
59         typedef struct {
60                 uint8 v1;
61                 hyper v2;
62         } echo_info5;
63
64         typedef struct {
65                 uint8 v1;
66                 echo_info1 info1;
67         } echo_info6;
68
69         typedef union {
70                 [case(1)]  echo_info1 info1;
71         } echo_XXX;
72
73         typedef struct {
74                 uint8 v1;
75                 echo_info4 info4;
76         } echo_info7;
77
78         typedef union {
79                 [case(1)]  echo_info1 info1;
80                 [case(2)]  echo_info2 info2;
81                 [case(3)]  echo_info3 info3;
82                 [case(4)]  echo_info4 info4;
83                 [case(5)]  echo_info5 info5;
84                 [case(6)]  echo_info6 info6;
85                 [case(7)]  echo_info7 info7;
86         } echo_Info;
87
88         NTSTATUS echo_TestCall2 (
89                      [in]                    uint16 level,
90                      [out,switch_is(level)]  echo_Info *info
91                 );
92
93         uint32 echo_TestSleep(
94                 [in] uint32 seconds
95                 );
96
97         typedef enum {
98                 ECHO_ENUM1 = 1,
99                 ECHO_ENUM2 = 2
100         } echo_Enum1;
101
102         typedef [v1_enum] enum {
103                 ECHO_ENUM1_32 = 1,
104                 ECHO_ENUM2_32 = 2
105         } echo_Enum1_32;
106
107         typedef struct {
108                 echo_Enum1 e1;
109                 echo_Enum1_32 e2;
110         } echo_Enum2;
111
112         typedef union {
113                 [case(ECHO_ENUM1)] echo_Enum1 e1;
114                 [case(ECHO_ENUM2)] echo_Enum2 e2;
115         } echo_Enum3;
116
117         void echo_TestEnum(
118                 [in,out,ref] echo_Enum1 *foo1,
119                 [in,out,ref] echo_Enum2 *foo2,
120                 [in,out,ref,switch_is(*foo1)] echo_Enum3 *foo3
121                 );
122
123         typedef struct {
124                 uint32 x;
125                 [size_is(x)] uint16 surrounding[*];
126         } echo_Surrounding;
127
128         void echo_TestSurrounding(
129                 [in,out,ref] echo_Surrounding *data
130         );
131 }