rpc_server/srv_echo_nt.c

説明を見る。
00001 /* 
00002  *  Unix SMB/CIFS implementation.
00003  *  RPC Pipe client / server routines for rpcecho
00004  *  Copyright (C) Tim Potter                   2003.
00005  *  
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *  
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *  
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019  */
00020 
00021 /* This is the interface to the rpcecho pipe. */
00022 
00023 #include "includes.h"
00024 #include "nterr.h"
00025 
00026 #ifdef DEVELOPER
00027 
00028 #undef DBGC_CLASS
00029 #define DBGC_CLASS DBGC_RPC_SRV
00030 
00031 /* Add one to the input and return it */
00032 
00033 void _echo_add_one(pipes_struct *p, ECHO_Q_ADD_ONE *q_u, ECHO_R_ADD_ONE *r_u)
00034 {
00035         DEBUG(10, ("_echo_add_one\n"));
00036 
00037         r_u->response = q_u->request + 1;
00038 }
00039 
00040 /* Echo back an array of data */
00041 
00042 void _echo_data(pipes_struct *p, ECHO_Q_ECHO_DATA *q_u, 
00043                 ECHO_R_ECHO_DATA *r_u)
00044 {
00045         DEBUG(10, ("_echo_data\n"));
00046 
00047         if (q_u->size == 0) {
00048                 r_u->data = NULL;
00049                 r_u->size = 0;
00050                 return;
00051         }
00052         r_u->data = TALLOC(p->mem_ctx, q_u->size);
00053         r_u->size = q_u->size;
00054         memcpy(r_u->data, q_u->data, q_u->size);
00055 }
00056 
00057 /* Sink an array of data */
00058 
00059 void _sink_data(pipes_struct *p, ECHO_Q_SINK_DATA *q_u, 
00060                 ECHO_R_SINK_DATA *r_u)
00061 {
00062         DEBUG(10, ("_sink_data\n"));
00063 
00064         /* My that was some yummy data! */
00065 }
00066 
00067 /* Source an array of data */
00068 
00069 void _source_data(pipes_struct *p, ECHO_Q_SOURCE_DATA *q_u, 
00070                   ECHO_R_SOURCE_DATA *r_u)
00071 {
00072         uint32 i;
00073 
00074         DEBUG(10, ("_source_data\n"));
00075 
00076         if (q_u->size == 0) {
00077                 r_u->data = NULL;
00078                 r_u->size = 0;
00079                 return;
00080         }
00081         r_u->data = TALLOC(p->mem_ctx, q_u->size);
00082         r_u->size = q_u->size;
00083 
00084         for (i = 0; i < r_u->size; i++)
00085                 r_u->data[i] = i & 0xff;
00086 }
00087 
00088 #endif /* DEVELOPER */

Sambaに対してSat Aug 29 21:23:19 2009に生成されました。  doxygen 1.4.7