2000-07-03 08:26:37 +04:00
/*
2002-01-30 09:08:46 +03:00
Unix SMB / CIFS implementation .
2000-07-03 08:26:37 +04:00
SMB parameters and setup
2005-03-24 21:05:31 +03:00
Copyright ( C ) Gerald ( Jerry ) Carter 2005.
2000-07-03 08:26:37 +04:00
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
2007-07-09 23:25:36 +04:00
the Free Software Foundation ; either version 3 of the License , or
2000-07-03 08:26:37 +04:00
( 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
2007-07-10 04:52:41 +04:00
along with this program . If not , see < http : //www.gnu.org/licenses/>.
2000-07-03 08:26:37 +04:00
*/
# ifndef _RPC_CLIENT_H
# define _RPC_CLIENT_H
2006-09-11 23:33:27 +04:00
/* autogenerated client stubs */
2006-09-16 02:49:27 +04:00
# include "librpc/gen_ndr/cli_echo.h"
2006-09-11 23:33:27 +04:00
# include "librpc/gen_ndr/cli_lsa.h"
2006-09-22 03:57:32 +04:00
# include "librpc/gen_ndr/cli_svcctl.h"
2006-09-20 20:46:55 +04:00
# include "librpc/gen_ndr/cli_wkssvc.h"
2007-10-11 00:34:30 +04:00
# include "librpc/gen_ndr/cli_eventlog.h"
# include "librpc/gen_ndr/cli_dfs.h"
# include "librpc/gen_ndr/cli_initshutdown.h"
# include "librpc/gen_ndr/cli_winreg.h"
# include "librpc/gen_ndr/cli_srvsvc.h"
2008-01-17 12:35:55 +03:00
# include "librpc/gen_ndr/cli_samr.h"
# include "librpc/gen_ndr/cli_netlogon.h"
2008-01-25 15:26:10 +03:00
# include "librpc/gen_ndr/cli_dssetup.h"
2008-02-17 22:25:05 +03:00
# include "librpc/gen_ndr/cli_ntsvcs.h"
2008-04-25 00:45:28 +04:00
# include "librpc/gen_ndr/cli_epmapper.h"
2008-05-24 01:56:21 +04:00
# include "librpc/gen_ndr/cli_drsuapi.h"
2006-09-11 23:33:27 +04:00
2008-03-15 01:26:28 +03:00
# define prs_init_empty( _ps_, _ctx_, _io_ ) (void) prs_init((_ps_), 0, (_ctx_), (_io_))
2005-06-09 02:10:34 +04:00
/* macro to expand cookie-cutter code in cli_xxx() using rpc_api_pipe_req() */
2005-09-30 21:13:37 +04:00
2008-07-21 14:50:32 +04:00
# define CLI_DO_RPC_WERR( pcli, ctx, interface, opnum, q_in, r_out, \
2005-06-09 02:10:34 +04:00
q_ps , r_ps , q_io_fn , r_io_fn , default_error ) \
2005-09-30 21:13:37 +04:00
{ \
2008-07-21 14:50:32 +04:00
SMB_ASSERT ( ndr_syntax_id_equal ( & pcli - > abstract_syntax , interface ) ) ; \
2005-09-30 21:13:37 +04:00
if ( ! prs_init ( & q_ps , RPC_MAX_PDU_FRAG_LEN , ctx , MARSHALL ) ) { \
return WERR_NOMEM ; \
} \
2008-03-15 01:26:28 +03:00
prs_init_empty ( & r_ps , ctx , UNMARSHALL ) ; \
2005-06-09 02:10:34 +04:00
if ( q_io_fn ( " " , & q_in , & q_ps , 0 ) ) { \
2005-09-30 21:13:37 +04:00
NTSTATUS _smb_pipe_stat_ = rpc_api_pipe_req ( pcli , opnum , & q_ps , & r_ps ) ; \
if ( ! NT_STATUS_IS_OK ( _smb_pipe_stat_ ) ) { \
prs_mem_free ( & q_ps ) ; \
prs_mem_free ( & r_ps ) ; \
return ntstatus_to_werror ( _smb_pipe_stat_ ) ; \
} \
if ( ! r_io_fn ( " " , & r_out , & r_ps , 0 ) ) { \
prs_mem_free ( & q_ps ) ; \
prs_mem_free ( & r_ps ) ; \
return default_error ; \
2005-06-09 02:10:34 +04:00
} \
2005-09-30 21:13:37 +04:00
} else { \
prs_mem_free ( & q_ps ) ; \
prs_mem_free ( & r_ps ) ; \
return default_error ; \
2005-06-09 02:10:34 +04:00
} \
prs_mem_free ( & q_ps ) ; \
prs_mem_free ( & r_ps ) ; \
}
2000-07-03 08:26:37 +04:00
# endif /* _RPC_CLIENT_H */