2 Unix SMB/CIFS implementation.
6 Copyright (C) Stefan Metzmacher 2004
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 struct dcerpc_fault_table {
30 static const struct dcerpc_fault_table dcerpc_faults[] =
32 { "DCERPC_FAULT_OP_RNG_ERROR", DCERPC_FAULT_OP_RNG_ERROR },
33 { "DCERPC_FAULT_UNK_IF", DCERPC_FAULT_UNK_IF },
34 { "DCERPC_FAULT_NDR", DCERPC_FAULT_NDR },
35 { "DCERPC_FAULT_INVALID_TAG", DCERPC_FAULT_INVALID_TAG },
36 { "DCERPC_FAULT_CONTEXT_MISMATCH", DCERPC_FAULT_CONTEXT_MISMATCH },
37 { "DCERPC_FAULT_OTHER", DCERPC_FAULT_OTHER },
38 { "DCERPC_FAULT_ACCESS_DENIED", DCERPC_FAULT_ACCESS_DENIED },
43 const char *dcerpc_errstr(TALLOC_CTX *mem_ctx, uint32_t fault_code)
47 while (dcerpc_faults[idx].errstr != NULL) {
48 if (dcerpc_faults[idx].faultcode == fault_code) {
49 return dcerpc_faults[idx].errstr;
54 return talloc_asprintf(mem_ctx, "DCERPC fault 0x%08x", fault_code);