Skip to content

Commit

Permalink
librpc/ndr Merge ndr_print_sockaddr_storage() into common code
Browse files Browse the repository at this point in the history
There is no longer a reason to leave this source3 specific, and this
brings it into a library (avoiding duplicate symbols).

Andrew Bartlett
  • Loading branch information
abartlet committed May 18, 2011
1 parent 8d7be8a commit 41b3c38
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 15 deletions.
3 changes: 3 additions & 0 deletions librpc/ndr/libndr.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*********************************************************************/
Expand All @@ -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);
Expand Down
11 changes: 6 additions & 5 deletions source3/librpc/ndr/util.c → librpc/ndr/util.c
Original file line number Diff line number Diff line change
@@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion librpc/wscript_build
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion source3/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 2 additions & 8 deletions source3/wscript_build
Original file line number Diff line number Diff line change
Expand Up @@ -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'''

Expand Down Expand Up @@ -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''',
Expand Down Expand Up @@ -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())

Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit 41b3c38

Please sign in to comment.