1#ifndef MIDLTESTS_C_CODE
2
3/*
4 * For midltests_tcp.exe you may want to
5 * redirect the traffic via rinetd
6 * with a /etc/rinetd.conf like this:
7 *
8 * 172.31.9.1 5032 172.31.9.8 5032
9 * 172.31.9.1 5064 172.31.9.8 5064
10 *
11 * This is useful to watch the traffic with
12 * a network sniffer.
13 */
14/*
15cpp_quote("#define LISTEN_IP \"0.0.0.0\"")
16cpp_quote("#define FORWARD_IP \"127.0.0.1\"")
17cpp_quote("#define CONNECT_IP \"172.31.9.1\"")
18*/
19
20/*
21 * With midltests_tcp.exe NDR64 is enforced by default.
22 * For testing it might be needed to allow downgrades
23 * to NDR32. This is needed when you use 'pipe'.
24 */
25//cpp_quote("#define DONOT_FORCE_NDR64 1")
26
27[
28  uuid("225b9fcb-eb3d-497b-8b0b-591f049a2507"),
29  pointer_default(unique)
30]
31interface midltests
32{
33	[switch_type(char)] union u {
34		[case(0)];
35		[case(1)] char c;
36		[case(2)] short s;
37		[case(4)] long l;
38		[case(8)] hyper h;
39	};
40
41	long midltests_fn(
42		[in] char level,
43		[in,switch_is(level)] union u u
44	);
45}
46
47#elif MIDLTESTS_C_CODE
48
49static void midltests(void)
50{
51	union u u;
52	u.h = 0xFFFFFFFFFFFFFFFFLL;
53
54	cli_midltests_fn(0, u);
55	cli_midltests_fn(1, u);
56	cli_midltests_fn(2, u);
57	cli_midltests_fn(4, u);
58	cli_midltests_fn(8, u);
59}
60
61long srv_midltests_fn(char level, union u u)
62{
63	printf("srv_midltests_fn: Start\n");
64	printf("srv_midltests_fn: End\n");
65	return 0x65757254;
66}
67
68#endif
69