diff options
Diffstat (limited to 'librpc/gen_ndr')
-rw-r--r-- | librpc/gen_ndr/dcerpc.h | 105 | ||||
-rw-r--r-- | librpc/gen_ndr/ndr_dcerpc.c | 76 | ||||
-rw-r--r-- | librpc/gen_ndr/ndr_dcerpc.h | 1 |
3 files changed, 178 insertions, 4 deletions
diff --git a/librpc/gen_ndr/dcerpc.h b/librpc/gen_ndr/dcerpc.h index f05541c407..1c94468107 100644 --- a/librpc/gen_ndr/dcerpc.h +++ b/librpc/gen_ndr/dcerpc.h @@ -112,11 +112,114 @@ struct dcerpc_response { DATA_BLOB stub_and_verifier;/* [flag(LIBNDR_FLAG_REMAINING)] */ }; +enum dcerpc_nca_status +#ifndef USE_UINT_ENUMS + { + DERPC_NCA_S_COMM_FAILURE=(int)(0x1C010001), + DERPC_NCA_S_OP_RNG_ERROR=(int)(0x1C010002), + DERPC_NCA_S_UNKNOWN_IF=(int)(0x1C010003), + DERPC_NCA_S_WRONG_BOOT_TIME=(int)(0x1C010006), + DERPC_NCA_S_YOU_CRASHED=(int)(0x1C010009), + DERPC_NCA_S_PROTO_ERROR=(int)(0x1C01000B), + DERPC_NCA_S_OUT_ARGS_TOO_BIG=(int)(0x1C010013), + DERPC_NCA_S_SERVER_TOO_BUSY=(int)(0x1C010014), + DERPC_NCA_S_FAULT_STRING_TOO_LARGE=(int)(0x1C010015), + DERPC_NCA_S_UNSUPPORTED_TYPE=(int)(0x1C010017), + DERPC_NCA_S_FAULT_INT_DIV_BY_ZERO=(int)(0x1C000001), + DERPC_NCA_S_FAULT_ADDR_ERROR=(int)(0x1C000002), + DERPC_NCA_S_FAULT_FP_DIV_BY_ZERO=(int)(0x1C000003), + DERPC_NCA_S_FAULT_FP_UNDERFLOW=(int)(0x1C000004), + DERPC_NCA_S_FAULT_FP_OVERRFLOW=(int)(0x1C000005), + DERPC_NCA_S_FAULT_INVALID_TAG=(int)(0x1C000006), + DERPC_NCA_S_FAULT_INVALID_BOUND=(int)(0x1C000007), + DERPC_NCA_S_FAULT_RPC_VERSION_MISMATCH=(int)(0x1C000008), + DERPC_NCA_S_FAULT_UNSPEC_REJECT=(int)(0x1C000009), + DERPC_NCA_S_FAULT_BAD_ACTID=(int)(0x1C00000A), + DERPC_NCA_S_FAULT_WHO_ARE_YOU_FAILED=(int)(0x1C00000B), + DERPC_NCA_S_FAULT_MANAGER_NOT_ENTERED=(int)(0x1C00000C), + DERPC_NCA_S_FAULT_CANCEL=(int)(0x1C00000D), + DERPC_NCA_S_FAULT_ILL_INST=(int)(0x1C00000E), + DERPC_NCA_S_FAULT_FP_ERROR=(int)(0x1C00000F), + DERPC_NCA_S_FAULT_INT_OVERFLOW=(int)(0x1C000010), + DERPC_NCA_S_UNUSED_1C000011=(int)(0x1C000011), + DERPC_NCA_S_FAULT_UNSPEC=(int)(0x1C000012), + DERPC_NCA_S_FAULT_REMOTE_COMM_FAILURE=(int)(0x1C000013), + DERPC_NCA_S_FAULT_PIPE_EMPTY=(int)(0x1C000014), + DERPC_NCA_S_FAULT_PIPE_CLOSED=(int)(0x1C000015), + DERPC_NCA_S_FAULT_PIPE_ORDER=(int)(0x1C000016), + DERPC_NCA_S_FAULT_PIPE_DISCIPLINE=(int)(0x1C000017), + DERPC_NCA_S_FAULT_PIPE_COMM_ERROR=(int)(0x1C000018), + DERPC_NCA_S_FAULT_PIPE_MEMORY=(int)(0x1C000019), + DERPC_NCA_S_FAULT_CONTEXT_MISMATCH=(int)(0x1C00001A), + DERPC_NCA_S_FAULT_REMOTE_NO_MEMORY=(int)(0x1C00001B), + DERPC_NCA_S_INVALID_PRES_CONTEXT_ID=(int)(0x1C00001C), + DERPC_NCA_S_UNSUPPORTED_AUTHN_LEVEL=(int)(0x1C00001D), + DERPC_NCA_S_UNUSED_1C00001E=(int)(0x1C00001E), + DERPC_NCA_S_INVALID_CHECKSUM=(int)(0x1C00001F), + DERPC_NCA_S_INVALID_CRC=(int)(0x1C000020), + DERPC_NCA_S_FAULT_USER_DEFINED=(int)(0x1C000021), + DERPC_NCA_S_FAULT_TX_OPEN_FAILED=(int)(0x1C000022), + DERPC_NCA_S_FAULT_CODESET_CONV_ERROR=(int)(0x1C000023), + DERPC_NCA_S_FAULT_OBJECT_NOT_FOUND=(int)(0x1C000024), + DERPC_NCA_S_FAULT_NO_CLIENT_STUB=(int)(0x1C000025) +} +#else + { __donnot_use_enum_dcerpc_nca_status=0x7FFFFFFF} +#define DERPC_NCA_S_COMM_FAILURE ( 0x1C010001 ) +#define DERPC_NCA_S_OP_RNG_ERROR ( 0x1C010002 ) +#define DERPC_NCA_S_UNKNOWN_IF ( 0x1C010003 ) +#define DERPC_NCA_S_WRONG_BOOT_TIME ( 0x1C010006 ) +#define DERPC_NCA_S_YOU_CRASHED ( 0x1C010009 ) +#define DERPC_NCA_S_PROTO_ERROR ( 0x1C01000B ) +#define DERPC_NCA_S_OUT_ARGS_TOO_BIG ( 0x1C010013 ) +#define DERPC_NCA_S_SERVER_TOO_BUSY ( 0x1C010014 ) +#define DERPC_NCA_S_FAULT_STRING_TOO_LARGE ( 0x1C010015 ) +#define DERPC_NCA_S_UNSUPPORTED_TYPE ( 0x1C010017 ) +#define DERPC_NCA_S_FAULT_INT_DIV_BY_ZERO ( 0x1C000001 ) +#define DERPC_NCA_S_FAULT_ADDR_ERROR ( 0x1C000002 ) +#define DERPC_NCA_S_FAULT_FP_DIV_BY_ZERO ( 0x1C000003 ) +#define DERPC_NCA_S_FAULT_FP_UNDERFLOW ( 0x1C000004 ) +#define DERPC_NCA_S_FAULT_FP_OVERRFLOW ( 0x1C000005 ) +#define DERPC_NCA_S_FAULT_INVALID_TAG ( 0x1C000006 ) +#define DERPC_NCA_S_FAULT_INVALID_BOUND ( 0x1C000007 ) +#define DERPC_NCA_S_FAULT_RPC_VERSION_MISMATCH ( 0x1C000008 ) +#define DERPC_NCA_S_FAULT_UNSPEC_REJECT ( 0x1C000009 ) +#define DERPC_NCA_S_FAULT_BAD_ACTID ( 0x1C00000A ) +#define DERPC_NCA_S_FAULT_WHO_ARE_YOU_FAILED ( 0x1C00000B ) +#define DERPC_NCA_S_FAULT_MANAGER_NOT_ENTERED ( 0x1C00000C ) +#define DERPC_NCA_S_FAULT_CANCEL ( 0x1C00000D ) +#define DERPC_NCA_S_FAULT_ILL_INST ( 0x1C00000E ) +#define DERPC_NCA_S_FAULT_FP_ERROR ( 0x1C00000F ) +#define DERPC_NCA_S_FAULT_INT_OVERFLOW ( 0x1C000010 ) +#define DERPC_NCA_S_UNUSED_1C000011 ( 0x1C000011 ) +#define DERPC_NCA_S_FAULT_UNSPEC ( 0x1C000012 ) +#define DERPC_NCA_S_FAULT_REMOTE_COMM_FAILURE ( 0x1C000013 ) +#define DERPC_NCA_S_FAULT_PIPE_EMPTY ( 0x1C000014 ) +#define DERPC_NCA_S_FAULT_PIPE_CLOSED ( 0x1C000015 ) +#define DERPC_NCA_S_FAULT_PIPE_ORDER ( 0x1C000016 ) +#define DERPC_NCA_S_FAULT_PIPE_DISCIPLINE ( 0x1C000017 ) +#define DERPC_NCA_S_FAULT_PIPE_COMM_ERROR ( 0x1C000018 ) +#define DERPC_NCA_S_FAULT_PIPE_MEMORY ( 0x1C000019 ) +#define DERPC_NCA_S_FAULT_CONTEXT_MISMATCH ( 0x1C00001A ) +#define DERPC_NCA_S_FAULT_REMOTE_NO_MEMORY ( 0x1C00001B ) +#define DERPC_NCA_S_INVALID_PRES_CONTEXT_ID ( 0x1C00001C ) +#define DERPC_NCA_S_UNSUPPORTED_AUTHN_LEVEL ( 0x1C00001D ) +#define DERPC_NCA_S_UNUSED_1C00001E ( 0x1C00001E ) +#define DERPC_NCA_S_INVALID_CHECKSUM ( 0x1C00001F ) +#define DERPC_NCA_S_INVALID_CRC ( 0x1C000020 ) +#define DERPC_NCA_S_FAULT_USER_DEFINED ( 0x1C000021 ) +#define DERPC_NCA_S_FAULT_TX_OPEN_FAILED ( 0x1C000022 ) +#define DERPC_NCA_S_FAULT_CODESET_CONV_ERROR ( 0x1C000023 ) +#define DERPC_NCA_S_FAULT_OBJECT_NOT_FOUND ( 0x1C000024 ) +#define DERPC_NCA_S_FAULT_NO_CLIENT_STUB ( 0x1C000025 ) +#endif +; + struct dcerpc_fault { uint32_t alloc_hint; uint16_t context_id; uint8_t cancel_count; - uint32_t status; + enum dcerpc_nca_status status; DATA_BLOB _pad;/* [flag(LIBNDR_FLAG_REMAINING)] */ }; diff --git a/librpc/gen_ndr/ndr_dcerpc.c b/librpc/gen_ndr/ndr_dcerpc.c index dca445a872..2a32e9a78d 100644 --- a/librpc/gen_ndr/ndr_dcerpc.c +++ b/librpc/gen_ndr/ndr_dcerpc.c @@ -689,6 +689,76 @@ _PUBLIC_ void ndr_print_dcerpc_response(struct ndr_print *ndr, const char *name, ndr->depth--; } +static enum ndr_err_code ndr_push_dcerpc_nca_status(struct ndr_push *ndr, int ndr_flags, enum dcerpc_nca_status r) +{ + NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_dcerpc_nca_status(struct ndr_pull *ndr, int ndr_flags, enum dcerpc_nca_status *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_dcerpc_nca_status(struct ndr_print *ndr, const char *name, enum dcerpc_nca_status r) +{ + const char *val = NULL; + + switch (r) { + case DERPC_NCA_S_COMM_FAILURE: val = "DERPC_NCA_S_COMM_FAILURE"; break; + case DERPC_NCA_S_OP_RNG_ERROR: val = "DERPC_NCA_S_OP_RNG_ERROR"; break; + case DERPC_NCA_S_UNKNOWN_IF: val = "DERPC_NCA_S_UNKNOWN_IF"; break; + case DERPC_NCA_S_WRONG_BOOT_TIME: val = "DERPC_NCA_S_WRONG_BOOT_TIME"; break; + case DERPC_NCA_S_YOU_CRASHED: val = "DERPC_NCA_S_YOU_CRASHED"; break; + case DERPC_NCA_S_PROTO_ERROR: val = "DERPC_NCA_S_PROTO_ERROR"; break; + case DERPC_NCA_S_OUT_ARGS_TOO_BIG: val = "DERPC_NCA_S_OUT_ARGS_TOO_BIG"; break; + case DERPC_NCA_S_SERVER_TOO_BUSY: val = "DERPC_NCA_S_SERVER_TOO_BUSY"; break; + case DERPC_NCA_S_FAULT_STRING_TOO_LARGE: val = "DERPC_NCA_S_FAULT_STRING_TOO_LARGE"; break; + case DERPC_NCA_S_UNSUPPORTED_TYPE: val = "DERPC_NCA_S_UNSUPPORTED_TYPE"; break; + case DERPC_NCA_S_FAULT_INT_DIV_BY_ZERO: val = "DERPC_NCA_S_FAULT_INT_DIV_BY_ZERO"; break; + case DERPC_NCA_S_FAULT_ADDR_ERROR: val = "DERPC_NCA_S_FAULT_ADDR_ERROR"; break; + case DERPC_NCA_S_FAULT_FP_DIV_BY_ZERO: val = "DERPC_NCA_S_FAULT_FP_DIV_BY_ZERO"; break; + case DERPC_NCA_S_FAULT_FP_UNDERFLOW: val = "DERPC_NCA_S_FAULT_FP_UNDERFLOW"; break; + case DERPC_NCA_S_FAULT_FP_OVERRFLOW: val = "DERPC_NCA_S_FAULT_FP_OVERRFLOW"; break; + case DERPC_NCA_S_FAULT_INVALID_TAG: val = "DERPC_NCA_S_FAULT_INVALID_TAG"; break; + case DERPC_NCA_S_FAULT_INVALID_BOUND: val = "DERPC_NCA_S_FAULT_INVALID_BOUND"; break; + case DERPC_NCA_S_FAULT_RPC_VERSION_MISMATCH: val = "DERPC_NCA_S_FAULT_RPC_VERSION_MISMATCH"; break; + case DERPC_NCA_S_FAULT_UNSPEC_REJECT: val = "DERPC_NCA_S_FAULT_UNSPEC_REJECT"; break; + case DERPC_NCA_S_FAULT_BAD_ACTID: val = "DERPC_NCA_S_FAULT_BAD_ACTID"; break; + case DERPC_NCA_S_FAULT_WHO_ARE_YOU_FAILED: val = "DERPC_NCA_S_FAULT_WHO_ARE_YOU_FAILED"; break; + case DERPC_NCA_S_FAULT_MANAGER_NOT_ENTERED: val = "DERPC_NCA_S_FAULT_MANAGER_NOT_ENTERED"; break; + case DERPC_NCA_S_FAULT_CANCEL: val = "DERPC_NCA_S_FAULT_CANCEL"; break; + case DERPC_NCA_S_FAULT_ILL_INST: val = "DERPC_NCA_S_FAULT_ILL_INST"; break; + case DERPC_NCA_S_FAULT_FP_ERROR: val = "DERPC_NCA_S_FAULT_FP_ERROR"; break; + case DERPC_NCA_S_FAULT_INT_OVERFLOW: val = "DERPC_NCA_S_FAULT_INT_OVERFLOW"; break; + case DERPC_NCA_S_UNUSED_1C000011: val = "DERPC_NCA_S_UNUSED_1C000011"; break; + case DERPC_NCA_S_FAULT_UNSPEC: val = "DERPC_NCA_S_FAULT_UNSPEC"; break; + case DERPC_NCA_S_FAULT_REMOTE_COMM_FAILURE: val = "DERPC_NCA_S_FAULT_REMOTE_COMM_FAILURE"; break; + case DERPC_NCA_S_FAULT_PIPE_EMPTY: val = "DERPC_NCA_S_FAULT_PIPE_EMPTY"; break; + case DERPC_NCA_S_FAULT_PIPE_CLOSED: val = "DERPC_NCA_S_FAULT_PIPE_CLOSED"; break; + case DERPC_NCA_S_FAULT_PIPE_ORDER: val = "DERPC_NCA_S_FAULT_PIPE_ORDER"; break; + case DERPC_NCA_S_FAULT_PIPE_DISCIPLINE: val = "DERPC_NCA_S_FAULT_PIPE_DISCIPLINE"; break; + case DERPC_NCA_S_FAULT_PIPE_COMM_ERROR: val = "DERPC_NCA_S_FAULT_PIPE_COMM_ERROR"; break; + case DERPC_NCA_S_FAULT_PIPE_MEMORY: val = "DERPC_NCA_S_FAULT_PIPE_MEMORY"; break; + case DERPC_NCA_S_FAULT_CONTEXT_MISMATCH: val = "DERPC_NCA_S_FAULT_CONTEXT_MISMATCH"; break; + case DERPC_NCA_S_FAULT_REMOTE_NO_MEMORY: val = "DERPC_NCA_S_FAULT_REMOTE_NO_MEMORY"; break; + case DERPC_NCA_S_INVALID_PRES_CONTEXT_ID: val = "DERPC_NCA_S_INVALID_PRES_CONTEXT_ID"; break; + case DERPC_NCA_S_UNSUPPORTED_AUTHN_LEVEL: val = "DERPC_NCA_S_UNSUPPORTED_AUTHN_LEVEL"; break; + case DERPC_NCA_S_UNUSED_1C00001E: val = "DERPC_NCA_S_UNUSED_1C00001E"; break; + case DERPC_NCA_S_INVALID_CHECKSUM: val = "DERPC_NCA_S_INVALID_CHECKSUM"; break; + case DERPC_NCA_S_INVALID_CRC: val = "DERPC_NCA_S_INVALID_CRC"; break; + case DERPC_NCA_S_FAULT_USER_DEFINED: val = "DERPC_NCA_S_FAULT_USER_DEFINED"; break; + case DERPC_NCA_S_FAULT_TX_OPEN_FAILED: val = "DERPC_NCA_S_FAULT_TX_OPEN_FAILED"; break; + case DERPC_NCA_S_FAULT_CODESET_CONV_ERROR: val = "DERPC_NCA_S_FAULT_CODESET_CONV_ERROR"; break; + case DERPC_NCA_S_FAULT_OBJECT_NOT_FOUND: val = "DERPC_NCA_S_FAULT_OBJECT_NOT_FOUND"; break; + case DERPC_NCA_S_FAULT_NO_CLIENT_STUB: val = "DERPC_NCA_S_FAULT_NO_CLIENT_STUB"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + static enum ndr_err_code ndr_push_dcerpc_fault(struct ndr_push *ndr, int ndr_flags, const struct dcerpc_fault *r) { if (ndr_flags & NDR_SCALARS) { @@ -696,7 +766,7 @@ static enum ndr_err_code ndr_push_dcerpc_fault(struct ndr_push *ndr, int ndr_fla NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->alloc_hint)); NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->context_id)); NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->cancel_count)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->status)); + NDR_CHECK(ndr_push_dcerpc_nca_status(ndr, NDR_SCALARS, r->status)); { uint32_t _flags_save_DATA_BLOB = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); @@ -717,7 +787,7 @@ static enum ndr_err_code ndr_pull_dcerpc_fault(struct ndr_pull *ndr, int ndr_fla NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->alloc_hint)); NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->context_id)); NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->cancel_count)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->status)); + NDR_CHECK(ndr_pull_dcerpc_nca_status(ndr, NDR_SCALARS, &r->status)); { uint32_t _flags_save_DATA_BLOB = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); @@ -738,7 +808,7 @@ _PUBLIC_ void ndr_print_dcerpc_fault(struct ndr_print *ndr, const char *name, co ndr_print_uint32(ndr, "alloc_hint", r->alloc_hint); ndr_print_uint16(ndr, "context_id", r->context_id); ndr_print_uint8(ndr, "cancel_count", r->cancel_count); - ndr_print_uint32(ndr, "status", r->status); + ndr_print_dcerpc_nca_status(ndr, "status", r->status); ndr_print_DATA_BLOB(ndr, "_pad", r->_pad); ndr->depth--; } diff --git a/librpc/gen_ndr/ndr_dcerpc.h b/librpc/gen_ndr/ndr_dcerpc.h index 9baa089d8a..d787b873cc 100644 --- a/librpc/gen_ndr/ndr_dcerpc.h +++ b/librpc/gen_ndr/ndr_dcerpc.h @@ -18,6 +18,7 @@ void ndr_print_dcerpc_bind_nak_versions(struct ndr_print *ndr, const char *name, void ndr_print_dcerpc_bind_nak_versions_ctr(struct ndr_print *ndr, const char *name, const union dcerpc_bind_nak_versions_ctr *r); void ndr_print_dcerpc_bind_nak(struct ndr_print *ndr, const char *name, const struct dcerpc_bind_nak *r); void ndr_print_dcerpc_response(struct ndr_print *ndr, const char *name, const struct dcerpc_response *r); +void ndr_print_dcerpc_nca_status(struct ndr_print *ndr, const char *name, enum dcerpc_nca_status r); void ndr_print_dcerpc_fault(struct ndr_print *ndr, const char *name, const struct dcerpc_fault *r); void ndr_print_dcerpc_AuthType(struct ndr_print *ndr, const char *name, enum dcerpc_AuthType r); void ndr_print_dcerpc_AuthLevel(struct ndr_print *ndr, const char *name, enum dcerpc_AuthLevel r); |