2007-04-03 16:28:40 +04:00
/*
* Unix SMB / CIFS implementation .
* server auto - generated by pidl . DO NOT MODIFY !
*/
# include "includes.h"
# include "librpc/gen_ndr/srv_epmapper.h"
2007-10-19 04:40:25 +04:00
static bool api_epm_Insert ( pipes_struct * p )
2007-04-03 16:28:40 +04:00
{
2007-08-21 18:06:46 +04:00
const struct ndr_interface_call * call ;
2007-04-03 16:28:40 +04:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 16:38:47 +03:00
enum ndr_err_code ndr_err ;
2007-04-03 16:28:40 +04:00
DATA_BLOB blob ;
2007-08-21 18:06:46 +04:00
struct epm_Insert * r ;
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
call = & ndr_table_epmapper . calls [ NDR_EPM_INSERT ] ;
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
r = talloc ( NULL , struct epm_Insert ) ;
if ( r = = NULL ) {
2008-01-09 14:28:44 +03:00
return false ;
2007-08-21 18:06:46 +04:00
}
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
pull = ndr_pull_init_blob ( & blob , r ) ;
2007-04-03 16:28:40 +04:00
if ( pull = = NULL ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-04-03 16:28:40 +04:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 16:38:47 +03:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 18:06:46 +04:00
NDR_PRINT_IN_DEBUG ( epm_Insert , r ) ;
2008-01-09 14:28:44 +03:00
}
2007-08-21 18:06:46 +04:00
r - > out . result = _epm_Insert ( p , r ) ;
2008-01-09 14:28:44 +03:00
2007-04-03 16:28:40 +04:00
if ( p - > rng_fault_state ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 18:06:46 +04:00
NDR_PRINT_OUT_DEBUG ( epm_Insert , r ) ;
2008-01-09 14:28:44 +03:00
}
2007-08-21 18:06:46 +04:00
push = ndr_push_init_ctx ( r ) ;
2007-04-03 16:28:40 +04:00
if ( push = = NULL ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-11-09 16:38:47 +03:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-04-03 16:28:40 +04:00
blob = ndr_push_blob ( push ) ;
2008-01-09 14:28:44 +03:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return true ;
2007-04-03 16:28:40 +04:00
}
2007-10-19 04:40:25 +04:00
static bool api_epm_Delete ( pipes_struct * p )
2007-04-03 16:28:40 +04:00
{
2007-08-21 18:06:46 +04:00
const struct ndr_interface_call * call ;
2007-04-03 16:28:40 +04:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 16:38:47 +03:00
enum ndr_err_code ndr_err ;
2007-04-03 16:28:40 +04:00
DATA_BLOB blob ;
2007-08-21 18:06:46 +04:00
struct epm_Delete * r ;
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
call = & ndr_table_epmapper . calls [ NDR_EPM_DELETE ] ;
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
r = talloc ( NULL , struct epm_Delete ) ;
if ( r = = NULL ) {
2008-01-09 14:28:44 +03:00
return false ;
2007-08-21 18:06:46 +04:00
}
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
pull = ndr_pull_init_blob ( & blob , r ) ;
2007-04-03 16:28:40 +04:00
if ( pull = = NULL ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-04-03 16:28:40 +04:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 16:38:47 +03:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 18:06:46 +04:00
NDR_PRINT_IN_DEBUG ( epm_Delete , r ) ;
2008-01-09 14:28:44 +03:00
}
2007-08-21 18:06:46 +04:00
r - > out . result = _epm_Delete ( p , r ) ;
2008-01-09 14:28:44 +03:00
2007-04-03 16:28:40 +04:00
if ( p - > rng_fault_state ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 18:06:46 +04:00
NDR_PRINT_OUT_DEBUG ( epm_Delete , r ) ;
2008-01-09 14:28:44 +03:00
}
2007-08-21 18:06:46 +04:00
push = ndr_push_init_ctx ( r ) ;
2007-04-03 16:28:40 +04:00
if ( push = = NULL ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-11-09 16:38:47 +03:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-04-03 16:28:40 +04:00
blob = ndr_push_blob ( push ) ;
2008-01-09 14:28:44 +03:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return true ;
2007-04-03 16:28:40 +04:00
}
2007-10-19 04:40:25 +04:00
static bool api_epm_Lookup ( pipes_struct * p )
2007-04-03 16:28:40 +04:00
{
2007-08-21 18:06:46 +04:00
const struct ndr_interface_call * call ;
2007-04-03 16:28:40 +04:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 16:38:47 +03:00
enum ndr_err_code ndr_err ;
2007-04-03 16:28:40 +04:00
DATA_BLOB blob ;
2007-08-21 18:06:46 +04:00
struct epm_Lookup * r ;
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
call = & ndr_table_epmapper . calls [ NDR_EPM_LOOKUP ] ;
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
r = talloc ( NULL , struct epm_Lookup ) ;
if ( r = = NULL ) {
2008-01-09 14:28:44 +03:00
return false ;
2007-08-21 18:06:46 +04:00
}
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
pull = ndr_pull_init_blob ( & blob , r ) ;
2007-04-03 16:28:40 +04:00
if ( pull = = NULL ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-04-03 16:28:40 +04:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 16:38:47 +03:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 18:06:46 +04:00
NDR_PRINT_IN_DEBUG ( epm_Lookup , r ) ;
2008-01-09 14:28:44 +03:00
}
2007-08-21 18:06:46 +04:00
ZERO_STRUCT ( r - > out ) ;
r - > out . entry_handle = r - > in . entry_handle ;
r - > out . num_ents = talloc_zero ( r , uint32_t ) ;
if ( r - > out . num_ents = = NULL ) {
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
r - > out . entries = talloc_zero_array ( r , struct epm_entry_t , r - > in . max_ents ) ;
if ( r - > out . entries = = NULL ) {
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
r - > out . result = _epm_Lookup ( p , r ) ;
2008-01-09 14:28:44 +03:00
2007-04-03 16:28:40 +04:00
if ( p - > rng_fault_state ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 18:06:46 +04:00
NDR_PRINT_OUT_DEBUG ( epm_Lookup , r ) ;
2008-01-09 14:28:44 +03:00
}
2007-08-21 18:06:46 +04:00
push = ndr_push_init_ctx ( r ) ;
2007-04-03 16:28:40 +04:00
if ( push = = NULL ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-11-09 16:38:47 +03:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-04-03 16:28:40 +04:00
blob = ndr_push_blob ( push ) ;
2008-01-09 14:28:44 +03:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return true ;
2007-04-03 16:28:40 +04:00
}
2007-10-19 04:40:25 +04:00
static bool api_epm_Map ( pipes_struct * p )
2007-04-03 16:28:40 +04:00
{
2007-08-21 18:06:46 +04:00
const struct ndr_interface_call * call ;
2007-04-03 16:28:40 +04:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 16:38:47 +03:00
enum ndr_err_code ndr_err ;
2007-04-03 16:28:40 +04:00
DATA_BLOB blob ;
2007-08-21 18:06:46 +04:00
struct epm_Map * r ;
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
call = & ndr_table_epmapper . calls [ NDR_EPM_MAP ] ;
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
r = talloc ( NULL , struct epm_Map ) ;
if ( r = = NULL ) {
2008-01-09 14:28:44 +03:00
return false ;
2007-08-21 18:06:46 +04:00
}
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
pull = ndr_pull_init_blob ( & blob , r ) ;
2007-04-03 16:28:40 +04:00
if ( pull = = NULL ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-04-03 16:28:40 +04:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 16:38:47 +03:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 18:06:46 +04:00
NDR_PRINT_IN_DEBUG ( epm_Map , r ) ;
2008-01-09 14:28:44 +03:00
}
2007-08-21 18:06:46 +04:00
ZERO_STRUCT ( r - > out ) ;
r - > out . entry_handle = r - > in . entry_handle ;
r - > out . num_towers = talloc_zero ( r , uint32_t ) ;
if ( r - > out . num_towers = = NULL ) {
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
r - > out . towers = talloc_zero_array ( r , struct epm_twr_p_t , r - > in . max_towers ) ;
if ( r - > out . towers = = NULL ) {
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
r - > out . result = _epm_Map ( p , r ) ;
2008-01-09 14:28:44 +03:00
2007-04-03 16:28:40 +04:00
if ( p - > rng_fault_state ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 18:06:46 +04:00
NDR_PRINT_OUT_DEBUG ( epm_Map , r ) ;
2008-01-09 14:28:44 +03:00
}
2007-08-21 18:06:46 +04:00
push = ndr_push_init_ctx ( r ) ;
2007-04-03 16:28:40 +04:00
if ( push = = NULL ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-11-09 16:38:47 +03:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-04-03 16:28:40 +04:00
blob = ndr_push_blob ( push ) ;
2008-01-09 14:28:44 +03:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return true ;
2007-04-03 16:28:40 +04:00
}
2007-10-19 04:40:25 +04:00
static bool api_epm_LookupHandleFree ( pipes_struct * p )
2007-04-03 16:28:40 +04:00
{
2007-08-21 18:06:46 +04:00
const struct ndr_interface_call * call ;
2007-04-03 16:28:40 +04:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 16:38:47 +03:00
enum ndr_err_code ndr_err ;
2007-04-03 16:28:40 +04:00
DATA_BLOB blob ;
2007-08-21 18:06:46 +04:00
struct epm_LookupHandleFree * r ;
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
call = & ndr_table_epmapper . calls [ NDR_EPM_LOOKUPHANDLEFREE ] ;
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
r = talloc ( NULL , struct epm_LookupHandleFree ) ;
if ( r = = NULL ) {
2008-01-09 14:28:44 +03:00
return false ;
2007-08-21 18:06:46 +04:00
}
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
pull = ndr_pull_init_blob ( & blob , r ) ;
2007-04-03 16:28:40 +04:00
if ( pull = = NULL ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-04-03 16:28:40 +04:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 16:38:47 +03:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 18:06:46 +04:00
NDR_PRINT_IN_DEBUG ( epm_LookupHandleFree , r ) ;
2008-01-09 14:28:44 +03:00
}
2007-08-21 18:06:46 +04:00
ZERO_STRUCT ( r - > out ) ;
r - > out . entry_handle = r - > in . entry_handle ;
r - > out . result = _epm_LookupHandleFree ( p , r ) ;
2008-01-09 14:28:44 +03:00
2007-04-03 16:28:40 +04:00
if ( p - > rng_fault_state ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 18:06:46 +04:00
NDR_PRINT_OUT_DEBUG ( epm_LookupHandleFree , r ) ;
2008-01-09 14:28:44 +03:00
}
2007-08-21 18:06:46 +04:00
push = ndr_push_init_ctx ( r ) ;
2007-04-03 16:28:40 +04:00
if ( push = = NULL ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-11-09 16:38:47 +03:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-04-03 16:28:40 +04:00
blob = ndr_push_blob ( push ) ;
2008-01-09 14:28:44 +03:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return true ;
2007-04-03 16:28:40 +04:00
}
2007-10-19 04:40:25 +04:00
static bool api_epm_InqObject ( pipes_struct * p )
2007-04-03 16:28:40 +04:00
{
2007-08-21 18:06:46 +04:00
const struct ndr_interface_call * call ;
2007-04-03 16:28:40 +04:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 16:38:47 +03:00
enum ndr_err_code ndr_err ;
2007-04-03 16:28:40 +04:00
DATA_BLOB blob ;
2007-08-21 18:06:46 +04:00
struct epm_InqObject * r ;
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
call = & ndr_table_epmapper . calls [ NDR_EPM_INQOBJECT ] ;
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
r = talloc ( NULL , struct epm_InqObject ) ;
if ( r = = NULL ) {
2008-01-09 14:28:44 +03:00
return false ;
2007-08-21 18:06:46 +04:00
}
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
pull = ndr_pull_init_blob ( & blob , r ) ;
2007-04-03 16:28:40 +04:00
if ( pull = = NULL ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-04-03 16:28:40 +04:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 16:38:47 +03:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 18:06:46 +04:00
NDR_PRINT_IN_DEBUG ( epm_InqObject , r ) ;
2008-01-09 14:28:44 +03:00
}
2007-08-21 18:06:46 +04:00
r - > out . result = _epm_InqObject ( p , r ) ;
2008-01-09 14:28:44 +03:00
2007-04-03 16:28:40 +04:00
if ( p - > rng_fault_state ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 18:06:46 +04:00
NDR_PRINT_OUT_DEBUG ( epm_InqObject , r ) ;
2008-01-09 14:28:44 +03:00
}
2007-08-21 18:06:46 +04:00
push = ndr_push_init_ctx ( r ) ;
2007-04-03 16:28:40 +04:00
if ( push = = NULL ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-11-09 16:38:47 +03:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-04-03 16:28:40 +04:00
blob = ndr_push_blob ( push ) ;
2008-01-09 14:28:44 +03:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return true ;
2007-04-03 16:28:40 +04:00
}
2007-10-19 04:40:25 +04:00
static bool api_epm_MgmtDelete ( pipes_struct * p )
2007-04-03 16:28:40 +04:00
{
2007-08-21 18:06:46 +04:00
const struct ndr_interface_call * call ;
2007-04-03 16:28:40 +04:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 16:38:47 +03:00
enum ndr_err_code ndr_err ;
2007-04-03 16:28:40 +04:00
DATA_BLOB blob ;
2007-08-21 18:06:46 +04:00
struct epm_MgmtDelete * r ;
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
call = & ndr_table_epmapper . calls [ NDR_EPM_MGMTDELETE ] ;
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
r = talloc ( NULL , struct epm_MgmtDelete ) ;
if ( r = = NULL ) {
2008-01-09 14:28:44 +03:00
return false ;
2007-08-21 18:06:46 +04:00
}
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
pull = ndr_pull_init_blob ( & blob , r ) ;
2007-04-03 16:28:40 +04:00
if ( pull = = NULL ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-04-03 16:28:40 +04:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 16:38:47 +03:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 18:06:46 +04:00
NDR_PRINT_IN_DEBUG ( epm_MgmtDelete , r ) ;
2008-01-09 14:28:44 +03:00
}
2007-08-21 18:06:46 +04:00
r - > out . result = _epm_MgmtDelete ( p , r ) ;
2008-01-09 14:28:44 +03:00
2007-04-03 16:28:40 +04:00
if ( p - > rng_fault_state ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 18:06:46 +04:00
NDR_PRINT_OUT_DEBUG ( epm_MgmtDelete , r ) ;
2008-01-09 14:28:44 +03:00
}
2007-08-21 18:06:46 +04:00
push = ndr_push_init_ctx ( r ) ;
2007-04-03 16:28:40 +04:00
if ( push = = NULL ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-11-09 16:38:47 +03:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-04-03 16:28:40 +04:00
blob = ndr_push_blob ( push ) ;
2008-01-09 14:28:44 +03:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return true ;
2007-04-03 16:28:40 +04:00
}
2007-10-19 04:40:25 +04:00
static bool api_epm_MapAuth ( pipes_struct * p )
2007-04-03 16:28:40 +04:00
{
2007-08-21 18:06:46 +04:00
const struct ndr_interface_call * call ;
2007-04-03 16:28:40 +04:00
struct ndr_pull * pull ;
struct ndr_push * push ;
2007-11-09 16:38:47 +03:00
enum ndr_err_code ndr_err ;
2007-04-03 16:28:40 +04:00
DATA_BLOB blob ;
2007-08-21 18:06:46 +04:00
struct epm_MapAuth * r ;
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
call = & ndr_table_epmapper . calls [ NDR_EPM_MAPAUTH ] ;
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
r = talloc ( NULL , struct epm_MapAuth ) ;
if ( r = = NULL ) {
2008-01-09 14:28:44 +03:00
return false ;
2007-08-21 18:06:46 +04:00
}
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
if ( ! prs_data_blob ( & p - > in_data . data , & blob , r ) ) {
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
pull = ndr_pull_init_blob ( & blob , r ) ;
2007-04-03 16:28:40 +04:00
if ( pull = = NULL ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-04-03 16:28:40 +04:00
pull - > flags | = LIBNDR_FLAG_REF_ALLOC ;
2007-11-09 16:38:47 +03:00
ndr_err = call - > ndr_pull ( pull , NDR_IN , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 18:06:46 +04:00
NDR_PRINT_IN_DEBUG ( epm_MapAuth , r ) ;
2008-01-09 14:28:44 +03:00
}
2007-08-21 18:06:46 +04:00
r - > out . result = _epm_MapAuth ( p , r ) ;
2008-01-09 14:28:44 +03:00
2007-04-03 16:28:40 +04:00
if ( p - > rng_fault_state ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
/* Return true here, srv_pipe_hnd.c will take care */
return true ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
if ( DEBUGLEVEL > = 10 ) {
2007-08-21 18:06:46 +04:00
NDR_PRINT_OUT_DEBUG ( epm_MapAuth , r ) ;
2008-01-09 14:28:44 +03:00
}
2007-08-21 18:06:46 +04:00
push = ndr_push_init_ctx ( r ) ;
2007-04-03 16:28:40 +04:00
if ( push = = NULL ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-11-09 16:38:47 +03:00
ndr_err = call - > ndr_push ( push , NDR_OUT , r ) ;
if ( ! NDR_ERR_CODE_IS_SUCCESS ( ndr_err ) ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-04-03 16:28:40 +04:00
blob = ndr_push_blob ( push ) ;
2008-01-09 14:28:44 +03:00
if ( ! prs_copy_data_in ( & p - > out_data . rdata , ( const char * ) blob . data , ( uint32_t ) blob . length ) ) {
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return false ;
2007-04-03 16:28:40 +04:00
}
2008-01-09 14:28:44 +03:00
2007-08-21 18:06:46 +04:00
talloc_free ( r ) ;
2008-01-09 14:28:44 +03:00
return true ;
2007-04-03 16:28:40 +04:00
}
/* Tables */
static struct api_struct api_epmapper_cmds [ ] =
{
2007-08-20 02:10:11 +04:00
{ " EPM_INSERT " , NDR_EPM_INSERT , api_epm_Insert } ,
{ " EPM_DELETE " , NDR_EPM_DELETE , api_epm_Delete } ,
{ " EPM_LOOKUP " , NDR_EPM_LOOKUP , api_epm_Lookup } ,
{ " EPM_MAP " , NDR_EPM_MAP , api_epm_Map } ,
{ " EPM_LOOKUPHANDLEFREE " , NDR_EPM_LOOKUPHANDLEFREE , api_epm_LookupHandleFree } ,
{ " EPM_INQOBJECT " , NDR_EPM_INQOBJECT , api_epm_InqObject } ,
{ " EPM_MGMTDELETE " , NDR_EPM_MGMTDELETE , api_epm_MgmtDelete } ,
{ " EPM_MAPAUTH " , NDR_EPM_MAPAUTH , api_epm_MapAuth } ,
2007-04-03 16:28:40 +04:00
} ;
void epmapper_get_pipe_fns ( struct api_struct * * fns , int * n_fns )
{
* fns = api_epmapper_cmds ;
* n_fns = sizeof ( api_epmapper_cmds ) / sizeof ( struct api_struct ) ;
}
NTSTATUS rpc_epmapper_init ( void )
{
return rpc_pipe_register_commands ( SMB_RPC_INTERFACE_VERSION , " epmapper " , " epmapper " , api_epmapper_cmds , sizeof ( api_epmapper_cmds ) / sizeof ( struct api_struct ) ) ;
}