| 1 |
/* |
| 2 |
Unix SMB/CIFS implementation. |
| 3 |
Error handling code |
| 4 |
|
| 5 |
This program is free software; you can redistribute it and/or modify |
| 6 |
it under the terms of the GNU General Public License as published by |
| 7 |
the Free Software Foundation; either version 3 of the License, or |
| 8 |
(at your option) any later version. |
| 9 |
|
| 10 |
This program is distributed in the hope that it will be useful, |
| 11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
GNU General Public License for more details. |
| 14 |
|
| 15 |
You should have received a copy of the GNU General Public License |
| 16 |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 |
*/ |
| 18 |
|
| 19 |
#ifndef _SAMBA_ERROR_H_ |
| 20 |
#define _SAMBA_ERROR_H_ |
| 21 |
|
| 22 |
#include "libcli/util/werror.h" |
| 23 |
#include "libcli/util/doserr.h" |
| 24 |
#include "libcli/util/ntstatus.h" |
| 25 |
#include "libcli/util/hresult.h" |
| 26 |
|
| 27 |
/***************************************************************************** |
| 28 |
convert a NT status code to a dos class/code |
| 29 |
*****************************************************************************/ |
| 30 |
void ntstatus_to_dos(NTSTATUS ntstatus, uint8_t *eclass, uint32_t *ecode); |
| 31 |
|
| 32 |
/***************************************************************************** |
| 33 |
convert a WERROR to a NT status32 code |
| 34 |
*****************************************************************************/ |
| 35 |
NTSTATUS werror_to_ntstatus(WERROR error); |
| 36 |
|
| 37 |
/***************************************************************************** |
| 38 |
convert a NTSTATUS to a WERROR |
| 39 |
*****************************************************************************/ |
| 40 |
WERROR ntstatus_to_werror(NTSTATUS error); |
| 41 |
|
| 42 |
/********************************************************************* |
| 43 |
Map an NT error code from a Unix error code. |
| 44 |
*********************************************************************/ |
| 45 |
NTSTATUS map_nt_error_from_unix_common(int unix_error); |
| 46 |
|
| 47 |
/********************************************************************* |
| 48 |
Map a Unix error code from a NT error code. |
| 49 |
*********************************************************************/ |
| 50 |
int map_errno_from_nt_status(NTSTATUS status); |
| 51 |
|
| 52 |
NTSTATUS nt_status_squash(NTSTATUS nt_status); |
| 53 |
|
| 54 |
/***************************************************************************** |
| 55 |
convert a Unix error to a WERROR |
| 56 |
*****************************************************************************/ |
| 57 |
WERROR unix_to_werror(int unix_error); |
| 58 |
|
| 59 |
#endif /* _SAMBA_ERROR_H */ |