From 7e8fb4ad06a3e2e5ae17b06299c7c4cd4e87012e Mon Sep 17 00:00:00 2001 From: Kamen Mazdrashki Date: Mon, 5 Oct 2009 13:28:12 +0300 Subject: s4/drs(NDR): Print implementation for drsuapi_DsReplicaOID Custom ndr_print functions is implemented so that transmited partia-binary-oid to be printed both in hex and partial-oid formats --- librpc/ndr/ndr_drsuapi.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/librpc/ndr/ndr_drsuapi.c b/librpc/ndr/ndr_drsuapi.c index a551a01cca..bfc3c75b4e 100644 --- a/librpc/ndr/ndr_drsuapi.c +++ b/librpc/ndr/ndr_drsuapi.c @@ -82,6 +82,25 @@ void ndr_print_drsuapi_DsReplicaObjectListItemEx(struct ndr_print *ndr, const ch } \ } while (0) +_PUBLIC_ void ndr_print_drsuapi_DsReplicaOID(struct ndr_print *ndr, const char *name, const struct drsuapi_DsReplicaOID *r) +{ + ndr_print_struct(ndr, name, "drsuapi_DsReplicaOID"); + ndr->depth++; + ndr_print_uint32(ndr, "length", r->length); + ndr->print(ndr, "%-25s: length=%u", "oid", r->length); + if (r->binary_oid) { + char *partial_oid = NULL; + DATA_BLOB oid_blob = data_blob_const(r->binary_oid, r->length); + char *hex_str = data_blob_hex_string(ndr, &oid_blob); + ber_read_partial_OID_String(ndr, oid_blob, (const char **)&partial_oid); + ndr->depth++; + ndr->print(ndr, "%-25s: 0x%s (%s)", "binary_oid", hex_str, partial_oid); + ndr->depth--; + talloc_free(hex_str); + talloc_free(partial_oid); + } + ndr->depth--; +} enum ndr_err_code ndr_push_drsuapi_DsGetNCChangesMSZIPCtr1(struct ndr_push *ndr, int ndr_flags, const struct drsuapi_DsGetNCChangesMSZIPCtr1 *r) { -- cgit