rerun 'make idl'
authorStefan Metzmacher <metze@sernet.de>
Fri, 18 Jan 2008 16:48:12 +0000 (17:48 +0100)
committerStefan Metzmacher <metze@sernet.de>
Fri, 2 May 2008 14:13:14 +0000 (16:13 +0200)
metze

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

index c7d428b1b9997b67ada70b1e92ad65735cf67be2..427e8ccaddfdc7ccd312ddfd8afe375f902af889 100644 (file)
@@ -1906,13 +1906,13 @@ _PUBLIC_ void ndr_print_lsa_DomainList(struct ndr_print *ndr, const char *name,
        ndr->depth--;
 }
 
-static enum ndr_err_code ndr_push_lsa_SidType(struct ndr_push *ndr, int ndr_flags, enum lsa_SidType r)
+_PUBLIC_ enum ndr_err_code ndr_push_lsa_SidType(struct ndr_push *ndr, int ndr_flags, enum lsa_SidType r)
 {
        NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r));
        return NDR_ERR_SUCCESS;
 }
 
-static enum ndr_err_code ndr_pull_lsa_SidType(struct ndr_pull *ndr, int ndr_flags, enum lsa_SidType *r)
+_PUBLIC_ enum ndr_err_code ndr_pull_lsa_SidType(struct ndr_pull *ndr, int ndr_flags, enum lsa_SidType *r)
 {
        uint16_t v;
        NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v));
index a489b5423ebecb69923c938e025fe8b97a0eead7..b9eb287426688b700bcce1cc9f643b7b046624ae 100644 (file)
@@ -221,6 +221,8 @@ enum ndr_err_code ndr_push_lsa_SidArray(struct ndr_push *ndr, int ndr_flags, con
 enum ndr_err_code ndr_pull_lsa_SidArray(struct ndr_pull *ndr, int ndr_flags, struct lsa_SidArray *r);
 void ndr_print_lsa_SidArray(struct ndr_print *ndr, const char *name, const struct lsa_SidArray *r);
 void ndr_print_lsa_DomainList(struct ndr_print *ndr, const char *name, const struct lsa_DomainList *r);
+enum ndr_err_code ndr_push_lsa_SidType(struct ndr_push *ndr, int ndr_flags, enum lsa_SidType r);
+enum ndr_err_code ndr_pull_lsa_SidType(struct ndr_pull *ndr, int ndr_flags, enum lsa_SidType *r);
 void ndr_print_lsa_SidType(struct ndr_print *ndr, const char *name, enum lsa_SidType r);
 void ndr_print_lsa_TranslatedSid(struct ndr_print *ndr, const char *name, const struct lsa_TranslatedSid *r);
 void ndr_print_lsa_TransSidArray(struct ndr_print *ndr, const char *name, const struct lsa_TransSidArray *r);
index 4bbaf0e43d0b700cbfa1f2c31d243ba046dfb024..962e5d09c577e259445105c9d1c84a13ad2d1bc6 100644 (file)
@@ -4,6 +4,7 @@
 #include "librpc/gen_ndr/ndr_winbind_protocol.h"
 
 #include "librpc/gen_ndr/ndr_security.h"
+#include "librpc/gen_ndr/ndr_lsa.h"
 _PUBLIC_ enum ndr_err_code ndr_push_winbind_status(struct ndr_push *ndr, int ndr_flags, enum winbind_status r)
 {
        NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
@@ -123,6 +124,363 @@ _PUBLIC_ void ndr_print_STRUCT_winbind_header(struct ndr_print *ndr, const char
        ndr->depth--;
 }
 
+static enum ndr_err_code ndr_push_winbind_lookup_level(struct ndr_push *ndr, int ndr_flags, enum winbind_lookup_level r)
+{
+       NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
+       return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_winbind_lookup_level(struct ndr_pull *ndr, int ndr_flags, enum winbind_lookup_level *r)
+{
+       uint32_t v;
+       NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
+       *r = v;
+       return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_winbind_lookup_level(struct ndr_print *ndr, const char *name, enum winbind_lookup_level r)
+{
+       const char *val = NULL;
+
+       switch (r) {
+               case WINBIND_LOOKUP_LEVEL_SID2NAME: val = "WINBIND_LOOKUP_LEVEL_SID2NAME"; break;
+               case WINBIND_LOOKUP_LEVEL_NAME2SID: val = "WINBIND_LOOKUP_LEVEL_NAME2SID"; break;
+       }
+       ndr_print_enum(ndr, name, "ENUM", val, r);
+}
+
+static enum ndr_err_code ndr_push_winbind_lookup_req(struct ndr_push *ndr, int ndr_flags, const union winbind_lookup_req *r)
+{
+       if (ndr_flags & NDR_SCALARS) {
+               int level = ndr_push_get_switch_value(ndr, r);
+               NDR_CHECK(ndr_push_winbind_lookup_level(ndr, NDR_SCALARS, level));
+               switch (level) {
+                       case WINBIND_LOOKUP_LEVEL_SID2NAME:
+                               NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid));
+                       break;
+
+                       case WINBIND_LOOKUP_LEVEL_NAME2SID:
+                               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:
+                       break;
+
+               }
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+               int level = ndr_push_get_switch_value(ndr, r);
+               switch (level) {
+                       case WINBIND_LOOKUP_LEVEL_SID2NAME:
+                               if (r->sid) {
+                                       NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
+                               }
+                       break;
+
+                       case WINBIND_LOOKUP_LEVEL_NAME2SID:
+                       break;
+
+                       default:
+                       break;
+
+               }
+       }
+       return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_winbind_lookup_req(struct ndr_pull *ndr, int ndr_flags, union winbind_lookup_req *r)
+{
+       int level;
+       uint32_t _level;
+       TALLOC_CTX *_mem_save_sid_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_LOOKUP_LEVEL_SID2NAME: {
+                               uint32_t _ptr_sid;
+                               NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_sid));
+                               if (_ptr_sid) {
+                                       NDR_PULL_ALLOC(ndr, r->sid);
+                               } else {
+                                       r->sid = NULL;
+                               }
+                       break; }
+
+                       case WINBIND_LOOKUP_LEVEL_NAME2SID: {
+                               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));
+                       break; }
+
+                       default: {
+                       break; }
+
+               }
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+               switch (level) {
+                       case WINBIND_LOOKUP_LEVEL_SID2NAME:
+                               if (r->sid) {
+                                       _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                                       NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0);
+                                       NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
+                                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0);
+                               }
+                       break;
+
+                       case WINBIND_LOOKUP_LEVEL_NAME2SID:
+                       break;
+
+                       default:
+                       break;
+
+               }
+       }
+       return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_winbind_lookup_req(struct ndr_print *ndr, const char *name, const union winbind_lookup_req *r)
+{
+       int level;
+       level = ndr_print_get_switch_value(ndr, r);
+       ndr_print_union(ndr, name, level, "winbind_lookup_req");
+       switch (level) {
+               case WINBIND_LOOKUP_LEVEL_SID2NAME:
+                       ndr_print_ptr(ndr, "sid", r->sid);
+                       ndr->depth++;
+                       if (r->sid) {
+                               ndr_print_dom_sid(ndr, "sid", r->sid);
+                       }
+                       ndr->depth--;
+               break;
+
+               case WINBIND_LOOKUP_LEVEL_NAME2SID:
+                       ndr_print_string(ndr, "name", r->name);
+               break;
+
+               default:
+               break;
+
+       }
+}
+
+static enum ndr_err_code ndr_push_STRUCT_winbind_lookup_name_info(struct ndr_push *ndr, int ndr_flags, const struct winbind_lookup_name_info *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->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->domain_name, CH_UTF8)));
+               NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->domain_name, ndr_charset_length(r->domain_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->account_name, CH_UTF8)));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
+               NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->account_name, CH_UTF8)));
+               NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->account_name, ndr_charset_length(r->account_name, CH_UTF8), sizeof(uint8_t), CH_UTF8));
+               NDR_CHECK(ndr_push_lsa_SidType(ndr, NDR_SCALARS, r->type));
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+       }
+       return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_STRUCT_winbind_lookup_name_info(struct ndr_pull *ndr, int ndr_flags, struct winbind_lookup_name_info *r)
+{
+       if (ndr_flags & NDR_SCALARS) {
+               NDR_CHECK(ndr_pull_align(ndr, 4));
+               NDR_CHECK(ndr_pull_array_size(ndr, &r->domain_name));
+               NDR_CHECK(ndr_pull_array_length(ndr, &r->domain_name));
+               if (ndr_get_array_length(ndr, &r->domain_name) > ndr_get_array_size(ndr, &r->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->domain_name), ndr_get_array_length(ndr, &r->domain_name));
+               }
+               NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->domain_name), sizeof(uint8_t)));
+               NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->domain_name, ndr_get_array_length(ndr, &r->domain_name), sizeof(uint8_t), CH_UTF8));
+               NDR_CHECK(ndr_pull_array_size(ndr, &r->account_name));
+               NDR_CHECK(ndr_pull_array_length(ndr, &r->account_name));
+               if (ndr_get_array_length(ndr, &r->account_name) > ndr_get_array_size(ndr, &r->account_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->account_name), ndr_get_array_length(ndr, &r->account_name));
+               }
+               NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->account_name), sizeof(uint8_t)));
+               NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->account_name, ndr_get_array_length(ndr, &r->account_name), sizeof(uint8_t), CH_UTF8));
+               NDR_CHECK(ndr_pull_lsa_SidType(ndr, NDR_SCALARS, &r->type));
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+       }
+       return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_STRUCT_winbind_lookup_name_info(struct ndr_print *ndr, const char *name, const struct winbind_lookup_name_info *r)
+{
+       ndr_print_struct(ndr, name, "winbind_lookup_name_info");
+       ndr->depth++;
+       ndr_print_string(ndr, "domain_name", r->domain_name);
+       ndr_print_string(ndr, "account_name", r->account_name);
+       ndr_print_lsa_SidType(ndr, "type", r->type);
+       ndr->depth--;
+}
+
+static enum ndr_err_code ndr_push_STRUCT_winbind_lookup_sid_info(struct ndr_push *ndr, int ndr_flags, const struct winbind_lookup_sid_info *r)
+{
+       if (ndr_flags & NDR_SCALARS) {
+               NDR_CHECK(ndr_push_align(ndr, 4));
+               NDR_CHECK(ndr_push_unique_ptr(ndr, r->sid));
+               NDR_CHECK(ndr_push_lsa_SidType(ndr, NDR_SCALARS, r->type));
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+               if (r->sid) {
+                       NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
+               }
+       }
+       return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_STRUCT_winbind_lookup_sid_info(struct ndr_pull *ndr, int ndr_flags, struct winbind_lookup_sid_info *r)
+{
+       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_generic_ptr(ndr, &_ptr_sid));
+               if (_ptr_sid) {
+                       NDR_PULL_ALLOC(ndr, r->sid);
+               } else {
+                       r->sid = NULL;
+               }
+               NDR_CHECK(ndr_pull_lsa_SidType(ndr, NDR_SCALARS, &r->type));
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+               if (r->sid) {
+                       _mem_save_sid_0 = NDR_PULL_GET_MEM_CTX(ndr);
+                       NDR_PULL_SET_MEM_CTX(ndr, r->sid, 0);
+                       NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS|NDR_BUFFERS, r->sid));
+                       NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sid_0, 0);
+               }
+       }
+       return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_STRUCT_winbind_lookup_sid_info(struct ndr_print *ndr, const char *name, const struct winbind_lookup_sid_info *r)
+{
+       ndr_print_struct(ndr, name, "winbind_lookup_sid_info");
+       ndr->depth++;
+       ndr_print_ptr(ndr, "sid", r->sid);
+       ndr->depth++;
+       if (r->sid) {
+               ndr_print_dom_sid(ndr, "sid", r->sid);
+       }
+       ndr->depth--;
+       ndr_print_lsa_SidType(ndr, "type", r->type);
+       ndr->depth--;
+}
+
+static enum ndr_err_code ndr_push_winbind_lookup_rep(struct ndr_push *ndr, int ndr_flags, const union winbind_lookup_rep *r)
+{
+       if (ndr_flags & NDR_SCALARS) {
+               int level = ndr_push_get_switch_value(ndr, r);
+               NDR_CHECK(ndr_push_winbind_lookup_level(ndr, NDR_SCALARS, level));
+               switch (level) {
+                       case WINBIND_LOOKUP_LEVEL_SID2NAME:
+                               NDR_CHECK(ndr_push_STRUCT_winbind_lookup_name_info(ndr, NDR_SCALARS, &r->name_info));
+                       break;
+
+                       case WINBIND_LOOKUP_LEVEL_NAME2SID:
+                               NDR_CHECK(ndr_push_STRUCT_winbind_lookup_sid_info(ndr, NDR_SCALARS, &r->sid_info));
+                       break;
+
+                       default:
+                       break;
+
+               }
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+               int level = ndr_push_get_switch_value(ndr, r);
+               switch (level) {
+                       case WINBIND_LOOKUP_LEVEL_SID2NAME:
+                       break;
+
+                       case WINBIND_LOOKUP_LEVEL_NAME2SID:
+                               NDR_CHECK(ndr_push_STRUCT_winbind_lookup_sid_info(ndr, NDR_BUFFERS, &r->sid_info));
+                       break;
+
+                       default:
+                       break;
+
+               }
+       }
+       return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_winbind_lookup_rep(struct ndr_pull *ndr, int ndr_flags, union winbind_lookup_rep *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_LOOKUP_LEVEL_SID2NAME: {
+                               NDR_CHECK(ndr_pull_STRUCT_winbind_lookup_name_info(ndr, NDR_SCALARS, &r->name_info));
+                       break; }
+
+                       case WINBIND_LOOKUP_LEVEL_NAME2SID: {
+                               NDR_CHECK(ndr_pull_STRUCT_winbind_lookup_sid_info(ndr, NDR_SCALARS, &r->sid_info));
+                       break; }
+
+                       default: {
+                       break; }
+
+               }
+       }
+       if (ndr_flags & NDR_BUFFERS) {
+               switch (level) {
+                       case WINBIND_LOOKUP_LEVEL_SID2NAME:
+                       break;
+
+                       case WINBIND_LOOKUP_LEVEL_NAME2SID:
+                               NDR_CHECK(ndr_pull_STRUCT_winbind_lookup_sid_info(ndr, NDR_BUFFERS, &r->sid_info));
+                       break;
+
+                       default:
+                       break;
+
+               }
+       }
+       return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_winbind_lookup_rep(struct ndr_print *ndr, const char *name, const union winbind_lookup_rep *r)
+{
+       int level;
+       level = ndr_print_get_switch_value(ndr, r);
+       ndr_print_union(ndr, name, level, "winbind_lookup_rep");
+       switch (level) {
+               case WINBIND_LOOKUP_LEVEL_SID2NAME:
+                       ndr_print_STRUCT_winbind_lookup_name_info(ndr, "name_info", &r->name_info);
+               break;
+
+               case WINBIND_LOOKUP_LEVEL_NAME2SID:
+                       ndr_print_STRUCT_winbind_lookup_sid_info(ndr, "sid_info", &r->sid_info);
+               break;
+
+               default:
+               break;
+
+       }
+}
+
 static enum ndr_err_code ndr_push_winbind_get_idmap_level(struct ndr_push *ndr, int ndr_flags, enum winbind_get_idmap_level r)
 {
        NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
@@ -2101,123 +2459,86 @@ _PUBLIC_ void ndr_print_winbind_list_trustdom(struct ndr_print *ndr, const char
        ndr->depth--;
 }
 
-static enum ndr_err_code ndr_push_winbind_lookup_sid(struct ndr_push *ndr, int flags, const struct winbind_lookup_sid *r)
+static enum ndr_err_code ndr_push_winbind_lookup(struct ndr_push *ndr, int flags, const struct winbind_lookup *r)
 {
        if (flags & NDR_IN) {
+               if (r->in.level == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_winbind_lookup_level(ndr, NDR_SCALARS, *r->in.level));
+               NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.req, *r->in.level));
+               NDR_CHECK(ndr_push_winbind_lookup_req(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.req));
        }
        if (flags & NDR_OUT) {
+               if (r->out.rep == NULL) {
+                       return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+               }
+               NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.rep, *r->in.level));
+               NDR_CHECK(ndr_push_winbind_lookup_rep(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.rep));
                NDR_CHECK(ndr_push_winbind_status(ndr, NDR_SCALARS, r->out.result));
        }
        return NDR_ERR_SUCCESS;
 }
 
-static enum ndr_err_code ndr_pull_winbind_lookup_sid(struct ndr_pull *ndr, int flags, struct winbind_lookup_sid *r)
+static enum ndr_err_code ndr_pull_winbind_lookup(struct ndr_pull *ndr, int flags, struct winbind_lookup *r)
 {
+       TALLOC_CTX *_mem_save_level_0;
+       TALLOC_CTX *_mem_save_rep_0;
        if (flags & NDR_IN) {
+               ZERO_STRUCT(r->out);
+
+               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_lookup_level(ndr, NDR_SCALARS, r->in.level));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_level_0, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.req, *r->in.level));
+               NDR_CHECK(ndr_pull_winbind_lookup_req(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.req));
+               NDR_PULL_ALLOC(ndr, r->out.rep);
+               ZERO_STRUCTP(r->out.rep);
        }
        if (flags & NDR_OUT) {
+               if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+                       NDR_PULL_ALLOC(ndr, r->out.rep);
+               }
+               _mem_save_rep_0 = NDR_PULL_GET_MEM_CTX(ndr);
+               NDR_PULL_SET_MEM_CTX(ndr, r->out.rep, LIBNDR_FLAG_REF_ALLOC);
+               NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.rep, *r->in.level));
+               NDR_CHECK(ndr_pull_winbind_lookup_rep(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.rep));
+               NDR_PULL_SET_MEM_CTX(ndr, _mem_save_rep_0, LIBNDR_FLAG_REF_ALLOC);
                NDR_CHECK(ndr_pull_winbind_status(ndr, NDR_SCALARS, &r->out.result));
        }
        return NDR_ERR_SUCCESS;
 }
 
-_PUBLIC_ void ndr_print_winbind_lookup_sid(struct ndr_print *ndr, const char *name, int flags, const struct winbind_lookup_sid *r)
+_PUBLIC_ void ndr_print_winbind_lookup(struct ndr_print *ndr, const char *name, int flags, const struct winbind_lookup *r)
 {
-       ndr_print_struct(ndr, name, "winbind_lookup_sid");
+       ndr_print_struct(ndr, name, "winbind_lookup");
        ndr->depth++;
        if (flags & NDR_SET_VALUES) {
                ndr->flags |= LIBNDR_PRINT_SET_VALUES;
        }
        if (flags & NDR_IN) {
-               ndr_print_struct(ndr, "in", "winbind_lookup_sid");
+               ndr_print_struct(ndr, "in", "winbind_lookup");
                ndr->depth++;
-               ndr->depth--;
-       }
-       if (flags & NDR_OUT) {
-               ndr_print_struct(ndr, "out", "winbind_lookup_sid");
+               ndr_print_ptr(ndr, "level", r->in.level);
                ndr->depth++;
-               ndr_print_winbind_status(ndr, "result", r->out.result);
+               ndr_print_winbind_lookup_level(ndr, "level", *r->in.level);
                ndr->depth--;
-       }
-       ndr->depth--;
-}
-
-static enum ndr_err_code ndr_push_winbind_lookup_name(struct ndr_push *ndr, int flags, const struct winbind_lookup_name *r)
-{
-       if (flags & NDR_IN) {
-       }
-       if (flags & NDR_OUT) {
-               NDR_CHECK(ndr_push_winbind_status(ndr, NDR_SCALARS, r->out.result));
-       }
-       return NDR_ERR_SUCCESS;
-}
-
-static enum ndr_err_code ndr_pull_winbind_lookup_name(struct ndr_pull *ndr, int flags, struct winbind_lookup_name *r)
-{
-       if (flags & NDR_IN) {
-       }
-       if (flags & NDR_OUT) {
-               NDR_CHECK(ndr_pull_winbind_status(ndr, NDR_SCALARS, &r->out.result));
-       }
-       return NDR_ERR_SUCCESS;
-}
-
-_PUBLIC_ void ndr_print_winbind_lookup_name(struct ndr_print *ndr, const char *name, int flags, const struct winbind_lookup_name *r)
-{
-       ndr_print_struct(ndr, name, "winbind_lookup_name");
-       ndr->depth++;
-       if (flags & NDR_SET_VALUES) {
-               ndr->flags |= LIBNDR_PRINT_SET_VALUES;
-       }
-       if (flags & NDR_IN) {
-               ndr_print_struct(ndr, "in", "winbind_lookup_name");
-               ndr->depth++;
+               ndr_print_set_switch_value(ndr, &r->in.req, *r->in.level);
+               ndr_print_winbind_lookup_req(ndr, "req", &r->in.req);
                ndr->depth--;
        }
        if (flags & NDR_OUT) {
-               ndr_print_struct(ndr, "out", "winbind_lookup_name");
+               ndr_print_struct(ndr, "out", "winbind_lookup");
                ndr->depth++;
-               ndr_print_winbind_status(ndr, "result", r->out.result);
-               ndr->depth--;
-       }
-       ndr->depth--;
-}
-
-static enum ndr_err_code ndr_push_winbind_lookup_rids(struct ndr_push *ndr, int flags, const struct winbind_lookup_rids *r)
-{
-       if (flags & NDR_IN) {
-       }
-       if (flags & NDR_OUT) {
-               NDR_CHECK(ndr_push_winbind_status(ndr, NDR_SCALARS, r->out.result));
-       }
-       return NDR_ERR_SUCCESS;
-}
-
-static enum ndr_err_code ndr_pull_winbind_lookup_rids(struct ndr_pull *ndr, int flags, struct winbind_lookup_rids *r)
-{
-       if (flags & NDR_IN) {
-       }
-       if (flags & NDR_OUT) {
-               NDR_CHECK(ndr_pull_winbind_status(ndr, NDR_SCALARS, &r->out.result));
-       }
-       return NDR_ERR_SUCCESS;
-}
-
-_PUBLIC_ void ndr_print_winbind_lookup_rids(struct ndr_print *ndr, const char *name, int flags, const struct winbind_lookup_rids *r)
-{
-       ndr_print_struct(ndr, name, "winbind_lookup_rids");
-       ndr->depth++;
-       if (flags & NDR_SET_VALUES) {
-               ndr->flags |= LIBNDR_PRINT_SET_VALUES;
-       }
-       if (flags & NDR_IN) {
-               ndr_print_struct(ndr, "in", "winbind_lookup_rids");
+               ndr_print_ptr(ndr, "rep", r->out.rep);
                ndr->depth++;
+               ndr_print_set_switch_value(ndr, r->out.rep, *r->in.level);
+               ndr_print_winbind_lookup_rep(ndr, "rep", r->out.rep);
                ndr->depth--;
-       }
-       if (flags & NDR_OUT) {
-               ndr_print_struct(ndr, "out", "winbind_lookup_rids");
-               ndr->depth++;
                ndr_print_winbind_status(ndr, "result", r->out.result);
                ndr->depth--;
        }
@@ -3349,27 +3670,11 @@ static const struct ndr_interface_call winbind_protocol_calls[] = {
                false,
        },
        {
-               "winbind_lookup_sid",
-               sizeof(struct winbind_lookup_sid),
-               (ndr_push_flags_fn_t) ndr_push_winbind_lookup_sid,
-               (ndr_pull_flags_fn_t) ndr_pull_winbind_lookup_sid,
-               (ndr_print_function_t) ndr_print_winbind_lookup_sid,
-               false,
-       },
-       {
-               "winbind_lookup_name",
-               sizeof(struct winbind_lookup_name),
-               (ndr_push_flags_fn_t) ndr_push_winbind_lookup_name,
-               (ndr_pull_flags_fn_t) ndr_pull_winbind_lookup_name,
-               (ndr_print_function_t) ndr_print_winbind_lookup_name,
-               false,
-       },
-       {
-               "winbind_lookup_rids",
-               sizeof(struct winbind_lookup_rids),
-               (ndr_push_flags_fn_t) ndr_push_winbind_lookup_rids,
-               (ndr_pull_flags_fn_t) ndr_pull_winbind_lookup_rids,
-               (ndr_print_function_t) ndr_print_winbind_lookup_rids,
+               "winbind_lookup",
+               sizeof(struct winbind_lookup),
+               (ndr_push_flags_fn_t) ndr_push_winbind_lookup,
+               (ndr_pull_flags_fn_t) ndr_pull_winbind_lookup,
+               (ndr_print_function_t) ndr_print_winbind_lookup,
                false,
        },
        {
@@ -3529,7 +3834,7 @@ const struct ndr_interface_table ndr_table_winbind_protocol = {
                NDR_WINBIND_PROTOCOL_VERSION
        },
        .helpstring     = NDR_WINBIND_PROTOCOL_HELPSTRING,
-       .num_calls      = 40,
+       .num_calls      = 38,
        .calls          = winbind_protocol_calls,
        .endpoints      = &winbind_protocol_endpoints,
        .authservices   = &winbind_protocol_authservices
index c2ebb4fca745788d38f6d4704ba48be73c2a2366..92ce4da06327b0c78a7bbf06bfa56acb96b06506 100644 (file)
@@ -53,45 +53,41 @@ extern const struct ndr_interface_table ndr_table_winbind_protocol;
 
 #define NDR_WINBIND_LIST_TRUSTDOM (0x14)
 
-#define NDR_WINBIND_LOOKUP_SID (0x15)
+#define NDR_WINBIND_LOOKUP (0x15)
 
-#define NDR_WINBIND_LOOKUP_NAME (0x16)
+#define NDR_WINBIND_GET_IDMAP (0x16)
 
-#define NDR_WINBIND_LOOKUP_RIDS (0x17)
+#define NDR_WINBIND_SET_IDMAP (0x17)
 
-#define NDR_WINBIND_GET_IDMAP (0x18)
+#define NDR_WINBIND_CHECK_MACHCC (0x18)
 
-#define NDR_WINBIND_SET_IDMAP (0x19)
+#define NDR_WINBIND_INFO_FIXNAME (0x19)
 
-#define NDR_WINBIND_CHECK_MACHCC (0x1a)
+#define NDR_WINBIND_DOMAIN_NAME (0x1a)
 
-#define NDR_WINBIND_INFO_FIXNAME (0x1b)
+#define NDR_WINBIND_GET_DOMAIN_INFO (0x1b)
 
-#define NDR_WINBIND_DOMAIN_NAME (0x1c)
+#define NDR_WINBIND_GET_DC_INFO (0x1c)
 
-#define NDR_WINBIND_GET_DOMAIN_INFO (0x1d)
+#define NDR_WINBIND_WINS_BYIP (0x1d)
 
-#define NDR_WINBIND_GET_DC_INFO (0x1e)
+#define NDR_WINBIND_WINS_BYNAME (0x1e)
 
-#define NDR_WINBIND_WINS_BYIP (0x1f)
+#define NDR_WINBIND_GETGRLIST (0x1f)
 
-#define NDR_WINBIND_WINS_BYNAME (0x20)
+#define NDR_WINBIND_NETBIOS_NAME (0x20)
 
-#define NDR_WINBIND_GETGRLIST (0x21)
+#define NDR_WINBIND_GETUSERSIDS (0x21)
 
-#define NDR_WINBIND_NETBIOS_NAME (0x22)
+#define NDR_WINBIND_GETUSERDOMGROUPS (0x22)
 
-#define NDR_WINBIND_GETUSERSIDS (0x23)
+#define NDR_WINBIND_DUAL_USERINFO (0x23)
 
-#define NDR_WINBIND_GETUSERDOMGROUPS (0x24)
+#define NDR_WINBIND_DUAL_GETSIDALIASES (0x24)
 
-#define NDR_WINBIND_DUAL_USERINFO (0x25)
+#define NDR_WINBIND_CCACHE_NTLMAUTH (0x25)
 
-#define NDR_WINBIND_DUAL_GETSIDALIASES (0x26)
-
-#define NDR_WINBIND_CCACHE_NTLMAUTH (0x27)
-
-#define NDR_WINBIND_PROTOCOL_CALL_COUNT (40)
+#define NDR_WINBIND_PROTOCOL_CALL_COUNT (38)
 enum ndr_err_code ndr_push_winbind_status(struct ndr_push *ndr, int ndr_flags, enum winbind_status r);
 enum ndr_err_code ndr_pull_winbind_status(struct ndr_pull *ndr, int ndr_flags, enum winbind_status *r);
 void ndr_print_winbind_status(struct ndr_print *ndr, const char *name, enum winbind_status r);
@@ -100,6 +96,11 @@ void ndr_print_winbind_header_flags(struct ndr_print *ndr, const char *name, uin
 enum ndr_err_code ndr_push_STRUCT_winbind_header(struct ndr_push *ndr, int ndr_flags, const struct winbind_header *r);
 enum ndr_err_code 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_winbind_lookup_level(struct ndr_print *ndr, const char *name, enum winbind_lookup_level r);
+void ndr_print_winbind_lookup_req(struct ndr_print *ndr, const char *name, const union winbind_lookup_req *r);
+void ndr_print_STRUCT_winbind_lookup_name_info(struct ndr_print *ndr, const char *name, const struct winbind_lookup_name_info *r);
+void ndr_print_STRUCT_winbind_lookup_sid_info(struct ndr_print *ndr, const char *name, const struct winbind_lookup_sid_info *r);
+void ndr_print_winbind_lookup_rep(struct ndr_print *ndr, const char *name, const union winbind_lookup_rep *r);
 void ndr_print_winbind_get_idmap_level(struct ndr_print *ndr, const char *name, enum winbind_get_idmap_level r);
 void ndr_print_winbind_get_idmap_req(struct ndr_print *ndr, const char *name, const union winbind_get_idmap_req *r);
 void ndr_print_winbind_get_idmap_rep(struct ndr_print *ndr, const char *name, const union winbind_get_idmap_rep *r);
@@ -133,9 +134,7 @@ void ndr_print_winbind_pam_chng_paswd_auth_crap(struct ndr_print *ndr, const cha
 void ndr_print_winbind_list_users(struct ndr_print *ndr, const char *name, int flags, const struct winbind_list_users *r);
 void ndr_print_winbind_list_groups(struct ndr_print *ndr, const char *name, int flags, const struct winbind_list_groups *r);
 void ndr_print_winbind_list_trustdom(struct ndr_print *ndr, const char *name, int flags, const struct winbind_list_trustdom *r);
-void ndr_print_winbind_lookup_sid(struct ndr_print *ndr, const char *name, int flags, const struct winbind_lookup_sid *r);
-void ndr_print_winbind_lookup_name(struct ndr_print *ndr, const char *name, int flags, const struct winbind_lookup_name *r);
-void ndr_print_winbind_lookup_rids(struct ndr_print *ndr, const char *name, int flags, const struct winbind_lookup_rids *r);
+void ndr_print_winbind_lookup(struct ndr_print *ndr, const char *name, int flags, const struct winbind_lookup *r);
 void ndr_print_winbind_get_idmap(struct ndr_print *ndr, const char *name, int flags, const struct winbind_get_idmap *r);
 void ndr_print_winbind_set_idmap(struct ndr_print *ndr, const char *name, int flags, const struct winbind_set_idmap *r);
 void ndr_print_winbind_check_machcc(struct ndr_print *ndr, const char *name, int flags, const struct winbind_check_machcc *r);
index f0f9ffd179e521801c5563e54bb5a71796527e53..f906922d34abc291ae50bcb82e774cc685517aa0 100644 (file)
@@ -3,6 +3,7 @@
 #include <stdint.h>
 
 #include "librpc/gen_ndr/security.h"
+#include "librpc/gen_ndr/lsa.h"
 #ifndef _HEADER_winbind_protocol
 #define _HEADER_winbind_protocol
 
 #define WINBIND_MAX_LENGTH_UNPRIVILEGED        ( 0x00020000 )
 #define WINBIND_STATUS_FOOBAR  ( WINBIND_STATUS_UNKNOWN_ERROR )
 #define WINBIND_HEADER_SIZE    ( 0x10 )
+enum lsa_SidType;
+
+enum winbind_status
 #ifndef USE_UINT_ENUMS
-enum winbind_status {
+ {
        WINBIND_STATUS_OK=0x00000000,
        WINBIND_STATUS_UNKNOWN_ERROR=0x57420001,
        WINBIND_STATUS_NOT_IMPLEMENTED=0x57420002,
@@ -23,7 +27,7 @@ enum winbind_status {
        WINBIND_STATUS_DOMAIN_OFFLINE=0x57420008
 }
 #else
-enum winbind_status { __donnot_use_enum_winbind_status=0x7FFFFFFF}
+ { __donnot_use_enum_winbind_status=0x7FFFFFFF}
 #define WINBIND_STATUS_OK ( 0x00000000 )
 #define WINBIND_STATUS_UNKNOWN_ERROR ( 0x57420001 )
 #define WINBIND_STATUS_NOT_IMPLEMENTED ( 0x57420002 )
@@ -55,15 +59,50 @@ struct winbind_header {
        uint32_t flags;
 }/* [public] */;
 
+enum winbind_lookup_level
+#ifndef USE_UINT_ENUMS
+ {
+       WINBIND_LOOKUP_LEVEL_SID2NAME=1,
+       WINBIND_LOOKUP_LEVEL_NAME2SID=2
+}
+#else
+ { __donnot_use_enum_winbind_lookup_level=0x7FFFFFFF}
+#define WINBIND_LOOKUP_LEVEL_SID2NAME ( 1 )
+#define WINBIND_LOOKUP_LEVEL_NAME2SID ( 2 )
+#endif
+;
+
+union winbind_lookup_req {
+       struct dom_sid *sid;/* [unique,case(WINBIND_LOOKUP_LEVEL_SID2NAME)] */
+       const char *name;/* [charset(UTF8),case(WINBIND_LOOKUP_LEVEL_NAME2SID)] */
+}/* [switch_type(winbind_lookup_level)] */;
+
+struct winbind_lookup_name_info {
+       const char *domain_name;/* [charset(UTF8)] */
+       const char *account_name;/* [charset(UTF8)] */
+       enum lsa_SidType type;
+};
+
+struct winbind_lookup_sid_info {
+       struct dom_sid *sid;/* [unique] */
+       enum lsa_SidType type;
+};
+
+union winbind_lookup_rep {
+       struct winbind_lookup_name_info name_info;/* [case(WINBIND_LOOKUP_LEVEL_SID2NAME)] */
+       struct winbind_lookup_sid_info sid_info;/* [case(WINBIND_LOOKUP_LEVEL_NAME2SID)] */
+}/* [switch_type(winbind_lookup_level)] */;
+
+enum winbind_get_idmap_level
 #ifndef USE_UINT_ENUMS
-enum winbind_get_idmap_level {
+ {
        WINBIND_IDMAP_LEVEL_SID_TO_UID=1,
        WINBIND_IDMAP_LEVEL_SID_TO_GID=2,
        WINBIND_IDMAP_LEVEL_UID_TO_SID=3,
        WINBIND_IDMAP_LEVEL_GID_TO_SID=4
 }
 #else
-enum winbind_get_idmap_level { __donnot_use_enum_winbind_get_idmap_level=0x7FFFFFFF}
+ { __donnot_use_enum_winbind_get_idmap_level=0x7FFFFFFF}
 #define WINBIND_IDMAP_LEVEL_SID_TO_UID ( 1 )
 #define WINBIND_IDMAP_LEVEL_SID_TO_GID ( 2 )
 #define WINBIND_IDMAP_LEVEL_UID_TO_SID ( 3 )
@@ -83,15 +122,16 @@ union winbind_get_idmap_rep {
        struct dom_sid *sid;/* [unique,case(WINBIND_IDMAP_LEVEL_UID_TO_SID)] */
 }/* [switch_type(winbind_get_idmap_level)] */;
 
+enum winbind_set_idmap_level
 #ifndef USE_UINT_ENUMS
-enum winbind_set_idmap_level {
+ {
        WINBIND_SET_IDMAP_LEVEL_ALLOCATE_UID=1,
        WINBIND_SET_IDMAP_LEVEL_ALLOCATE_GID=2,
        WINBIND_SET_IDMAP_LEVEL_SET_MAPPING=3,
        WINBIND_SET_IDMAP_LEVEL_SET_HWM=4
 }
 #else
-enum winbind_set_idmap_level { __donnot_use_enum_winbind_set_idmap_level=0x7FFFFFFF}
+ { __donnot_use_enum_winbind_set_idmap_level=0x7FFFFFFF}
 #define WINBIND_SET_IDMAP_LEVEL_ALLOCATE_UID ( 1 )
 #define WINBIND_SET_IDMAP_LEVEL_ALLOCATE_GID ( 2 )
 #define WINBIND_SET_IDMAP_LEVEL_SET_MAPPING ( 3 )
@@ -118,13 +158,14 @@ struct winbind_domain_info_compat {
        uint32_t is_primary;
 };
 
+enum winbind_domain_info_level
 #ifndef USE_UINT_ENUMS
-enum winbind_domain_info_level {
+ {
        WINBIND_DOMAIN_INFO_LEVEL_COMPAT=1,
        WINBIND_DOMAIN_INFO_LEVEL_SEQNUM=2
 }
 #else
-enum winbind_domain_info_level { __donnot_use_enum_winbind_domain_info_level=0x7FFFFFFF}
+ { __donnot_use_enum_winbind_domain_info_level=0x7FFFFFFF}
 #define WINBIND_DOMAIN_INFO_LEVEL_COMPAT ( 1 )
 #define WINBIND_DOMAIN_INFO_LEVEL_SEQNUM ( 2 )
 #endif
@@ -135,13 +176,14 @@ union winbind_domain_info {
        uint64_t seqnum;/* [case(WINBIND_DOMAIN_INFO_LEVEL_SEQNUM)] */
 }/* [switch_type(winbind_domain_info_level)] */;
 
+enum winbind_dc_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}
+ { __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
@@ -324,24 +366,14 @@ struct winbind_list_trustdom {
 };
 
 
-struct winbind_lookup_sid {
+struct winbind_lookup {
        struct {
-               enum winbind_status result;
-       } out;
-
-};
-
-
-struct winbind_lookup_name {
-       struct {
-               enum winbind_status result;
-       } out;
-
-};
-
+               enum winbind_lookup_level *level;/* [ref] */
+               union winbind_lookup_req req;/* [switch_is(*level)] */
+       } in;
 
-struct winbind_lookup_rids {
        struct {
+               union winbind_lookup_rep *rep;/* [ref,switch_is(*level)] */
                enum winbind_status result;
        } out;