Accept --with-expsam=no as valid option (do nothing on it). Simplifies automatic...
[Samba/bb.git] / source3 / rpc_parse / parse_ds.c
blobab076318317206bb168671a4cdee1eb15ba32d86
1 /*
2 * Unix SMB/CIFS implementation.
3 * RPC Pipe client / server routines
4 * Copyright (C) Gerald Carter 2002
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include "includes.h"
23 static BOOL ds_io_dominfobasic( const char *desc, prs_struct *ps, int depth, DSROLE_PRIMARY_DOMAIN_INFO_BASIC **basic)
25 DSROLE_PRIMARY_DOMAIN_INFO_BASIC *p = *basic;
27 if ( UNMARSHALLING(ps) )
28 p = *basic = (DSROLE_PRIMARY_DOMAIN_INFO_BASIC *)prs_alloc_mem(ps, sizeof(DSROLE_PRIMARY_DOMAIN_INFO_BASIC));
30 if ( !p )
31 return False;
33 if ( !prs_uint16("machine_role", ps, depth, &p->machine_role) )
34 return False;
35 if ( !prs_uint16("unknown", ps, depth, &p->unknown) )
36 return False;
38 if ( !prs_uint32("flags", ps, depth, &p->flags) )
39 return False;
41 if ( !prs_uint32("netbios_ptr", ps, depth, &p->netbios_ptr) )
42 return False;
43 if ( !prs_uint32("dnsname_ptr", ps, depth, &p->dnsname_ptr) )
44 return False;
45 if ( !prs_uint32("forestname_ptr", ps, depth, &p->forestname_ptr) )
46 return False;
48 if ( !prs_uint8s(False, "domain_guid", ps, depth, p->domain_guid.info, GUID_SIZE) )
49 return False;
51 if ( !smb_io_unistr2( "netbios_domain", &p->netbios_domain, p->netbios_ptr, ps, depth) )
52 return False;
53 if ( !prs_align(ps) )
54 return False;
56 if ( !smb_io_unistr2( "dns_domain", &p->dns_domain, p->dnsname_ptr, ps, depth) )
57 return False;
58 if ( !prs_align(ps) )
59 return False;
61 if ( !smb_io_unistr2( "forest_domain", &p->forest_domain, p->forestname_ptr, ps, depth) )
62 return False;
63 if ( !prs_align(ps) )
64 return False;
67 return True;
71 BOOL ds_io_q_getprimdominfo( const char *desc, DS_Q_GETPRIMDOMINFO *q_u, prs_struct *ps, int depth)
73 prs_debug(ps, depth, desc, "ds_io_q_getprimdominfo");
74 depth++;
76 if(!prs_align(ps))
77 return False;
79 if ( !prs_uint16( "level", ps, depth, &q_u->level ) )
80 return False;
82 return True;
85 BOOL ds_io_r_getprimdominfo( const char *desc, DS_R_GETPRIMDOMINFO *r_u, prs_struct *ps, int depth)
87 prs_debug(ps, depth, desc, "ds_io_r_getprimdominfo");
88 depth++;
90 if(!prs_align(ps))
91 return False;
93 if ( !prs_uint32( "ptr", ps, depth, &r_u->ptr ) )
94 return False;
96 if ( r_u->ptr )
98 if ( !prs_uint16( "level", ps, depth, &r_u->level ) )
99 return False;
101 if ( !prs_uint16( "unknown0", ps, depth, &r_u->unknown0 ) )
102 return False;
104 switch ( r_u->level )
106 case DsRolePrimaryDomainInfoBasic:
107 if ( !ds_io_dominfobasic( "dominfobasic", ps, depth, &r_u->info.basic ) )
108 return False;
109 break;
110 default:
111 return False;
115 if ( !prs_align(ps) )
116 return False;
118 if ( !prs_ntstatus("status", ps, depth, &r_u->status ) )
119 return False;
121 return True;