2 * Unix SMB/CIFS implementation.
3 * RPC Pipe client / server routines for rpcecho
4 * Copyright (C) Tim Potter 2003.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 /* This is the interface to the rpcecho pipe. */
29 #define DBGC_CLASS DBGC_RPC_SRV
31 /* Add one to the input and return it */
33 void _echo_AddOne(pipes_struct
*p
, uint32_t in_data
, uint32_t *out_data
)
35 DEBUG(10, ("_echo_add_one\n"));
37 *out_data
= in_data
+ 1;
40 /* Echo back an array of data */
42 void _echo_EchoData(pipes_struct
*p
, uint32_t len
, uint8_t *in_data
, uint8_t *out_data
)
44 DEBUG(10, ("_echo_data\n"));
46 memcpy(out_data
, in_data
, len
);
49 /* Sink an array of data */
51 void _echo_SinkData(pipes_struct
*p
, uint32_t len
, uint8_t *data
)
53 DEBUG(10, ("_sink_data\n"));
55 /* My that was some yummy data! */
58 /* Source an array of data */
60 void _echo_SourceData(pipes_struct
*p
, uint32_t len
, uint8_t *data
)
64 DEBUG(10, ("_source_data\n"));
66 for (i
= 0; i
< len
; i
++)
70 void _echo_TestCall(pipes_struct
*p
, const char *s1
, const char **s2
)
72 *s2
= talloc_strdup(p
->mem_ctx
, s1
);
75 NTSTATUS
_echo_TestCall2(pipes_struct
*p
, uint16_t level
, union echo_Info
*info
)
96 info
->info6
.info1
.v
= 80;
100 info
->info7
.info4
.v
= 90;
103 return NT_STATUS_INVALID_LEVEL
;
109 uint32
_echo_TestSleep(pipes_struct
*p
, uint32_t seconds
)
115 void _echo_TestEnum(pipes_struct
*p
, enum echo_Enum1
*foo1
, struct echo_Enum2
*foo2
, union echo_Enum3
*foo3
)
119 void _echo_TestSurrounding(pipes_struct
*p
, struct echo_Surrounding
*data
)
122 data
->surrounding
= talloc_zero_array(p
->mem_ctx
, uint16_t, data
->x
);
125 uint16
_echo_TestDoublePointer(pipes_struct
*p
, uint16_t ***data
)
134 #endif /* DEVELOPER */