rpc_parse/parse_ntsvcs.c

説明を見る。
00001 /* 
00002  *  Unix SMB/CIFS implementation.
00003  *  RPC Pipe client / server routines
00004  *  Copyright (C) Gerald (Jerry) Carter             2005.
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 #include "includes.h"
00022 
00023 #undef DBGC_CLASS
00024 #define DBGC_CLASS DBGC_RPC_PARSE
00025 
00026 /*******************************************************************
00027 ********************************************************************/
00028 
00029 BOOL ntsvcs_io_q_get_version(const char *desc, NTSVCS_Q_GET_VERSION *q_u, prs_struct *ps, int depth)
00030 {
00031         if (q_u == NULL)
00032                 return False;
00033 
00034         prs_debug(ps, depth, desc, "ntsvcs_io_q_get_version");
00035         depth++;
00036 
00037         /* there is nothing to parse in this PDU */
00038 
00039         return True;
00040 
00041 }
00042 
00043 /*******************************************************************
00044 ********************************************************************/
00045 
00046 BOOL ntsvcs_io_r_get_version(const char *desc, NTSVCS_R_GET_VERSION *r_u, prs_struct *ps, int depth)
00047 {
00048         if ( !r_u )
00049                 return False;
00050 
00051         prs_debug(ps, depth, desc, "ntsvcs_io_r_get_version");
00052         depth++;
00053 
00054         if(!prs_align(ps))
00055                 return False;
00056                 
00057         if(!prs_uint32("version", ps, depth, &r_u->version))
00058                 return False;
00059                 
00060         if(!prs_werror("status", ps, depth, &r_u->status))
00061                 return False;
00062 
00063         return True;
00064 }
00065 
00066 /*******************************************************************
00067 ********************************************************************/
00068 
00069 BOOL ntsvcs_io_q_get_device_list_size(const char *desc, NTSVCS_Q_GET_DEVICE_LIST_SIZE *q_u, prs_struct *ps, int depth)
00070 {
00071         if (q_u == NULL)
00072                 return False;
00073 
00074         prs_debug(ps, depth, desc, "ntsvcs_io_q_get_device_list_size");
00075         depth++;
00076         
00077         if(!prs_align(ps))
00078                 return False;
00079 
00080         if ( !prs_pointer("devicename", ps, depth, (void*)&q_u->devicename, sizeof(UNISTR2), (PRS_POINTER_CAST)prs_io_unistr2) )
00081                 return False;
00082         if ( !prs_align(ps) )
00083                 return False;
00084                 
00085         if ( !prs_uint32("flags", ps, depth, &q_u->flags) )
00086                 return False;
00087         
00088         return True;
00089 
00090 }
00091 
00092 /*******************************************************************
00093 ********************************************************************/
00094 
00095 BOOL ntsvcs_io_r_get_device_list_size(const char *desc, NTSVCS_R_GET_DEVICE_LIST_SIZE *r_u, prs_struct *ps, int depth)
00096 {
00097         if ( !r_u )
00098                 return False;
00099 
00100         prs_debug(ps, depth, desc, "ntsvcs_io_r_get_device_list_size");
00101         depth++;
00102 
00103         if(!prs_align(ps))
00104                 return False;
00105                 
00106         if(!prs_uint32("size", ps, depth, &r_u->size))
00107                 return False;
00108                 
00109         if(!prs_werror("status", ps, depth, &r_u->status))
00110                 return False;
00111 
00112         return True;
00113 }
00114 
00115 
00116 /*******************************************************************
00117 ********************************************************************/
00118 
00119 BOOL ntsvcs_io_q_get_device_list(const char *desc, NTSVCS_Q_GET_DEVICE_LIST *q_u, prs_struct *ps, int depth)
00120 {
00121         if (q_u == NULL)
00122                 return False;
00123 
00124         prs_debug(ps, depth, desc, "ntsvcs_io_q_get_device_list");
00125         depth++;
00126         
00127         if(!prs_align(ps))
00128                 return False;
00129 
00130         if ( !prs_pointer("devicename", ps, depth, (void*)&q_u->devicename, sizeof(UNISTR2), (PRS_POINTER_CAST)prs_io_unistr2) )
00131                 return False;
00132         if( !prs_align(ps) )
00133                 return False;
00134                 
00135         if ( !prs_uint32("buffer_size", ps, depth, &q_u->buffer_size) )
00136                 return False;
00137         if ( !prs_uint32("flags", ps, depth, &q_u->flags) )
00138                 return False;
00139         
00140         return True;
00141 
00142 }
00143 
00144 /*******************************************************************
00145 ********************************************************************/
00146 
00147 BOOL ntsvcs_io_r_get_device_list(const char *desc, NTSVCS_R_GET_DEVICE_LIST *r_u, prs_struct *ps, int depth)
00148 {
00149         if ( !r_u )
00150                 return False;
00151 
00152         prs_debug(ps, depth, desc, "ntsvcs_io_r_get_device_list_size");
00153         depth++;
00154 
00155         if(!prs_align(ps))
00156                 return False;
00157                 
00158         if ( !prs_io_unistr2("devicepath", ps, depth, &r_u->devicepath) )
00159                 return False;
00160         if(!prs_align(ps))
00161                 return False;
00162                 
00163         if(!prs_uint32("needed", ps, depth, &r_u->needed))
00164                 return False;
00165                 
00166         if(!prs_werror("status", ps, depth, &r_u->status))
00167                 return False;
00168 
00169         return True;
00170 }
00171 
00172 /*******************************************************************
00173 ********************************************************************/
00174 
00175 BOOL ntsvcs_io_q_validate_device_instance(const char *desc, NTSVCS_Q_VALIDATE_DEVICE_INSTANCE *q_u, prs_struct *ps, int depth)
00176 {
00177         if (q_u == NULL)
00178                 return False;
00179 
00180         prs_debug(ps, depth, desc, "ntsvcs_io_q_validate_device_instance");
00181         depth++;
00182         
00183         if(!prs_align(ps))
00184                 return False;
00185 
00186         if ( !prs_io_unistr2("devicepath", ps, depth, &q_u->devicepath) )
00187                 return False;
00188         if( !prs_align(ps) )
00189                 return False;
00190                 
00191         if ( !prs_uint32("flags", ps, depth, &q_u->flags) )
00192                 return False;
00193         
00194         return True;
00195 
00196 }
00197 
00198 /*******************************************************************
00199 ********************************************************************/
00200 
00201 BOOL ntsvcs_io_r_validate_device_instance(const char *desc, NTSVCS_R_VALIDATE_DEVICE_INSTANCE *r_u, prs_struct *ps, int depth)
00202 {
00203         if ( !r_u )
00204                 return False;
00205 
00206         prs_debug(ps, depth, desc, "ntsvcs_io_r_validate_device_instance");
00207         depth++;
00208 
00209         if(!prs_werror("status", ps, depth, &r_u->status))
00210                 return False;
00211 
00212         return True;
00213 }
00214 
00215 /*******************************************************************
00216 ********************************************************************/
00217 
00218 BOOL ntsvcs_io_q_get_device_reg_property(const char *desc, NTSVCS_Q_GET_DEVICE_REG_PROPERTY *q_u, prs_struct *ps, int depth)
00219 {
00220         if (q_u == NULL)
00221                 return False;
00222 
00223         prs_debug(ps, depth, desc, "ntsvcs_io_q_get_device_reg_property");
00224         depth++;
00225         
00226         if(!prs_align(ps))
00227                 return False;
00228 
00229         if ( !prs_io_unistr2("devicepath", ps, depth, &q_u->devicepath) )
00230                 return False;
00231         if( !prs_align(ps) )
00232                 return False;
00233 
00234         if ( !prs_uint32("property", ps, depth, &q_u->property) )
00235                 return False;
00236         if ( !prs_uint32("unknown2", ps, depth, &q_u->unknown2) )
00237                 return False;
00238         if ( !prs_uint32("buffer_size1", ps, depth, &q_u->buffer_size1) )
00239                 return False;
00240         if ( !prs_uint32("buffer_size2", ps, depth, &q_u->buffer_size2) )
00241                 return False;
00242         if ( !prs_uint32("unknown5", ps, depth, &q_u->unknown5) )
00243                 return False;
00244         
00245         return True;
00246 
00247 }
00248 
00249 /*******************************************************************
00250 ********************************************************************/
00251 
00252 BOOL ntsvcs_io_r_get_device_reg_property(const char *desc, NTSVCS_R_GET_DEVICE_REG_PROPERTY *r_u, prs_struct *ps, int depth)
00253 {
00254         if ( !r_u )
00255                 return False;
00256 
00257         prs_debug(ps, depth, desc, "ntsvcs_io_r_get_device_reg_property");
00258         depth++;
00259 
00260         if ( !prs_align(ps) )
00261                 return False;
00262 
00263         if ( !prs_uint32("unknown1", ps, depth, &r_u->unknown1) )
00264                 return False;
00265 
00266         if ( !smb_io_regval_buffer("value", ps, depth, &r_u->value) )
00267                 return False;
00268         if ( !prs_align(ps) )
00269                 return False;
00270 
00271         if ( !prs_uint32("size", ps, depth, &r_u->size) )
00272                 return False;
00273 
00274         if ( !prs_uint32("needed", ps, depth, &r_u->needed) )
00275                 return False;
00276 
00277         if(!prs_werror("status", ps, depth, &r_u->status))
00278                 return False;
00279 
00280         return True;
00281 }
00282 
00283 /*******************************************************************
00284 ********************************************************************/
00285 
00286 BOOL ntsvcs_io_q_get_hw_profile_info(const char *desc, NTSVCS_Q_GET_HW_PROFILE_INFO *q_u, prs_struct *ps, int depth)
00287 {
00288         if (q_u == NULL)
00289                 return False;
00290 
00291         prs_debug(ps, depth, desc, "ntsvcs_io_q_get_hw_profile_info");
00292         depth++;
00293         
00294         if(!prs_align(ps))
00295                 return False;
00296 
00297         if ( !prs_uint32("index", ps, depth, &q_u->index) )
00298                 return False;
00299 
00300         q_u->buffer_size = 0x000000a8;
00301 
00302         if ( UNMARSHALLING(ps) ) {
00303                 q_u->buffer = TALLOC_ARRAY(get_talloc_ctx(), uint8, q_u->buffer_size );
00304                 if (!q_u->buffer) {
00305                         return False;
00306                 }
00307         }
00308 
00309         if ( !prs_uint8s(True, "buffer", ps, depth, q_u->buffer, q_u->buffer_size) )
00310                 return False;
00311 
00312         if ( !prs_uint32("buffer_size", ps, depth, &q_u->buffer_size) )
00313                 return False;
00314 
00315         if ( !prs_uint32("unknown1", ps, depth, &q_u->unknown1) )
00316                 return False;
00317         
00318         return True;
00319 
00320 }
00321 
00322 /*******************************************************************
00323 ********************************************************************/
00324 
00325 BOOL ntsvcs_io_r_get_hw_profile_info(const char *desc, NTSVCS_R_GET_HW_PROFILE_INFO *r_u, prs_struct *ps, int depth)
00326 {
00327         if ( !r_u )
00328                 return False;
00329 
00330         prs_debug(ps, depth, desc, "ntsvcs_io_r_get_device_reg_property");
00331         depth++;
00332 
00333         if ( !prs_align(ps) )
00334                 return False;
00335 
00336         if ( UNMARSHALLING(ps) ) {
00337                 if (r_u->buffer_size) {
00338                         r_u->buffer = TALLOC_ARRAY(get_talloc_ctx(), uint8, r_u->buffer_size );
00339                         if (!r_u->buffer) {
00340                                 return False;
00341                         }
00342                 } else {
00343                         r_u->buffer = NULL;
00344                 }
00345         }
00346 
00347         if ( !prs_uint8s(True, "buffer", ps, depth, r_u->buffer, r_u->buffer_size) )
00348                 return False;
00349 
00350         if(!prs_werror("status", ps, depth, &r_u->status))
00351                 return False;
00352 
00353         return True;
00354 }
00355 
00356 /*******************************************************************
00357 ********************************************************************/
00358 
00359 BOOL ntsvcs_io_q_hw_profile_flags(const char *desc, NTSVCS_Q_HW_PROFILE_FLAGS *q_u, prs_struct *ps, int depth)
00360 {
00361         if (q_u == NULL)
00362                 return False;
00363 
00364         prs_debug(ps, depth, desc, "ntsvcs_io_q_hw_profile_flags");
00365         depth++;
00366         
00367         if(!prs_align(ps))
00368                 return False;
00369 
00370         if ( !prs_uint32("unknown1", ps, depth, &q_u->unknown1) )
00371                 return False;
00372                 
00373 
00374         if ( !prs_io_unistr2("devicepath", ps, depth, &q_u->devicepath) )
00375                 return False;
00376         if( !prs_align(ps) )
00377                 return False;
00378 
00379         if ( !prs_uint32("unknown2", ps, depth, &q_u->unknown2) )
00380                 return False;
00381         if ( !prs_uint32("unknown3", ps, depth, &q_u->unknown3) )
00382                 return False;
00383         if ( !prs_uint32("unknown4", ps, depth, &q_u->unknown4) )
00384                 return False;
00385         if ( !prs_uint32("unknown5", ps, depth, &q_u->unknown5) )
00386                 return False;
00387         if ( !prs_uint32("unknown6", ps, depth, &q_u->unknown6) )
00388                 return False;
00389         if ( !prs_uint32("unknown7", ps, depth, &q_u->unknown7) )
00390                 return False;
00391 
00392         if ( !prs_uint32("unknown1", ps, depth, &q_u->unknown1) )
00393                 return False;
00394         
00395         return True;
00396 
00397 }
00398 
00399 /*******************************************************************
00400 ********************************************************************/
00401 
00402 BOOL ntsvcs_io_r_hw_profile_flags(const char *desc, NTSVCS_R_HW_PROFILE_FLAGS *r_u, prs_struct *ps, int depth)
00403 {
00404         if ( !r_u )
00405                 return False;
00406 
00407         prs_debug(ps, depth, desc, "ntsvcs_io_r_hw_profile_flags");
00408         depth++;
00409 
00410         if ( !prs_align(ps) )
00411                 return False;
00412 
00413         if ( !prs_uint32("unknown1", ps, depth, &r_u->unknown1) )
00414                 return False;
00415         if ( !prs_uint32("unknown2", ps, depth, &r_u->unknown2) )
00416                 return False;
00417         if ( !prs_uint32("unknown3", ps, depth, &r_u->unknown3) )
00418                 return False;
00419         if(!prs_werror("status", ps, depth, &r_u->status))
00420                 return False;
00421 
00422         return True;
00423 }
00424 
00425 
00426 
00427 

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