1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

IDL: Re-run make idl and hand merge some required functions from Samba 4.

Guenther
This commit is contained in:
Günther Deschner 2008-04-17 18:29:48 +02:00
parent 3e7f302d80
commit edb0092e4d
5 changed files with 94 additions and 38 deletions

View File

@ -493,9 +493,8 @@ struct nbt_netlogon_announce_uas {
const char * unicode_domain;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */
uint32_t db_count;
struct nbt_db_change *dbchange;
uint32_t sid_size;/* [value(ndr_size_dom_sid(&sid,ndr->flags))] */
DATA_BLOB _pad2;/* [flag(LIBNDR_FLAG_ALIGN4)] */
struct dom_sid sid;
uint32_t sid_size;/* [value(ndr_size_dom_sid0(&sid,ndr->flags))] */
struct dom_sid0 sid;/* [subcontext_size(sid_size),subcontext(0)] */
uint32_t nt_version;
uint16_t lmnt_token;
uint16_t lm20_token;
@ -607,9 +606,8 @@ struct nbt_ntlogon_sam_logon {
const char * user_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */
const char * mailslot_name;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */
uint32_t acct_control;
uint32_t sid_size;/* [value(ndr_size_dom_sid(&sid,ndr->flags))] */
DATA_BLOB _pad;/* [flag(LIBNDR_FLAG_ALIGN4)] */
struct dom_sid sid;
uint32_t sid_size;/* [value(ndr_size_dom_sid0(&sid,ndr->flags))] */
struct dom_sid0 sid;/* [subcontext_size(sid_size),subcontext(0)] */
uint32_t nt_version;
uint16_t lmnt_token;
uint16_t lm20_token;

View File

@ -2075,20 +2075,18 @@ static enum ndr_err_code ndr_push_nbt_netlogon_announce_uas(struct ndr_push *ndr
for (cntr_dbchange_0 = 0; cntr_dbchange_0 < r->db_count; cntr_dbchange_0++) {
NDR_CHECK(ndr_push_nbt_db_change(ndr, NDR_SCALARS, &r->dbchange[cntr_dbchange_0]));
}
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_dom_sid(&r->sid, ndr->flags)));
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_dom_sid0(&r->sid, ndr->flags)));
{
uint32_t _flags_save_DATA_BLOB = ndr->flags;
ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad2));
ndr->flags = _flags_save_DATA_BLOB;
struct ndr_push *_ndr_sid;
NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_sid, 0, ndr_size_dom_sid0(&r->sid, ndr->flags)));
NDR_CHECK(ndr_push_dom_sid0(_ndr_sid, NDR_SCALARS|NDR_BUFFERS, &r->sid));
NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_sid, 0, ndr_size_dom_sid0(&r->sid, ndr->flags)));
}
NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, &r->sid));
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->nt_version));
NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token));
NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token));
}
if (ndr_flags & NDR_BUFFERS) {
NDR_CHECK(ndr_push_dom_sid(ndr, NDR_BUFFERS, &r->sid));
}
return NDR_ERR_SUCCESS;
}
@ -2143,18 +2141,16 @@ static enum ndr_err_code ndr_pull_nbt_netlogon_announce_uas(struct ndr_pull *ndr
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_dbchange_0, 0);
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sid_size));
{
uint32_t _flags_save_DATA_BLOB = ndr->flags;
ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad2));
ndr->flags = _flags_save_DATA_BLOB;
struct ndr_pull *_ndr_sid;
NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_sid, 0, r->sid_size));
NDR_CHECK(ndr_pull_dom_sid0(_ndr_sid, NDR_SCALARS|NDR_BUFFERS, &r->sid));
NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_sid, 0, r->sid_size));
}
NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, &r->sid));
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->nt_version));
NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token));
NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token));
}
if (ndr_flags & NDR_BUFFERS) {
NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_BUFFERS, &r->sid));
}
return NDR_ERR_SUCCESS;
}
@ -2184,9 +2180,8 @@ _PUBLIC_ void ndr_print_nbt_netlogon_announce_uas(struct ndr_print *ndr, const c
}
}
ndr->depth--;
ndr_print_uint32(ndr, "sid_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_dom_sid(&r->sid, ndr->flags):r->sid_size);
ndr_print_DATA_BLOB(ndr, "_pad2", r->_pad2);
ndr_print_dom_sid(ndr, "sid", &r->sid);
ndr_print_uint32(ndr, "sid_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_dom_sid0(&r->sid, ndr->flags):r->sid_size);
ndr_print_dom_sid0(ndr, "sid", &r->sid);
ndr_print_uint32(ndr, "nt_version", r->nt_version);
ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token);
ndr_print_uint16(ndr, "lm20_token", r->lm20_token);
@ -3024,20 +3019,18 @@ static enum ndr_err_code ndr_push_nbt_ntlogon_sam_logon(struct ndr_push *ndr, in
ndr->flags = _flags_save_string;
}
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->acct_control));
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_dom_sid(&r->sid, ndr->flags)));
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_dom_sid0(&r->sid, ndr->flags)));
{
uint32_t _flags_save_DATA_BLOB = ndr->flags;
ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_pad));
ndr->flags = _flags_save_DATA_BLOB;
struct ndr_push *_ndr_sid;
NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_sid, 0, ndr_size_dom_sid0(&r->sid, ndr->flags)));
NDR_CHECK(ndr_push_dom_sid0(_ndr_sid, NDR_SCALARS|NDR_BUFFERS, &r->sid));
NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_sid, 0, ndr_size_dom_sid0(&r->sid, ndr->flags)));
}
NDR_CHECK(ndr_push_dom_sid(ndr, NDR_SCALARS, &r->sid));
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->nt_version));
NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lmnt_token));
NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->lm20_token));
}
if (ndr_flags & NDR_BUFFERS) {
NDR_CHECK(ndr_push_dom_sid(ndr, NDR_BUFFERS, &r->sid));
}
return NDR_ERR_SUCCESS;
}
@ -3068,18 +3061,16 @@ static enum ndr_err_code ndr_pull_nbt_ntlogon_sam_logon(struct ndr_pull *ndr, in
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->acct_control));
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sid_size));
{
uint32_t _flags_save_DATA_BLOB = ndr->flags;
ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4);
NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_pad));
ndr->flags = _flags_save_DATA_BLOB;
struct ndr_pull *_ndr_sid;
NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_sid, 0, r->sid_size));
NDR_CHECK(ndr_pull_dom_sid0(_ndr_sid, NDR_SCALARS|NDR_BUFFERS, &r->sid));
NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_sid, 0, r->sid_size));
}
NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_SCALARS, &r->sid));
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->nt_version));
NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lmnt_token));
NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->lm20_token));
}
if (ndr_flags & NDR_BUFFERS) {
NDR_CHECK(ndr_pull_dom_sid(ndr, NDR_BUFFERS, &r->sid));
}
return NDR_ERR_SUCCESS;
}
@ -3093,9 +3084,8 @@ _PUBLIC_ void ndr_print_nbt_ntlogon_sam_logon(struct ndr_print *ndr, const char
ndr_print_string(ndr, "user_name", r->user_name);
ndr_print_string(ndr, "mailslot_name", r->mailslot_name);
ndr_print_uint32(ndr, "acct_control", r->acct_control);
ndr_print_uint32(ndr, "sid_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_dom_sid(&r->sid, ndr->flags):r->sid_size);
ndr_print_DATA_BLOB(ndr, "_pad", r->_pad);
ndr_print_dom_sid(ndr, "sid", &r->sid);
ndr_print_uint32(ndr, "sid_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_dom_sid0(&r->sid, ndr->flags):r->sid_size);
ndr_print_dom_sid0(ndr, "sid", &r->sid);
ndr_print_uint32(ndr, "nt_version", r->nt_version);
ndr_print_uint16(ndr, "lmnt_token", r->lmnt_token);
ndr_print_uint16(ndr, "lm20_token", r->lm20_token);

View File

@ -5,6 +5,7 @@
#include "librpc/gen_ndr/misc.h"
#define dom_sid2 dom_sid
#define dom_sid28 dom_sid
#define dom_sid0 dom_sid
#ifndef _HEADER_security
#define _HEADER_security

View File

@ -31,6 +31,26 @@ size_t ndr_size_dom_sid(const struct dom_sid *sid, int flags)
return 8 + 4*sid->num_auths;
}
size_t ndr_size_dom_sid28(const struct dom_sid *sid, int flags)
{
struct dom_sid zero_sid;
if (!sid) return 0;
ZERO_STRUCT(zero_sid);
if (memcmp(&zero_sid, sid, sizeof(zero_sid)) == 0) {
return 0;
}
return 8 + 4*sid->num_auths;
}
size_t ndr_size_dom_sid0(const struct dom_sid *sid, int flags)
{
return ndr_size_dom_sid28(sid, flags);
}
/*
return the wire size of a security_ace
*/
@ -89,3 +109,9 @@ void ndr_print_dom_sid28(struct ndr_print *ndr, const char *name, const struct d
{
ndr_print_dom_sid(ndr, name, sid);
}
void ndr_print_dom_sid0(struct ndr_print *ndr, const char *name, const struct dom_sid *sid)
{
ndr_print_dom_sid(ndr, name, sid);
}

View File

@ -187,3 +187,44 @@ enum ndr_err_code ndr_push_dom_sid28(struct ndr_push *ndr, int ndr_flags, const
return NDR_ERR_SUCCESS;
}
/*
parse a dom_sid0 - this is a dom_sid in a variable byte buffer, which is maybe empty
*/
enum ndr_err_code ndr_pull_dom_sid0(struct ndr_pull *ndr, int ndr_flags, struct dom_sid *sid)
{
if (!(ndr_flags & NDR_SCALARS)) {
return NDR_ERR_SUCCESS;
}
if (ndr->data_size == ndr->offset) {
ZERO_STRUCTP(sid);
return NDR_ERR_SUCCESS;
}
return ndr_pull_dom_sid(ndr, ndr_flags, sid);
}
/*
push a dom_sid0 - this is a dom_sid in a variable byte buffer, which is maybe empty
*/
enum ndr_err_code ndr_push_dom_sid0(struct ndr_push *ndr, int ndr_flags, const struct dom_sid *sid)
{
struct dom_sid zero_sid;
if (!(ndr_flags & NDR_SCALARS)) {
return NDR_ERR_SUCCESS;
}
if (!sid) {
return NDR_ERR_SUCCESS;
}
ZERO_STRUCT(zero_sid);
if (memcmp(&zero_sid, sid, sizeof(zero_sid)) == 0) {
return NDR_ERR_SUCCESS;
}
return ndr_push_dom_sid(ndr, ndr_flags, sid);
}