rpc_parse/parse_echo.c

説明を見る。
00001 /* 
00002  *  Unix SMB/CIFS implementation.
00003  *
00004  *  RPC Pipe client / server routines
00005  *
00006  *  Copyright (C) Tim Potter 2003
00007  *  
00008  *  This program is free software; you can redistribute it and/or modify
00009  *  it under the terms of the GNU General Public License as published by
00010  *  the Free Software Foundation; either version 2 of the License, or
00011  *  (at your option) any later version.
00012  *  
00013  *  This program is distributed in the hope that it will be useful,
00014  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  *  GNU General Public License for more details.
00017  *  
00018  *  You should have received a copy of the GNU General Public License
00019  *  along with this program; if not, write to the Free Software
00020  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00021  */
00022 
00023 #include "includes.h"
00024 
00025 #undef DBGC_CLASS
00026 #define DBGC_CLASS DBGC_RPC_PARSE
00027 
00028 void init_echo_q_add_one(ECHO_Q_ADD_ONE *q_d, uint32 request)
00029 {
00030         q_d->request = request;
00031 }
00032 
00033 BOOL echo_io_q_add_one(const char *desc, ECHO_Q_ADD_ONE *q_d,
00034                        prs_struct *ps, int depth)
00035 {
00036         if (!prs_uint32("request", ps, 0, &q_d->request))
00037                 return False;
00038 
00039         return True;
00040 }
00041 
00042 BOOL echo_io_r_add_one(const char *desc, ECHO_R_ADD_ONE *q_d,
00043                        prs_struct *ps, int depth)
00044 {
00045         if (!prs_uint32("response", ps, 0, &q_d->response))
00046                 return False;
00047 
00048         return True;
00049 }
00050 
00051 
00052 void init_echo_q_echo_data(ECHO_Q_ECHO_DATA *q_d, uint32 size, char *data)
00053 {
00054         q_d->size = size;
00055         q_d->data = data;
00056 }
00057 
00058 BOOL echo_io_q_echo_data(const char *desc, ECHO_Q_ECHO_DATA *q_d,
00059                           prs_struct *ps, int depth)
00060 {
00061         if (!prs_uint32("size", ps, depth, &q_d->size))
00062                 return False;
00063 
00064         if (!prs_uint32("size", ps, depth, &q_d->size))
00065                 return False;
00066 
00067         if (UNMARSHALLING(ps)) {
00068                 q_d->data = PRS_ALLOC_MEM(ps, char, q_d->size);
00069 
00070                 if (!q_d->data)
00071                         return False;
00072         }
00073 
00074         if (!prs_uint8s(False, "data", ps, depth, (unsigned char *)q_d->data, q_d->size))
00075                 return False;
00076 
00077         return True;
00078 }
00079 
00080 BOOL echo_io_r_echo_data(const char *desc, ECHO_R_ECHO_DATA *q_d,
00081                           prs_struct *ps, int depth)
00082 {
00083         if (!prs_uint32("size", ps, 0, &q_d->size))
00084                 return False;
00085 
00086         if (UNMARSHALLING(ps)) {
00087                 q_d->data = PRS_ALLOC_MEM(ps, char, q_d->size);
00088 
00089                 if (!q_d->data)
00090                         return False;
00091         }
00092 
00093         if (!prs_uint8s(False, "data", ps, depth, (unsigned char *)q_d->data, q_d->size))
00094                 return False;
00095 
00096         return True;
00097 }
00098 
00099 void init_echo_q_sink_data(ECHO_Q_SINK_DATA *q_d, uint32 size, char *data)
00100 {
00101         q_d->size = size;
00102         q_d->data = data;
00103 }
00104 
00105 BOOL echo_io_q_sink_data(const char *desc, ECHO_Q_SINK_DATA *q_d,
00106                          prs_struct *ps, int depth)
00107 {
00108         if (!prs_uint32("size", ps, depth, &q_d->size))
00109                 return False;
00110 
00111         if (!prs_uint32("size", ps, depth, &q_d->size))
00112                 return False;
00113 
00114         if (UNMARSHALLING(ps)) {
00115                 q_d->data = PRS_ALLOC_MEM(ps, char, q_d->size);
00116 
00117                 if (!q_d->data)
00118                         return False;
00119         }
00120 
00121         if (!prs_uint8s(False, "data", ps, depth, (unsigned char *)q_d->data, q_d->size))
00122                 return False;
00123 
00124         return True;
00125 }
00126 
00127 BOOL echo_io_r_sink_data(const char *desc, ECHO_R_SINK_DATA *q_d,
00128                          prs_struct *ps, int depth)
00129 {
00130         return True;
00131 }
00132 
00133 void init_echo_q_source_data(ECHO_Q_SOURCE_DATA *q_d, uint32 size)
00134 {
00135         q_d->size = size;
00136 }
00137 
00138 BOOL echo_io_q_source_data(const char *desc, ECHO_Q_SOURCE_DATA *q_d,
00139                          prs_struct *ps, int depth)
00140 {
00141         if (!prs_uint32("size", ps, depth, &q_d->size))
00142                 return False;
00143 
00144         return True;
00145 }
00146 
00147 BOOL echo_io_r_source_data(const char *desc, ECHO_R_SOURCE_DATA *q_d,
00148                            prs_struct *ps, int depth)
00149 {
00150         if (!prs_uint32("size", ps, 0, &q_d->size))
00151                 return False;
00152 
00153         if (UNMARSHALLING(ps)) {
00154                 q_d->data = PRS_ALLOC_MEM(ps, char, q_d->size);
00155 
00156                 if (!q_d->data)
00157                         return False;
00158         }
00159 
00160         if (!prs_uint8s(False, "data", ps, depth, (unsigned char *)q_d->data, q_d->size))
00161                 return False;
00162 
00163         return True;
00164 }

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