From e08c324fc5ed9d7d4970fc7a7b6b13bff38ace59 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 4 Sep 2010 11:00:31 +0200 Subject: s3:libsmb: add tstream_is_cli_np() metze --- source3/libsmb/cli_np_tstream.c | 13 +++++++++++++ source3/libsmb/cli_np_tstream.h | 2 ++ 2 files changed, 15 insertions(+) (limited to 'source3/libsmb') diff --git a/source3/libsmb/cli_np_tstream.c b/source3/libsmb/cli_np_tstream.c index 814dba8c8f..aa5806bba8 100644 --- a/source3/libsmb/cli_np_tstream.c +++ b/source3/libsmb/cli_np_tstream.c @@ -191,6 +191,19 @@ static ssize_t tstream_cli_np_pending_bytes(struct tstream_context *stream) return cli_nps->read.left; } +bool tstream_is_cli_np(struct tstream_context *stream) +{ + struct tstream_cli_np *cli_nps = + talloc_get_type(_tstream_context_data(stream), + struct tstream_cli_np); + + if (!cli_nps) { + return false; + } + + return true; +} + struct tstream_cli_np_writev_state { struct tstream_context *stream; struct tevent_context *ev; diff --git a/source3/libsmb/cli_np_tstream.h b/source3/libsmb/cli_np_tstream.h index 4808db6390..c6f5231f81 100644 --- a/source3/libsmb/cli_np_tstream.h +++ b/source3/libsmb/cli_np_tstream.h @@ -44,4 +44,6 @@ NTSTATUS _tstream_cli_np_existing(TALLOC_CTX *mem_ctx, #define tstream_cli_np_existing(mem_ctx, cli, npipe, stream) \ _tstream_cli_np_existing(mem_ctx, cli, npipe, stream, __location__) +bool tstream_is_cli_np(struct tstream_context *stream); + #endif /* _CLI_NP_TSTREAM_H_ */ -- cgit