diff options
author | Günther Deschner <gd@samba.org> | 2011-02-07 23:27:57 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2011-02-08 08:58:31 +0100 |
commit | 84dbc2a82de0531c49fa7aa16fbdf8aba6324aac (patch) | |
tree | 55cfb736c44d2bd7cadbc91f7c1d5b726015fe8e | |
parent | 8b55ae178586d25854a929ace05f203d547242ad (diff) | |
download | samba-84dbc2a82de0531c49fa7aa16fbdf8aba6324aac.tar.gz samba-84dbc2a82de0531c49fa7aa16fbdf8aba6324aac.tar.bz2 samba-84dbc2a82de0531c49fa7aa16fbdf8aba6324aac.zip |
ndr: merge ndr_map_error2string and ndr_errstr.
Guenther
-rw-r--r-- | librpc/ndr/libndr.h | 1 | ||||
-rw-r--r-- | source3/include/proto.h | 1 | ||||
-rw-r--r-- | source3/librpc/ndr/util.c | 72 |
3 files changed, 1 insertions, 73 deletions
diff --git a/librpc/ndr/libndr.h b/librpc/ndr/libndr.h index 302a5ec773..314df35907 100644 --- a/librpc/ndr/libndr.h +++ b/librpc/ndr/libndr.h @@ -363,6 +363,7 @@ struct ndr_interface_list { *********************************************************************/ NTSTATUS ndr_map_error2ntstatus(enum ndr_err_code ndr_err); const char *ndr_map_error2string(enum ndr_err_code ndr_err); +#define ndr_errstr ndr_map_error2string /* FIXME: Use represent_as instead */ struct dom_sid; diff --git a/source3/include/proto.h b/source3/include/proto.h index 1e90479fcc..01c450c075 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1585,7 +1585,6 @@ enum ndr_err_code ndr_push_server_id(struct ndr_push *ndr, int ndr_flags, const enum ndr_err_code ndr_pull_server_id(struct ndr_pull *ndr, int ndr_flags, struct server_id *r); void ndr_print_server_id(struct ndr_print *ndr, const char *name, const struct server_id *r); _PUBLIC_ void ndr_print_sockaddr_storage(struct ndr_print *ndr, const char *name, const struct sockaddr_storage *ss); -const char *ndr_errstr(enum ndr_err_code err); /* The following definitions come from libsmb/cliconnect.c */ diff --git a/source3/librpc/ndr/util.c b/source3/librpc/ndr/util.c index 13fe6e175a..b55b3d8c8c 100644 --- a/source3/librpc/ndr/util.c +++ b/source3/librpc/ndr/util.c @@ -21,78 +21,6 @@ #include "includes.h" -/* - * 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_IPV6ADDRESS: - return "NDR_ERR_IPV6ADDRESS"; - break; - case NDR_ERR_INVALID_POINTER: - return "NDR_ERR_INVALID_POINTER"; - break; - case NDR_ERR_UNREAD_BYTES: - return "NDR_ERR_UNREAD_BYTES"; - break; - case NDR_ERR_NDR64: - return "NDR_ERR_NDR64"; - break; - } - - return talloc_asprintf(talloc_tos(), "Unknown NDR error: %d", err); -} - enum ndr_err_code ndr_push_server_id(struct ndr_push *ndr, int ndr_flags, const struct server_id *r) { if (ndr_flags & NDR_SCALARS) { |