libsmb/dcerpc_err.c

説明を見る。
00001 /* 
00002  *  Unix SMB/CIFS implementation.
00003  *  Copyright (C) Stefan Metzmacher 2004
00004  *  
00005  *  This program is free software; you can redistribute it and/or modify
00006  *  it under the terms of the GNU General Public License as published by
00007  *  the Free Software Foundation; either version 2 of the License, or
00008  *  (at your option) any later version.
00009  *  
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU General Public License for more details.
00014  *  
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with this program; if not, write to the Free Software
00017  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018  */
00019 
00020 #include "includes.h"
00021 
00022 struct dcerpc_fault_table {
00023         const char *errstr;
00024         uint32_t faultcode;
00025 };
00026 
00027 static const struct dcerpc_fault_table dcerpc_faults[] =
00028 {
00029         { "DCERPC_FAULT_OP_RNG_ERROR",          DCERPC_FAULT_OP_RNG_ERROR },
00030         { "DCERPC_FAULT_UNK_IF",                DCERPC_FAULT_UNK_IF },
00031         { "DCERPC_FAULT_NDR",                   DCERPC_FAULT_NDR },
00032         { "DCERPC_FAULT_INVALID_TAG",           DCERPC_FAULT_INVALID_TAG },
00033         { "DCERPC_FAULT_CONTEXT_MISMATCH",      DCERPC_FAULT_CONTEXT_MISMATCH },
00034         { "DCERPC_FAULT_OTHER",                 DCERPC_FAULT_OTHER },
00035         { "DCERPC_FAULT_ACCESS_DENIED",         DCERPC_FAULT_ACCESS_DENIED },
00036 
00037         { NULL,                                 0}      
00038 };
00039 
00040 const char *dcerpc_errstr(uint32 fault_code)
00041 {
00042         static pstring msg;
00043         int idx = 0;
00044 
00045         slprintf(msg, sizeof(msg), "DCERPC fault 0x%08x", fault_code);
00046 
00047         while (dcerpc_faults[idx].errstr != NULL) {
00048                 if (dcerpc_faults[idx].faultcode == fault_code) {
00049                         return dcerpc_faults[idx].errstr;
00050                 }
00051                 idx++;
00052         }
00053 
00054         return msg;
00055 }

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