1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-04 16:58:42 +03:00

r3428: switched to using minimal includes for the auto-generated RPC code.

The thing that finally convinced me that minimal includes was worth
pursuing for rpc was a compiler (tcc) that failed to build Samba due
to reaching internal limits of the size of include files. Also the
fact that includes.h.gch was 16MB, which really seems excessive. This
patch brings it back to 12M, which is still too large, but
better. Note that this patch speeds up compile times for both the pch
and non-pch case.

This change also includes the addition iof a "depends()" option in our
IDL files, allowing you to specify that one IDL file depends on
another. This capability was needed for the auto-includes generation.
(This used to be commit b8f5fa8ac8e8725f3d321004f0aedf4246fc6b49)
This commit is contained in:
Andrew Tridgell 2004-11-01 10:30:34 +00:00 committed by Gerald (Jerry) Carter
parent 668ecaa325
commit 90067934cd
69 changed files with 199 additions and 49 deletions

View File

@ -20,6 +20,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_samr.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH

View File

@ -22,6 +22,8 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_samr.h"
#include "librpc/gen_ndr/ndr_netlogon.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH

View File

@ -22,6 +22,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_netlogon.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH

View File

@ -320,6 +320,13 @@ sub HeaderInterface($)
$res .= "#ifndef _HEADER_NDR_$interface->{NAME}\n";
$res .= "#define _HEADER_NDR_$interface->{NAME}\n\n";
if (defined $interface->{PROPERTIES}->{depends}) {
my @d = split / /, $interface->{PROPERTIES}->{depends};
foreach my $i (@d) {
$res .= "#include \"librpc/gen_ndr/ndr_$i\.h\"\n";
}
}
if (defined $interface->{PROPERTIES}->{uuid}) {
my $name = uc $interface->{NAME};
$res .= "#define DCERPC_$name\_UUID " .

View File

@ -1563,11 +1563,18 @@ sub Parse($$)
{
my($idl) = shift;
my($filename) = shift;
my $h_filename = $filename;
if ($h_filename =~ /(.*)\.c/) {
$h_filename = "$1.h";
}
open(OUT, ">$filename") || die "can't open $filename";
pidl "/* parser auto-generated by pidl */\n\n";
pidl "#include \"includes.h\"\n\n";
pidl "#include \"includes.h\"\n";
pidl "#include \"$h_filename\"\n\n";
foreach my $x (@{$idl}) {
if ($x->{TYPE} eq "INTERFACE") {
needed::BuildNeeded($x);

View File

@ -42,6 +42,14 @@ if ($opt_help) {
}
###################################
# add include lines to tables.c
sub process_include($)
{
my $name = shift;
print TABLEC "#include \"$name\"\n";
}
###################################
# extract table entries from 1 file
sub process_file($)
@ -49,11 +57,10 @@ sub process_file($)
my $filename = shift;
open(FILE, $filename) || die "unable to open $filename\n";
print TABLEH "#include \"$filename\"\n";
while (my $line = <FILE>) {
if ($line =~ /extern const struct dcerpc_interface_table (\w+);/) {
print TABLEC "\t&$1,\n";
if ($line =~ /extern const struct dcerpc_interface_table dcerpc_table_(\w+);/) {
print TABLEC "\t&dcerpc_table_$1,\n";
print TABLEH "NTSTATUS dcerpc_$1\_init(void);\n";
}
}
@ -70,7 +77,14 @@ open(TABLEC, ">$opt_output.c") || die "failed to open $opt_output.c\n";
print TABLEC "
#include \"includes.h\"
";
foreach my $filename (@ARGV) {
process_include($filename);
}
print TABLEC "
/*
generated by pidl IDL table generator
*/

View File

@ -22,6 +22,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_srvsvc.h"
#include "libcli/raw/libcliraw.h"
#ifndef REGISTER

View File

@ -20,6 +20,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_samr.h"
#include "gtk-smb.h"
/* GtkSelectDomainDialog */

View File

@ -20,6 +20,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_epmapper.h"
#include "gtk/common/gtk-smb.h"
/*

View File

@ -20,6 +20,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_atsvc.h"
#include "gtk/common/gtk-smb.h"
struct dcerpc_pipe *at_pipe = NULL;

View File

@ -20,6 +20,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_samr.h"
#include "gtk/common/gtk-smb.h"
struct policy_handle sam_handle;

View File

@ -658,11 +658,12 @@ extern int errno;
#include "mutex.h"
#include "structs.h"
#include "librpc/ndr/libndr.h"
#include "librpc/ndr/ndr_sec.h"
#include "librpc/gen_ndr/ndr_misc.h"
#include "librpc/gen_ndr/ndr_dcerpc.h"
#include "librpc/rpc/dcerpc.h"
#include "librpc/ndr/ndr_sec.h"
#include "librpc/gen_ndr/tables.h"
#include "libcli/auth/ntlmssp.h"

50
source4/include/structs.h Normal file
View File

@ -0,0 +1,50 @@
/*
Unix SMB/CIFS implementation.
Copyright (C) Andrew Tridgell 2004
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
this file contains pre-declarations of private structures to avoid the
"scope is only this definition or declaration" warning
*/
union spoolss_PrinterInfo;
union spoolss_FormInfo;
union spoolss_JobInfo;
union spoolss_DriverInfo;
union spoolss_PortInfo;
struct MULTI_QI;
struct COSERVERINFO;
struct epm_floor;
struct epm_tower;
struct drsuapi_DsCrackNames;
struct samr_ChangePasswordUser;
struct samr_OemChangePasswordUser2;
struct samr_ChangePasswordUser3;
struct samr_ChangePasswordUser2;
struct samr_CryptPassword;
struct samr_CryptPasswordEx;
struct netr_SamInfo3;
struct netr_Authenticator;

View File

@ -18,6 +18,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "includes.h"
#include "librpc/gen_ndr/ndr_winreg.h"
/**
* This is the RPC backend for the registry library.

View File

@ -24,6 +24,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_krb5pac.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH

View File

@ -19,6 +19,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_samr.h"
/*
* do a password change using DCERPC/SAMR calls

View File

@ -19,6 +19,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_srvsvc.h"
/*
* get the remote time of a server via srvsvc_NetRemoteTOD

View File

@ -37,7 +37,16 @@ interface misc
const string SID_BUILTIN_BACKUP_OPERATORS = "S-1-5-32-551";
const string SID_BUILTIN_REPLICATOR = "S-1-5-32-552";
typedef [public,noprint] struct {
/* server roles */
typedef enum {
ROLE_STANDALONE = 0,
ROLE_DOMAIN_MEMBER = 1,
ROLE_DOMAIN_BDC = 2,
ROLE_DOMAIN_PDC = 3
} samr_Role;
typedef [public,noprint,gensize] struct {
uint32 time_low;
uint16 time_mid;
uint16 time_hi_and_version;
@ -123,4 +132,22 @@ interface misc
typedef [public, flag(NDR_PAHEX)] struct {
uint8 hash[16];
} samr_Password;
typedef [public,flag(NDR_PAHEX)] struct {
uint8 key[16];
} netr_UserSessionKey;
typedef [public,flag(NDR_PAHEX)] struct {
uint8 key[8];
} netr_LMSessionKey;
typedef [public, flag(NDR_PAHEX)] struct {
uint8 data[8];
} netr_Credential;
typedef [public] struct {
netr_Credential cred;
time_t timestamp;
} netr_Authenticator;
}

View File

@ -10,12 +10,18 @@
uuid("12345678-1234-abcd-ef00-01234567cffb"),
version(1.0),
endpoint("ncacn_np:[\\pipe\\netlogon]","ncacn_ip_tcp:","ncalrpc:"),
pointer_default(unique)
pointer_default(unique),
depends(lsa,samr)
]
interface netlogon
{
typedef [public] struct {
[value(strlen_m(r->string)*2)] uint16 size;
[value(r->size)] uint16 length;
unistr_noterm *string;
} netr_String;
/*****************/
/* Function 0x00 */
@ -65,16 +71,6 @@ interface netlogon
/*****************/
/* Function 0x02 */
typedef [flag(NDR_PAHEX)] struct {
uint8 data[8];
} netr_Credential;
typedef struct {
[value(strlen_m(r->string)*2)] uint16 size;
[value(r->size)] uint16 length;
unistr_noterm *string;
} netr_String;
/* in netr_AcctLockStr size seems to be be 24, and rrenard thinks
that the structure of the bindata looks like this:
@ -128,25 +124,12 @@ interface netlogon
[case(6)] netr_NetworkInfo *network;
} netr_LogonLevel;
typedef struct {
netr_Credential cred;
time_t timestamp;
} netr_Authenticator;
typedef struct {
typedef [public] struct {
uint32 rid;
uint32 attributes;
} netr_GroupMembership;
typedef [flag(NDR_PAHEX)] struct {
uint8 key[16];
} netr_UserSessionKey;
typedef [flag(NDR_PAHEX)] struct {
uint8 key[8];
} netr_LMSessionKey;
typedef struct {
typedef [public] struct {
NTTIME last_logon;
NTTIME last_logoff;
NTTIME acct_expiry;
@ -175,11 +158,11 @@ interface netlogon
uint32 unknown[7];
} netr_SamBaseInfo;
typedef struct {
typedef [public] struct {
netr_SamBaseInfo base;
} netr_SamInfo2;
typedef struct {
typedef [public] struct {
dom_sid2 *sid;
uint32 attribute;
} netr_SidAttr;

View File

@ -16,7 +16,8 @@
uuid("99fcfec4-5260-101b-bbcb-00aa0021347a"),
helpstring("Object Exporter ID Resolver"),
endpoint("ncacn_np:[\\pipe\\epmapper]", "ncacn_ip_tcp:[135]", "ncalrpc:"),
pointer_default(unique)
pointer_default(unique),
depends(dcom)
]
interface IOXIDResolver
{

View File

@ -10,7 +10,8 @@
[
uuid("4d9f4ab8-7d1c-11cf-861e-0020af6e7c57"),
pointer_default(unique)
pointer_default(unique),
depends(dcom)
]
interface IRemoteActivation
{

View File

@ -11,7 +11,8 @@
[ uuid("12345778-1234-abcd-ef00-0123456789ac"),
version(1.0),
endpoint("ncacn_np:[\\pipe\\samr]","ncacn_ip_tcp:", "ncalrpc:"),
pointer_default(unique)
pointer_default(unique),
depends(lsa)
] interface samr
{
/* account control (acct_flags) bits */
@ -126,14 +127,6 @@
/************************/
/* Function 0x08 */
/* server roles */
typedef enum {
ROLE_STANDALONE = 0,
ROLE_DOMAIN_MEMBER = 1,
ROLE_DOMAIN_BDC = 2,
ROLE_DOMAIN_PDC = 3
} samr_Role;
typedef struct {
uint16 min_password_len;
uint16 password_history;

View File

@ -4,6 +4,9 @@
schannel structures
*/
[
depends(netlogon)
]
interface schannel
{
/*

View File

@ -8,7 +8,8 @@
version(1.0),
endpoint("ncacn_np:[\\pipe\\winreg]","ncacn_ip_tcp:","ncalrpc:"),
pointer_default(unique),
helpstring("Remote Registry Service")
helpstring("Remote Registry Service"),
depends(lsa)
] interface winreg
{
typedef struct {

View File

@ -23,6 +23,7 @@
#include "includes.h"
#include "librpc/gen_ndr/ndr_spoolss.h"
NTSTATUS pull_spoolss_PrinterInfoArray(DATA_BLOB *blob, TALLOC_CTX *mem_ctx,
uint32_t level, uint32_t count,

View File

@ -21,6 +21,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_epmapper.h"
/* initialise a dcerpc pipe. */
struct dcerpc_pipe *dcerpc_pipe_init(void)

View File

@ -21,6 +21,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_schannel.h"
enum schannel_position {
DCERPC_SCHANNEL_STATE_START = 0,

View File

@ -22,6 +22,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_epmapper.h"
#define MIN_HDR_SIZE 16

View File

@ -22,7 +22,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_epmapper.h"
/*
find the pipe name for a local IDL interface

View File

@ -53,6 +53,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_svcctl.h"
BOOL in_client = False; /* Not in the client by default */
static BOOL bLoaded = False;

View File

@ -22,6 +22,9 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_epmapper.h"
#include "librpc/gen_ndr/ndr_dcom.h"
#include "librpc/gen_ndr/ndr_oxidresolver.h"
/*
see if two endpoints match

View File

@ -21,6 +21,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_oxidresolver.h"
/*

View File

@ -21,6 +21,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_drsuapi.h"
#include "rpc_server/common/common.h"
#include "rpc_server/drsuapi/dcesrv_drsuapi.h"

View File

@ -22,6 +22,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_drsuapi.h"
#include "rpc_server/common/common.h"
#include "rpc_server/drsuapi/dcesrv_drsuapi.h"

View File

@ -21,6 +21,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_echo.h"
static NTSTATUS echo_AddOne(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_AddOne *r)

View File

@ -22,6 +22,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_epmapper.h"
#include "rpc_server/common/common.h"
typedef uint32_t error_status_t;

View File

@ -21,6 +21,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_lsa.h"
#include "rpc_server/common/common.h"
/*

View File

@ -21,6 +21,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_netlogon.h"
#include "rpc_server/common/common.h"
struct server_pipe_state {

View File

@ -21,6 +21,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_samr.h"
#include "rpc_server/common/common.h"
#include "rpc_server/samr/dcesrv_samr.h"

View File

@ -21,6 +21,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_samr.h"
#include "rpc_server/common/common.h"
#include "rpc_server/samr/dcesrv_samr.h"

View File

@ -21,6 +21,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_samr.h"
/*
translated the ACB_CTRL Flags to UserFlags (userAccountControl)

View File

@ -21,6 +21,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_spoolss.h"
#include "rpc_server/common/common.h"
#include "rpc_server/spoolss/dcesrv_spoolss.h"

View File

@ -21,6 +21,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_srvsvc.h"
#include "rpc_server/common/common.h"
/*

View File

@ -21,6 +21,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_winreg.h"
#include "rpc_server/common/common.h"
enum handle_types { HTYPE_REGVAL, HTYPE_REGKEY };

View File

@ -21,6 +21,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_wkssvc.h"
#include "rpc_server/common/common.h"
/*

View File

@ -21,6 +21,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_epmapper.h"
static BOOL test_BindingString(TALLOC_CTX *mem_ctx, const char *binding)
{

View File

@ -20,6 +20,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_atsvc.h"
static BOOL test_JobGetInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, uint32_t job_id)
{

View File

@ -21,6 +21,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_drsuapi.h"
#if 1

View File

@ -22,6 +22,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_lsa.h"
/*
This test is 'bogus' in that it doesn't actually perform to the

View File

@ -20,6 +20,8 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_dcom.h"
#include "librpc/gen_ndr/ndr_oxidresolver.h"
BOOL torture_rpc_dcom(void)
{

View File

@ -20,6 +20,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_dfs.h"
static BOOL test_GetManagerVersion(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)

View File

@ -22,6 +22,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_drsuapi.h"
static BOOL test_DsBind(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct policy_handle *bind_handle)

View File

@ -20,6 +20,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_echo.h"
/*

View File

@ -20,6 +20,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_epmapper.h"
/*

View File

@ -21,6 +21,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_eventlog.h"
static void init_eventlog_String(struct eventlog_String *name, const char *s)
{

View File

@ -20,6 +20,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_lsa.h"
static void init_lsa_Name(struct lsa_Name *name, const char *s)
{

View File

@ -20,6 +20,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_mgmt.h"
/*

View File

@ -23,6 +23,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_netlogon.h"
static const char *machine_password;

View File

@ -20,6 +20,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_oxidresolver.h"
static int test_SimplePing(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, HYPER_T setid)
{

View File

@ -20,6 +20,8 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_remact.h"
#include "librpc/gen_ndr/ndr_epmapper.h"
#define CLSID_TEST "00000316-0000-0000-C000-000000000046"
#define CLSID_SIMPLE "5e9ddec7-5767-11cf-beab-00aa006c3606"

View File

@ -21,6 +21,8 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_lsa.h"
#include "librpc/gen_ndr/ndr_samr.h"
#define TEST_ACCOUNT_NAME "samrtorturetest"
#define TEST_ALIASNAME "samrtorturetestalias"

View File

@ -21,6 +21,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_mgmt.h"
/*
work out how many calls there are for an interface

View File

@ -21,6 +21,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_samr.h"
#define TEST_MACHINE_NAME "schanneltest"

View File

@ -20,6 +20,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_spoolss.h"
static BOOL test_GetPrinter(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct policy_handle *handle)

View File

@ -20,6 +20,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_srvsvc.h"
/**************************/
/* srvsvc_NetCharDev */

View File

@ -20,6 +20,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_svcctl.h"
static BOOL test_EnumServicesStatus(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *h)
{

View File

@ -26,6 +26,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_samr.h"
struct test_join {
struct dcerpc_pipe *p;

View File

@ -21,6 +21,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_winreg.h"
static void init_winreg_String(struct winreg_String *name, const char *s)
{

View File

@ -20,6 +20,7 @@
*/
#include "includes.h"
#include "librpc/gen_ndr/ndr_wkssvc.h"
static BOOL test_NetWkstaGetInfo(struct dcerpc_pipe *p,