librpc/ndr Merge ndr_print_sockaddr_storage() into common code
authorAndrew Bartlett <abartlet@samba.org>
Mon, 16 May 2011 11:18:25 +0000 (21:18 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 18 May 2011 14:12:08 +0000 (16:12 +0200)
There is no longer a reason to leave this source3 specific, and this
brings it into a library (avoiding duplicate symbols).

Andrew Bartlett

librpc/ndr/libndr.h
librpc/ndr/util.c [moved from source3/librpc/ndr/util.c with 94% similarity]
librpc/wscript_build
source3/Makefile.in
source3/wscript_build

index 8c59bb9bb0693fc5ea60da924a91459cdc5a1cce..cbe9b40440e33e3979a2dc6f5271fbcdda592d03 100644 (file)
@@ -374,6 +374,8 @@ struct ndr_interface_list {
        const struct ndr_interface_table *table;
 };
 
+struct sockaddr_storage;
+
 /*********************************************************************
  Map an NT error code from a NDR error code.
 *********************************************************************/
@@ -395,6 +397,7 @@ enum ndr_err_code ndr_pull_dom_sid0(struct ndr_pull *ndr, int ndr_flags, struct
 void ndr_print_dom_sid0(struct ndr_print *ndr, const char *name, const struct dom_sid *sid);
 size_t ndr_size_dom_sid0(const struct dom_sid *sid, int flags);
 void ndr_print_GUID(struct ndr_print *ndr, const char *name, const struct GUID *guid);
+void ndr_print_sockaddr_storage(struct ndr_print *ndr, const char *name, const struct sockaddr_storage *ss);
 bool ndr_syntax_id_equal(const struct ndr_syntax_id *i1, const struct ndr_syntax_id *i2); 
 enum ndr_err_code ndr_push_struct_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, const void *p, ndr_push_flags_fn_t fn);
 enum ndr_err_code ndr_push_union_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p, uint32_t level, ndr_push_flags_fn_t fn);
similarity index 94%
rename from source3/librpc/ndr/util.c
rename to librpc/ndr/util.c
index 6bbe0549590d60986e0cfe809edc3fe3b89f81b8..b2df28dde09e31b8d6a2864cdc1f3be3633ddf27 100644 (file)
@@ -1,27 +1,28 @@
-/* 
+/*
    Unix SMB/CIFS implementation.
 
    libndr interface
 
    Copyright (C) Andrew Tridgell 2003
-   
+
    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 3 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, see <http://www.gnu.org/licenses/>.
 */
 
 #include "includes.h"
 #include "../librpc/ndr/libndr.h"
-#include "librpc/ndr/util.h"
+#include "system/network.h"
+#include "lib/util/util_net.h"
 
 _PUBLIC_ void ndr_print_sockaddr_storage(struct ndr_print *ndr, const char *name, const struct sockaddr_storage *ss)
 {
index 02600084bacd72ceb3d4f2060bce8236fa7fea65..d8b3fe78ff56616d0f4156ebd5ccd951156d55e2 100644 (file)
@@ -565,7 +565,7 @@ bld.SAMBA_LIBRARY('dcerpc-samba',
                   )
 
 bld.SAMBA_LIBRARY('ndr',
-       source='ndr/ndr_string.c ndr/ndr_basic.c ndr/uuid.c ndr/ndr.c ndr/ndr_misc.c gen_ndr/ndr_misc.c',
+       source='ndr/ndr_string.c ndr/ndr_basic.c ndr/uuid.c ndr/ndr.c ndr/ndr_misc.c gen_ndr/ndr_misc.c ndr/util.c',
        pc_files='ndr.pc',
        public_deps='errors talloc samba-util',
        public_headers='gen_ndr/misc.h gen_ndr/ndr_misc.h ndr/libndr.h:ndr.h',
index 84bfd9aa39baf02df89b30ccece17ef12af4a813..847f811e8976482b581c35dd43d4837787568571 100644 (file)
@@ -322,7 +322,7 @@ LIBNDR_OBJ = ../librpc/ndr/ndr_basic.o \
             ../librpc/ndr/ndr_sec_helper.o \
             ../librpc/ndr/ndr_string.o \
             ../librpc/ndr/uuid.o \
-            librpc/ndr/util.o \
+            ../librpc/ndr/util.o \
             librpc/gen_ndr/ndr_server_id.o \
             librpc/gen_ndr/ndr_dcerpc.o
 
index 6d644fa8ad86b1552ddd2d4d5818bc8e3e15f031..3e8b2b278fe7ca896483be8be1315c41089d84f3 100755 (executable)
@@ -39,8 +39,6 @@ COMPRESSION_SRC = '../lib/compression/mszip.c'
 
 DRSUAPI_SRC = '''${COMPRESSION_SRC}'''
 
-LIBNDR_SRC = '''librpc/ndr/util.c'''
-
 LIBCLI_SPOOLSS_SRC = '''rpc_client/cli_spoolss.c
                      rpc_client/init_spoolss.c'''
 
@@ -699,7 +697,7 @@ bld.SAMBA3_LIBRARY('nss_wins',
 
 bld.SAMBA3_LIBRARY('msrpc3',
                    source='${LIBMSRPC_SRC}',
-                   deps='''ndr ndr-util ndr-standard
+                   deps='''ndr ndr-standard
                     RPC_NDR_EPMAPPER NTLMSSP_COMMON COMMON_SCHANNEL LIBCLI_AUTH
                     LIBTSOCKET KRB5_WRAP rpccommon
                     LIBSMB''',
@@ -786,7 +784,7 @@ bld.SAMBA3_SUBSYSTEM('KRBCLIENT',
 
 bld.SAMBA3_LIBRARY('samba3core',
                    source=LIB_SRC,
-                   deps='LIBCRYPTO ndr ndr-util security NDR_SECURITY samba-util NDR_MESSAGING LIBASYNC_REQ tdb-wrap3 UTIL_TDB UTIL_PW SAMBA_VERSION KRB5_WRAP flag_mapping util_reg passdb PTHREADPOOL interfaces',
+                   deps='LIBCRYPTO ndr security NDR_SECURITY samba-util NDR_MESSAGING LIBASYNC_REQ tdb-wrap3 UTIL_TDB UTIL_PW SAMBA_VERSION KRB5_WRAP flag_mapping util_reg passdb PTHREADPOOL interfaces',
                    private_library=True,
                    vars=locals())
 
@@ -966,10 +964,6 @@ bld.SAMBA3_SUBSYSTEM('DCUTIL',
                      deps='ads',
                     vars=locals())
 
-bld.SAMBA3_SUBSYSTEM('ndr-util',
-                    source=LIBNDR_SRC,
-                    vars=locals())
-
 bld.SAMBA3_SUBSYSTEM('tdb-wrap3',
                     source='lib/util_tdb.c',
                      deps='tdb-wrap',