diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-10-13 14:38:42 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-10-13 14:38:42 +0200 |
commit | de0aa7850c57aadef72659651e8de33d644706fa (patch) | |
tree | 740a7f7799697f8d4c9e6d785ebd0fa9b435e175 /source3/librpc/ndr/ndr.c | |
parent | bf768aa1ecfdc01abe2bef79cc5608b4cab93b7e (diff) | |
download | samba-de0aa7850c57aadef72659651e8de33d644706fa.tar.gz samba-de0aa7850c57aadef72659651e8de33d644706fa.tar.bz2 samba-de0aa7850c57aadef72659651e8de33d644706fa.zip |
Move code specific to Samba 3 to a separate file.
Diffstat (limited to 'source3/librpc/ndr/ndr.c')
-rw-r--r-- | source3/librpc/ndr/ndr.c | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/source3/librpc/ndr/ndr.c b/source3/librpc/ndr/ndr.c index f7beed5e1e..55c383de4a 100644 --- a/source3/librpc/ndr/ndr.c +++ b/source3/librpc/ndr/ndr.c @@ -354,97 +354,6 @@ _PUBLIC_ void ndr_set_flags(uint32_t *pflags, uint32_t new_flags) (*pflags) |= new_flags; } -NTSTATUS ndr_map_error2ntstatus(enum ndr_err_code ndr_err) -{ - switch (ndr_err) { - case NDR_ERR_SUCCESS: - return NT_STATUS_OK; - case NDR_ERR_BUFSIZE: - return NT_STATUS_BUFFER_TOO_SMALL; - case NDR_ERR_TOKEN: - return NT_STATUS_INTERNAL_ERROR; - case NDR_ERR_ALLOC: - return NT_STATUS_NO_MEMORY; - case NDR_ERR_ARRAY_SIZE: - return NT_STATUS_ARRAY_BOUNDS_EXCEEDED; - case NDR_ERR_INVALID_POINTER: - return NT_STATUS_INVALID_PARAMETER_MIX; - case NDR_ERR_UNREAD_BYTES: - return NT_STATUS_PORT_MESSAGE_TOO_LONG; - default: - break; - } - - /* we should map all error codes to different status codes */ - return NT_STATUS_INVALID_PARAMETER; -} - -/* - * Convert an ndr error to string - */ - -const char *ndr_errstr(enum ndr_err_code err) -{ - switch (err) { - case NDR_ERR_SUCCESS: - return "NDR_ERR_SUCCESS"; - break; - case NDR_ERR_ARRAY_SIZE: - return "NDR_ERR_ARRAY_SIZE"; - break; - case NDR_ERR_BAD_SWITCH: - return "NDR_ERR_BAD_SWITCH"; - break; - case NDR_ERR_OFFSET: - return "NDR_ERR_OFFSET"; - break; - case NDR_ERR_RELATIVE: - return "NDR_ERR_RELATIVE"; - break; - case NDR_ERR_CHARCNV: - return "NDR_ERR_CHARCNV"; - break; - case NDR_ERR_LENGTH: - return "NDR_ERR_LENGTH"; - break; - case NDR_ERR_SUBCONTEXT: - return "NDR_ERR_SUBCONTEXT"; - break; - case NDR_ERR_COMPRESSION: - return "NDR_ERR_COMPRESSION"; - break; - case NDR_ERR_STRING: - return "NDR_ERR_STRING"; - break; - case NDR_ERR_VALIDATE: - return "NDR_ERR_VALIDATE"; - break; - case NDR_ERR_BUFSIZE: - return "NDR_ERR_BUFSIZE"; - break; - case NDR_ERR_ALLOC: - return "NDR_ERR_ALLOC"; - break; - case NDR_ERR_RANGE: - return "NDR_ERR_RANGE"; - break; - case NDR_ERR_TOKEN: - return "NDR_ERR_TOKEN"; - break; - case NDR_ERR_IPV4ADDRESS: - return "NDR_ERR_IPV4ADDRESS"; - break; - case NDR_ERR_INVALID_POINTER: - return "NDR_ERR_INVALID_POINTER"; - break; - case NDR_ERR_UNREAD_BYTES: - return "NDR_ERR_UNREAD_BYTES"; - break; - } - - return talloc_asprintf(talloc_tos(), "Unknown NDR error: %d", err); -} - /* return and possibly log an NDR error */ |