rerun 'make idl'
authorStefan Metzmacher <metze@sernet.de>
Wed, 19 Sep 2007 18:49:30 +0000 (20:49 +0200)
committerStefan Metzmacher <metze@sernet.de>
Thu, 11 Oct 2007 15:21:47 +0000 (17:21 +0200)
metze

source/librpc/gen_ndr/ndr_winbind_protocol.c
source/librpc/gen_ndr/ndr_winbind_protocol.h
source/librpc/gen_ndr/winbind_protocol.h

index db08d0b..060d0d0 100644 (file)
@@ -123,6 +123,378 @@ _PUBLIC_ void ndr_print_STRUCT_winbind_header(struct ndr_print *ndr, const char
        ndr->depth--;
 }
 
+static NTSTATUS ndr_push_STRUCT_winbind_domain_info_compat(struct ndr_push *ndr, int ndr_flags, const struct winbind_domain_info_compat *r)
+{
+       if (ndr_flags & NDR_SCALARS) {
+               NDR_CHECK(ndr_push_align(ndr, 4));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->netbios_name, CH_UTF8)));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->netbios_name, CH_UTF8)));
+               NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->netbios_name, ndr_charset_length(r->netbios_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->dns_name));
+               if (r->sid == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               NDR_CHECK(ndr_push_ref_ptr(ndr));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_native_mode));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_active_directory));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->is_primary));
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+               if (r->dns_name) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dns_name, CH_UTF8)));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->dns_name, CH_UTF8)));
+                       NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->dns_name, ndr_charset_length(r->dns_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
+               }
+               NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
+       }
+       return NT_STATUS_OK;
+}
+
+static NTSTATUS ndr_pull_STRUCT_winbind_domain_info_compat(struct ndr_pull *ndr, int ndr_flags, struct winbind_domain_info_compat *r)
+{
+       uint32_t _ptr_dns_name;
+       TALLOC_CTX *_mem_save_dns_name_0;
+       uint32_t _ptr_sid;
+       TALLOC_CTX *_mem_save_sid_0;
+       if (ndr_flags & NDR_SCALARS) {
+               NDR_CHECK(ndr_pull_align(ndr, 4));
+               NDR_CHECK(ndr_pull_array_size(ndr, &r->netbios_name));
+               NDR_CHECK(ndr_pull_array_length(ndr, &r->netbios_name));
+               if (ndr_get_array_length(ndr, &r->netbios_name) > ndr_get_array_size(ndr, &r->netbios_name)) {
+                       return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->netbios_name), ndr_get_array_length(ndr, &r->netbios_name));
+               }
+               NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->netbios_name), sizeof(uint8_t)));
+               NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->netbios_name, ndr_get_array_length(ndr, &r->netbios_name), sizeof(uint8_t), CH_UTF8));
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dns_name));
+               if (_ptr_dns_name) {
+                       NDR_PULL_ALLOC(ndr, r->dns_name);
+               } else {
+                       r->dns_name = NULL;
+               }
+               NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_sid));
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->sid);
+               }
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_native_mode));
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_active_directory));
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->is_primary));
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+               if (r->dns_name) {
+                       _mem_save_dns_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->dns_name, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, &r->dns_name));
+                       NDR_CHECK(ndr_pull_array_length(ndr, &r->dns_name));
+                       if (ndr_get_array_length(ndr, &r->dns_name) > ndr_get_array_size(ndr, &r->dns_name)) {
+                               return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->dns_name), ndr_get_array_length(ndr, &r->dns_name));
+                       }
+                       NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->dns_name), sizeof(uint8_t)));
+                       NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->dns_name, ndr_get_array_length(ndr, &r->dns_name), sizeof(uint8_t), CH_UTF8));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dns_name_0, 0);
+               }
+               _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->sid, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, LIBNDR_FLAG_REF_ALLOC);
+       }
+       return NT_STATUS_OK;
+}
+
+_PUBLIC_ void ndr_print_STRUCT_winbind_domain_info_compat(struct ndr_print *ndr, const char *name, const struct winbind_domain_info_compat *r)
+{
+       ndr_print_struct(ndr, name, "winbind_domain_info_compat");
+       ndr->depth++;
+       ndr_print_string(ndr, "netbios_name", r->netbios_name);
+       ndr_print_ptr(ndr, "dns_name", r->dns_name);
+       ndr->depth++;
+       if (r->dns_name) {
+               ndr_print_string(ndr, "dns_name", r->dns_name);
+       }
+       ndr->depth--;
+       ndr_print_ptr(ndr, "sid", r->sid);
+       ndr->depth++;
+       ndr_print_dom_sid(ndr, "sid", r->sid);
+       ndr->depth--;
+       ndr_print_uint32(ndr, "is_native_mode", r->is_native_mode);
+       ndr_print_uint32(ndr, "is_active_directory", r->is_active_directory);
+       ndr_print_uint32(ndr, "is_primary", r->is_primary);
+       ndr->depth--;
+}
+
+static NTSTATUS ndr_push_winbind_domain_info_level(struct ndr_push *ndr, int ndr_flags, enum winbind_domain_info_level r)
+{
+       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
+       return NT_STATUS_OK;
+}
+
+static NTSTATUS ndr_pull_winbind_domain_info_level(struct ndr_pull *ndr, int ndr_flags, enum winbind_domain_info_level *r)
+{
+       uint32_t v;
+       NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
+       *r = v;
+       return NT_STATUS_OK;
+}
+
+_PUBLIC_ void ndr_print_winbind_domain_info_level(struct ndr_print *ndr, const char *name, enum winbind_domain_info_level r)
+{
+       const char *val = NULL;
+
+       switch (r) {
+               case WINBIND_DOMAIN_INFO_LEVEL_COMPAT: val = "WINBIND_DOMAIN_INFO_LEVEL_COMPAT"; break;
+       }
+       ndr_print_enum(ndr, name, "ENUM", val, r);
+}
+
+static NTSTATUS ndr_push_winbind_domain_info(struct ndr_push *ndr, int ndr_flags, const union winbind_domain_info *r)
+{
+       if (ndr_flags & NDR_SCALARS) {
+               int level = ndr_push_get_switch_value(ndr, r);
+               NDR_CHECK(ndr_push_winbind_domain_info_level(ndr, NDR_SCALARS, level));
+               switch (level) {
+                       case WINBIND_DOMAIN_INFO_LEVEL_COMPAT:
+                               NDR_CHECK(ndr_push_STRUCT_winbind_domain_info_compat(ndr, NDR_SCALARS, &r->compat));
+                       break;
+
+                       default:
+                               return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
+               }
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+               int level = ndr_push_get_switch_value(ndr, r);
+               switch (level) {
+                       case WINBIND_DOMAIN_INFO_LEVEL_COMPAT:
+                               NDR_CHECK(ndr_push_STRUCT_winbind_domain_info_compat(ndr, NDR_BUFFERS, &r->compat));
+                       break;
+
+                       default:
+                               return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
+               }
+       }
+       return NT_STATUS_OK;
+}
+
+static NTSTATUS ndr_pull_winbind_domain_info(struct ndr_pull *ndr, int ndr_flags, union winbind_domain_info *r)
+{
+       int level;
+       uint32_t _level;
+       level = ndr_pull_get_switch_value(ndr, r);
+       if (ndr_flags & NDR_SCALARS) {
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
+               if (_level != level) {
+                       return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
+               }
+               switch (level) {
+                       case WINBIND_DOMAIN_INFO_LEVEL_COMPAT: {
+                               NDR_CHECK(ndr_pull_STRUCT_winbind_domain_info_compat(ndr, NDR_SCALARS, &r->compat));
+                       break; }
+
+                       default:
+                               return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
+               }
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+               switch (level) {
+                       case WINBIND_DOMAIN_INFO_LEVEL_COMPAT:
+                               NDR_CHECK(ndr_pull_STRUCT_winbind_domain_info_compat(ndr, NDR_BUFFERS, &r->compat));
+                       break;
+
+                       default:
+                               return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
+               }
+       }
+       return NT_STATUS_OK;
+}
+
+_PUBLIC_ void ndr_print_winbind_domain_info(struct ndr_print *ndr, const char *name, const union winbind_domain_info *r)
+{
+       int level;
+       level = ndr_print_get_switch_value(ndr, r);
+       ndr_print_union(ndr, name, level, "winbind_domain_info");
+       switch (level) {
+               case WINBIND_DOMAIN_INFO_LEVEL_COMPAT:
+                       ndr_print_STRUCT_winbind_domain_info_compat(ndr, "compat", &r->compat);
+               break;
+
+               default:
+                       ndr_print_bad_level(ndr, name, level);
+       }
+}
+
+static NTSTATUS ndr_push_winbind_dc_info_level(struct ndr_push *ndr, int ndr_flags, enum winbind_dc_info_level r)
+{
+       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
+       return NT_STATUS_OK;
+}
+
+static NTSTATUS ndr_pull_winbind_dc_info_level(struct ndr_pull *ndr, int ndr_flags, enum winbind_dc_info_level *r)
+{
+       uint32_t v;
+       NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
+       *r = v;
+       return NT_STATUS_OK;
+}
+
+_PUBLIC_ void ndr_print_winbind_dc_info_level(struct ndr_print *ndr, const char *name, enum winbind_dc_info_level r)
+{
+       const char *val = NULL;
+
+       switch (r) {
+               case WINBIND_DC_INFO_LEVEL_COMPAT_NT4: val = "WINBIND_DC_INFO_LEVEL_COMPAT_NT4"; break;
+               case WINBIND_DC_INFO_LEVEL_COMPAT_DS: val = "WINBIND_DC_INFO_LEVEL_COMPAT_DS"; break;
+       }
+       ndr_print_enum(ndr, name, "ENUM", val, r);
+}
+
+static NTSTATUS ndr_push_winbind_dc_info(struct ndr_push *ndr, int ndr_flags, const union winbind_dc_info *r)
+{
+       if (ndr_flags & NDR_SCALARS) {
+               int level = ndr_push_get_switch_value(ndr, r);
+               NDR_CHECK(ndr_push_winbind_dc_info_level(ndr, NDR_SCALARS, level));
+               switch (level) {
+                       case WINBIND_DC_INFO_LEVEL_COMPAT_NT4:
+                               NDR_CHECK(ndr_push_unique_ptr(ndr, r->name));
+                       break;
+
+                       case WINBIND_DC_INFO_LEVEL_COMPAT_DS:
+                               NDR_CHECK(ndr_push_unique_ptr(ndr, r->name));
+                       break;
+
+                       default:
+                               return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
+               }
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+               int level = ndr_push_get_switch_value(ndr, r);
+               switch (level) {
+                       case WINBIND_DC_INFO_LEVEL_COMPAT_NT4:
+                               if (r->name) {
+                                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF8)));
+                                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+                                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF8)));
+                                       NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
+                               }
+                       break;
+
+                       case WINBIND_DC_INFO_LEVEL_COMPAT_DS:
+                               if (r->name) {
+                                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF8)));
+                                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+                                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->name, CH_UTF8)));
+                                       NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->name, ndr_charset_length(r->name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
+                               }
+                       break;
+
+                       default:
+                               return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
+               }
+       }
+       return NT_STATUS_OK;
+}
+
+static NTSTATUS ndr_pull_winbind_dc_info(struct ndr_pull *ndr, int ndr_flags, union winbind_dc_info *r)
+{
+       int level;
+       uint32_t _level;
+       TALLOC_CTX *_mem_save_name_0;
+       level = ndr_pull_get_switch_value(ndr, r);
+       if (ndr_flags & NDR_SCALARS) {
+               NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level));
+               if (_level != level) {
+                       return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
+               }
+               switch (level) {
+                       case WINBIND_DC_INFO_LEVEL_COMPAT_NT4: {
+                               uint32_t _ptr_name;
+                               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name));
+                               if (_ptr_name) {
+                                       NDR_PULL_ALLOC(ndr, r->name);
+                               } else {
+                                       r->name = NULL;
+                               }
+                       break; }
+
+                       case WINBIND_DC_INFO_LEVEL_COMPAT_DS: {
+                               uint32_t _ptr_name;
+                               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name));
+                               if (_ptr_name) {
+                                       NDR_PULL_ALLOC(ndr, r->name);
+                               } else {
+                                       r->name = NULL;
+                               }
+                       break; }
+
+                       default:
+                               return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
+               }
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+               switch (level) {
+                       case WINBIND_DC_INFO_LEVEL_COMPAT_NT4:
+                               if (r->name) {
+                                       _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                                       NDR_PULL_SET_MEM_CTX(ndr, r->name, 0);
+                                       NDR_CHECK(ndr_pull_array_size(ndr, &r->name));
+                                       NDR_CHECK(ndr_pull_array_length(ndr, &r->name));
+                                       if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) {
+                                               return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->name), ndr_get_array_length(ndr, &r->name));
+                                       }
+                                       NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->name), sizeof(uint8_t)));
+                                       NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint8_t), CH_UTF8));
+                                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0);
+                               }
+                       break;
+
+                       case WINBIND_DC_INFO_LEVEL_COMPAT_DS:
+                               if (r->name) {
+                                       _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                                       NDR_PULL_SET_MEM_CTX(ndr, r->name, 0);
+                                       NDR_CHECK(ndr_pull_array_size(ndr, &r->name));
+                                       NDR_CHECK(ndr_pull_array_length(ndr, &r->name));
+                                       if (ndr_get_array_length(ndr, &r->name) > ndr_get_array_size(ndr, &r->name)) {
+                                               return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->name), ndr_get_array_length(ndr, &r->name));
+                                       }
+                                       NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->name), sizeof(uint8_t)));
+                                       NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->name, ndr_get_array_length(ndr, &r->name), sizeof(uint8_t), CH_UTF8));
+                                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0);
+                               }
+                       break;
+
+                       default:
+                               return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
+               }
+       }
+       return NT_STATUS_OK;
+}
+
+_PUBLIC_ void ndr_print_winbind_dc_info(struct ndr_print *ndr, const char *name, const union winbind_dc_info *r)
+{
+       int level;
+       level = ndr_print_get_switch_value(ndr, r);
+       ndr_print_union(ndr, name, level, "winbind_dc_info");
+       switch (level) {
+               case WINBIND_DC_INFO_LEVEL_COMPAT_NT4:
+                       ndr_print_ptr(ndr, "name", r->name);
+                       ndr->depth++;
+                       if (r->name) {
+                               ndr_print_string(ndr, "name", r->name);
+                       }
+                       ndr->depth--;
+               break;
+
+               case WINBIND_DC_INFO_LEVEL_COMPAT_DS:
+                       ndr_print_ptr(ndr, "name", r->name);
+                       ndr->depth++;
+                       if (r->name) {
+                               ndr_print_string(ndr, "name", r->name);
+                       }
+                       ndr->depth--;
+               break;
+
+               default:
+                       ndr_print_bad_level(ndr, name, level);
+       }
+}
+
 static NTSTATUS ndr_push_winbind_ping(struct ndr_push *ndr, int flags, const struct winbind_ping *r)
 {
        if (flags & NDR_IN) {
@@ -1643,8 +2015,26 @@ _PUBLIC_ void ndr_print_winbind_domain_name(struct ndr_print *ndr, const char *n
 static NTSTATUS ndr_push_winbind_get_domain_info(struct ndr_push *ndr, int flags, const struct winbind_get_domain_info *r)
 {
        if (flags & NDR_IN) {
-       }
-       if (flags & NDR_OUT) {
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain_name, CH_UTF8)));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain_name, CH_UTF8)));
+               NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain_name, ndr_charset_length(r->in.domain_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dc_name));
+               if (r->in.dc_name) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dc_name, CH_UTF8)));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dc_name, CH_UTF8)));
+                       NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dc_name, ndr_charset_length(r->in.dc_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
+               }
+               if (r->in.level == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               NDR_CHECK(ndr_push_winbind_domain_info_level(ndr, NDR_SCALARS, *r->in.level));
+       }
+       if (flags & NDR_OUT) {
+               if (r->out.level == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               NDR_CHECK(ndr_push_winbind_domain_info_level(ndr, NDR_SCALARS, *r->out.level));
+               if (r->out.domain_info == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.domain_info, *r->out.level));
+               NDR_CHECK(ndr_push_winbind_domain_info(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.domain_info));
                NDR_CHECK(ndr_push_winbind_status(ndr, NDR_SCALARS, r->out.result));
        }
        return NT_STATUS_OK;
@@ -1652,9 +2042,66 @@ static NTSTATUS ndr_push_winbind_get_domain_info(struct ndr_push *ndr, int flags
 
 static NTSTATUS ndr_pull_winbind_get_domain_info(struct ndr_pull *ndr, int flags, struct winbind_get_domain_info *r)
 {
-       if (flags & NDR_IN) {
-       }
-       if (flags & NDR_OUT) {
+       uint32_t _ptr_dc_name;
+       TALLOC_CTX *_mem_save_dc_name_0;
+       TALLOC_CTX *_mem_save_level_0;
+       TALLOC_CTX *_mem_save_domain_info_0;
+       if (flags & NDR_IN) {
+               ZERO_STRUCT(r->out);
+
+               NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain_name));
+               NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain_name));
+               if (ndr_get_array_length(ndr, &r->in.domain_name) > ndr_get_array_size(ndr, &r->in.domain_name)) {
+                       return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domain_name), ndr_get_array_length(ndr, &r->in.domain_name));
+               }
+               NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint8_t)));
+               NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain_name, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint8_t), CH_UTF8));
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dc_name));
+               if (_ptr_dc_name) {
+                       NDR_PULL_ALLOC(ndr, r->in.dc_name);
+               } else {
+                       r->in.dc_name = NULL;
+               }
+               if (r->in.dc_name) {
+                       _mem_save_dc_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->in.dc_name, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dc_name));
+                       NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dc_name));
+                       if (ndr_get_array_length(ndr, &r->in.dc_name) > ndr_get_array_size(ndr, &r->in.dc_name)) {
+                               return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dc_name), ndr_get_array_length(ndr, &r->in.dc_name));
+                       }
+                       NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dc_name), sizeof(uint8_t)));
+                       NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dc_name, ndr_get_array_length(ndr, &r->in.dc_name), sizeof(uint8_t), CH_UTF8));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dc_name_0, 0);
+               }
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->in.level);
+               }
+               _mem_save_level_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->in.level, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_winbind_domain_info_level(ndr, NDR_SCALARS, r->in.level));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_0, LIBNDR_FLAG_REF_ALLOC);
+               NDR_PULL_ALLOC(ndr, r->out.level);
+               *r->out.level = *r->in.level;
+               NDR_PULL_ALLOC(ndr, r->out.domain_info);
+               ZERO_STRUCTP(r->out.domain_info);
+       }
+       if (flags & NDR_OUT) {
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.level);
+               }
+               _mem_save_level_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.level, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_winbind_domain_info_level(ndr, NDR_SCALARS, r->out.level));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_0, LIBNDR_FLAG_REF_ALLOC);
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.domain_info);
+               }
+               _mem_save_domain_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.domain_info, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.domain_info, *r->out.level));
+               NDR_CHECK(ndr_pull_winbind_domain_info(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.domain_info));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_domain_info_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_winbind_status(ndr, NDR_SCALARS, &r->out.result));
        }
        return NT_STATUS_OK;
@@ -1670,11 +2117,31 @@ _PUBLIC_ void ndr_print_winbind_get_domain_info(struct ndr_print *ndr, const cha
        if (flags & NDR_IN) {
                ndr_print_struct(ndr, "in", "winbind_get_domain_info");
                ndr->depth++;
+               ndr_print_string(ndr, "domain_name", r->in.domain_name);
+               ndr_print_ptr(ndr, "dc_name", r->in.dc_name);
+               ndr->depth++;
+               if (r->in.dc_name) {
+                       ndr_print_string(ndr, "dc_name", r->in.dc_name);
+               }
+               ndr->depth--;
+               ndr_print_ptr(ndr, "level", r->in.level);
+               ndr->depth++;
+               ndr_print_winbind_domain_info_level(ndr, "level", *r->in.level);
+               ndr->depth--;
                ndr->depth--;
        }
        if (flags & NDR_OUT) {
                ndr_print_struct(ndr, "out", "winbind_get_domain_info");
                ndr->depth++;
+               ndr_print_ptr(ndr, "level", r->out.level);
+               ndr->depth++;
+               ndr_print_winbind_domain_info_level(ndr, "level", *r->out.level);
+               ndr->depth--;
+               ndr_print_ptr(ndr, "domain_info", r->out.domain_info);
+               ndr->depth++;
+               ndr_print_set_switch_value(ndr, r->out.domain_info, *r->out.level);
+               ndr_print_winbind_domain_info(ndr, "domain_info", r->out.domain_info);
+               ndr->depth--;
                ndr_print_winbind_status(ndr, "result", r->out.result);
                ndr->depth--;
        }
@@ -1684,8 +2151,26 @@ _PUBLIC_ void ndr_print_winbind_get_domain_info(struct ndr_print *ndr, const cha
 static NTSTATUS ndr_push_winbind_get_dc_info(struct ndr_push *ndr, int flags, const struct winbind_get_dc_info *r)
 {
        if (flags & NDR_IN) {
-       }
-       if (flags & NDR_OUT) {
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain_name, CH_UTF8)));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.domain_name, CH_UTF8)));
+               NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.domain_name, ndr_charset_length(r->in.domain_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.dc_name));
+               if (r->in.dc_name) {
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dc_name, CH_UTF8)));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+                       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.dc_name, CH_UTF8)));
+                       NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.dc_name, ndr_charset_length(r->in.dc_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
+               }
+               if (r->in.level == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               NDR_CHECK(ndr_push_winbind_dc_info_level(ndr, NDR_SCALARS, *r->in.level));
+       }
+       if (flags & NDR_OUT) {
+               if (r->out.level == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               NDR_CHECK(ndr_push_winbind_dc_info_level(ndr, NDR_SCALARS, *r->out.level));
+               if (r->out.dc_info == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
+               NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.dc_info, *r->out.level));
+               NDR_CHECK(ndr_push_winbind_dc_info(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.dc_info));
                NDR_CHECK(ndr_push_winbind_status(ndr, NDR_SCALARS, r->out.result));
        }
        return NT_STATUS_OK;
@@ -1693,9 +2178,66 @@ static NTSTATUS ndr_push_winbind_get_dc_info(struct ndr_push *ndr, int flags, co
 
 static NTSTATUS ndr_pull_winbind_get_dc_info(struct ndr_pull *ndr, int flags, struct winbind_get_dc_info *r)
 {
-       if (flags & NDR_IN) {
-       }
-       if (flags & NDR_OUT) {
+       uint32_t _ptr_dc_name;
+       TALLOC_CTX *_mem_save_dc_name_0;
+       TALLOC_CTX *_mem_save_level_0;
+       TALLOC_CTX *_mem_save_dc_info_0;
+       if (flags & NDR_IN) {
+               ZERO_STRUCT(r->out);
+
+               NDR_CHECK(ndr_pull_array_size(ndr, &r->in.domain_name));
+               NDR_CHECK(ndr_pull_array_length(ndr, &r->in.domain_name));
+               if (ndr_get_array_length(ndr, &r->in.domain_name) > ndr_get_array_size(ndr, &r->in.domain_name)) {
+                       return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.domain_name), ndr_get_array_length(ndr, &r->in.domain_name));
+               }
+               NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint8_t)));
+               NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.domain_name, ndr_get_array_length(ndr, &r->in.domain_name), sizeof(uint8_t), CH_UTF8));
+               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_dc_name));
+               if (_ptr_dc_name) {
+                       NDR_PULL_ALLOC(ndr, r->in.dc_name);
+               } else {
+                       r->in.dc_name = NULL;
+               }
+               if (r->in.dc_name) {
+                       _mem_save_dc_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->in.dc_name, 0);
+                       NDR_CHECK(ndr_pull_array_size(ndr, &r->in.dc_name));
+                       NDR_CHECK(ndr_pull_array_length(ndr, &r->in.dc_name));
+                       if (ndr_get_array_length(ndr, &r->in.dc_name) > ndr_get_array_size(ndr, &r->in.dc_name)) {
+                               return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.dc_name), ndr_get_array_length(ndr, &r->in.dc_name));
+                       }
+                       NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.dc_name), sizeof(uint8_t)));
+                       NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.dc_name, ndr_get_array_length(ndr, &r->in.dc_name), sizeof(uint8_t), CH_UTF8));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dc_name_0, 0);
+               }
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->in.level);
+               }
+               _mem_save_level_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->in.level, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_winbind_dc_info_level(ndr, NDR_SCALARS, r->in.level));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_0, LIBNDR_FLAG_REF_ALLOC);
+               NDR_PULL_ALLOC(ndr, r->out.level);
+               *r->out.level = *r->in.level;
+               NDR_PULL_ALLOC(ndr, r->out.dc_info);
+               ZERO_STRUCTP(r->out.dc_info);
+       }
+       if (flags & NDR_OUT) {
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.level);
+               }
+               _mem_save_level_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.level, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_winbind_dc_info_level(ndr, NDR_SCALARS, r->out.level));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_0, LIBNDR_FLAG_REF_ALLOC);
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.dc_info);
+               }
+               _mem_save_dc_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.dc_info, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.dc_info, *r->out.level));
+               NDR_CHECK(ndr_pull_winbind_dc_info(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.dc_info));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dc_info_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_winbind_status(ndr, NDR_SCALARS, &r->out.result));
        }
        return NT_STATUS_OK;
@@ -1711,11 +2253,31 @@ _PUBLIC_ void ndr_print_winbind_get_dc_info(struct ndr_print *ndr, const char *n
        if (flags & NDR_IN) {
                ndr_print_struct(ndr, "in", "winbind_get_dc_info");
                ndr->depth++;
+               ndr_print_string(ndr, "domain_name", r->in.domain_name);
+               ndr_print_ptr(ndr, "dc_name", r->in.dc_name);
+               ndr->depth++;
+               if (r->in.dc_name) {
+                       ndr_print_string(ndr, "dc_name", r->in.dc_name);
+               }
+               ndr->depth--;
+               ndr_print_ptr(ndr, "level", r->in.level);
+               ndr->depth++;
+               ndr_print_winbind_dc_info_level(ndr, "level", *r->in.level);
+               ndr->depth--;
                ndr->depth--;
        }
        if (flags & NDR_OUT) {
                ndr_print_struct(ndr, "out", "winbind_get_dc_info");
                ndr->depth++;
+               ndr_print_ptr(ndr, "level", r->out.level);
+               ndr->depth++;
+               ndr_print_winbind_dc_info_level(ndr, "level", *r->out.level);
+               ndr->depth--;
+               ndr_print_ptr(ndr, "dc_info", r->out.dc_info);
+               ndr->depth++;
+               ndr_print_set_switch_value(ndr, r->out.dc_info, *r->out.level);
+               ndr_print_winbind_dc_info(ndr, "dc_info", r->out.dc_info);
+               ndr->depth--;
                ndr_print_winbind_status(ndr, "result", r->out.result);
                ndr->depth--;
        }
index 34bd9e6..ef6c034 100644 (file)
@@ -142,6 +142,11 @@ void ndr_print_winbind_header_flags(struct ndr_print *ndr, const char *name, uin
 NTSTATUS ndr_push_STRUCT_winbind_header(struct ndr_push *ndr, int ndr_flags, const struct winbind_header *r);
 NTSTATUS ndr_pull_STRUCT_winbind_header(struct ndr_pull *ndr, int ndr_flags, struct winbind_header *r);
 void ndr_print_STRUCT_winbind_header(struct ndr_print *ndr, const char *name, const struct winbind_header *r);
+void ndr_print_STRUCT_winbind_domain_info_compat(struct ndr_print *ndr, const char *name, const struct winbind_domain_info_compat *r);
+void ndr_print_winbind_domain_info_level(struct ndr_print *ndr, const char *name, enum winbind_domain_info_level r);
+void ndr_print_winbind_domain_info(struct ndr_print *ndr, const char *name, const union winbind_domain_info *r);
+void ndr_print_winbind_dc_info_level(struct ndr_print *ndr, const char *name, enum winbind_dc_info_level r);
+void ndr_print_winbind_dc_info(struct ndr_print *ndr, const char *name, const union winbind_dc_info *r);
 void ndr_print_winbind_ping(struct ndr_print *ndr, const char *name, int flags, const struct winbind_ping *r);
 void ndr_print_winbind_interface_details(struct ndr_print *ndr, const char *name, int flags, const struct winbind_interface_details *r);
 void ndr_print_winbind_getpwnam(struct ndr_print *ndr, const char *name, int flags, const struct winbind_getpwnam *r);
index a5fd8da..0f2f8d1 100644 (file)
@@ -55,6 +55,45 @@ struct winbind_header {
        uint32_t flags;
 }/* [public] */;
 
+struct winbind_domain_info_compat {
+       const char *netbios_name;/* [charset(UTF8)] */
+       const char *dns_name;/* [unique,charset(UTF8)] */
+       struct dom_sid *sid;/* [ref] */
+       uint32_t is_native_mode;
+       uint32_t is_active_directory;
+       uint32_t is_primary;
+};
+
+#ifndef USE_UINT_ENUMS
+enum winbind_domain_info_level {
+       WINBIND_DOMAIN_INFO_LEVEL_COMPAT=1
+}
+#else
+enum winbind_domain_info_level { __donnot_use_enum_winbind_domain_info_level=0x7FFFFFFF}
+#define WINBIND_DOMAIN_INFO_LEVEL_COMPAT ( 1 )
+#endif
+;
+
+union winbind_domain_info {
+       struct winbind_domain_info_compat compat;/* [case(WINBIND_DOMAIN_INFO_LEVEL_COMPAT)] */
+}/* [switch_type(winbind_domain_info_level)] */;
+
+#ifndef USE_UINT_ENUMS
+enum winbind_dc_info_level {
+       WINBIND_DC_INFO_LEVEL_COMPAT_NT4=1,
+       WINBIND_DC_INFO_LEVEL_COMPAT_DS=2
+}
+#else
+enum winbind_dc_info_level { __donnot_use_enum_winbind_dc_info_level=0x7FFFFFFF}
+#define WINBIND_DC_INFO_LEVEL_COMPAT_NT4 ( 1 )
+#define WINBIND_DC_INFO_LEVEL_COMPAT_DS ( 2 )
+#endif
+;
+
+union winbind_dc_info {
+       const char *name;/* [unique,charset(UTF8),case(WINBIND_DC_INFO_LEVEL_COMPAT_NT4)] */
+}/* [switch_type(winbind_dc_info_level)] */;
+
 
 struct winbind_ping {
        struct {
@@ -354,6 +393,14 @@ struct winbind_domain_name {
 
 struct winbind_get_domain_info {
        struct {
+               const char *domain_name;/* [charset(UTF8)] */
+               const char *dc_name;/* [unique,charset(UTF8)] */
+               enum winbind_domain_info_level *level;/* [ref] */
+       } in;
+
+       struct {
+               union winbind_domain_info *domain_info;/* [ref,switch_is(*level)] */
+               enum winbind_domain_info_level *level;/* [ref] */
                enum winbind_status result;
        } out;
 
@@ -362,6 +409,14 @@ struct winbind_get_domain_info {
 
 struct winbind_get_dc_info {
        struct {
+               const char *domain_name;/* [charset(UTF8)] */
+               const char *dc_name;/* [unique,charset(UTF8)] */
+               enum winbind_dc_info_level *level;/* [ref] */
+       } in;
+
+       struct {
+               union winbind_dc_info *dc_info;/* [ref,switch_is(*level)] */
+               enum winbind_dc_info_level *level;/* [ref] */
                enum winbind_status result;
        } out;