From fe15b46d61ee50f4225458faf963c818cde3e283 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 15 Oct 2004 09:22:21 +0000 Subject: r2990: Add support to pidl for autogenerating ndr_size_*() functions. Adding the [gensize] property to a struct or union will make pidl generate a ndr_size_*() function. (not all nasty bits of NDR are completely covered yet by the ndr_size*() functions, support for those will be added when necessary) I also have a local patch (not applied now) that simplifies the pidl output and eliminates the number of functions required. It would, however, make pidl more complex. (This used to be commit 7c823f886afd0c4c6ee838f17882ca0658417011) --- source4/librpc/rpc/dcerpc_util.c | 52 ---------------------------------------- 1 file changed, 52 deletions(-) (limited to 'source4/librpc/rpc') diff --git a/source4/librpc/rpc/dcerpc_util.c b/source4/librpc/rpc/dcerpc_util.c index fad8417c3f..5f3d911d15 100644 --- a/source4/librpc/rpc/dcerpc_util.c +++ b/source4/librpc/rpc/dcerpc_util.c @@ -22,58 +22,6 @@ #include "includes.h" -/* - this ndr_size_* stuff should really be auto-generated .... -*/ - -static size_t ndr_size_epm_floor(struct epm_floor *fl) -{ - size_t ret = 5; - if (fl->lhs.protocol == EPM_PROTOCOL_UUID) { - ret += 18; - } else { - ret += fl->lhs.info.lhs_data.length; - } - switch (fl->lhs.protocol) { - case EPM_PROTOCOL_TCP: - case EPM_PROTOCOL_UDP: - case EPM_PROTOCOL_HTTP: - case EPM_PROTOCOL_UUID: - ret += 2; - break; - case EPM_PROTOCOL_IP: - ret += 4; - break; - case EPM_PROTOCOL_NCADG: - case EPM_PROTOCOL_NCACN: - case EPM_PROTOCOL_NCALRPC: - ret += 2; - break; - - case EPM_PROTOCOL_SMB: - ret += strlen(fl->rhs.smb.unc)+1; - break; - case EPM_PROTOCOL_PIPE: - ret += strlen(fl->rhs.pipe.path)+1; - break; - case EPM_PROTOCOL_NETBIOS: - ret += strlen(fl->rhs.netbios.name)+1; - break; - } - - return ret; -} - -size_t ndr_size_epm_towers(struct epm_towers *towers) -{ - size_t ret = 2; - int i; - for (i=0;inum_floors;i++) { - ret += ndr_size_epm_floor(&towers->floors[i]); - } - return ret; -} - /* work out what TCP port to use for a given interface on a given host */ -- cgit