2004-07-08 20:41:10 +04:00
/*
Unix SMB / CIFS implementation .
test suite for various RAP operations
Copyright ( C ) Volker Lendecke 2004
2005-01-25 04:21:59 +03:00
Copyright ( C ) Tim Potter 2005
2004-07-08 20:41:10 +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
the Free Software Foundation ; either version 2 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 , write to the Free Software
Foundation , Inc . , 675 Mass Ave , Cambridge , MA 0213 9 , USA .
*/
# include "includes.h"
2006-03-17 20:59:58 +03:00
# include "libcli/libcli.h"
2006-03-25 19:01:28 +03:00
# include "torture/torture.h"
2006-03-17 20:59:58 +03:00
# include "torture/util.h"
2006-02-23 14:29:01 +03:00
# include "libcli/rap/rap.h"
2006-01-30 11:12:35 +03:00
# include "libcli/raw/libcliraw.h"
# include "libcli/libcli.h"
2006-03-18 18:42:57 +03:00
# include "librpc/ndr/libndr.h"
2004-07-08 20:41:10 +04:00
struct rap_call {
2005-02-10 08:09:35 +03:00
uint16_t callno ;
2004-07-08 20:41:10 +04:00
char * paramdesc ;
const char * datadesc ;
2005-02-10 08:09:35 +03:00
uint16_t status ;
uint16_t convert ;
2004-07-12 20:35:48 +04:00
2005-02-10 08:09:35 +03:00
uint16_t rcv_paramlen , rcv_datalen ;
2004-07-08 20:41:10 +04:00
2004-07-11 18:39:25 +04:00
struct ndr_push * ndr_push_param ;
struct ndr_push * ndr_push_data ;
struct ndr_pull * ndr_pull_param ;
struct ndr_pull * ndr_pull_data ;
2004-07-08 20:41:10 +04:00
} ;
2004-07-11 18:39:25 +04:00
# define RAPNDR_FLAGS (LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
2005-02-10 08:09:35 +03:00
static struct rap_call * new_rap_cli_call ( TALLOC_CTX * mem_ctx , uint16_t callno )
2004-07-08 20:41:10 +04:00
{
struct rap_call * call ;
2005-01-27 10:08:20 +03:00
call = talloc ( mem_ctx , struct rap_call ) ;
2004-07-08 20:41:10 +04:00
if ( call = = NULL )
return NULL ;
call - > callno = callno ;
2004-07-12 20:35:48 +04:00
call - > rcv_paramlen = 4 ;
2005-01-25 05:07:27 +03:00
call - > paramdesc = NULL ;
call - > datadesc = NULL ;
2004-07-08 20:41:10 +04:00
2004-07-11 18:39:25 +04:00
call - > ndr_push_param = ndr_push_init_ctx ( mem_ctx ) ;
call - > ndr_push_param - > flags = RAPNDR_FLAGS ;
call - > ndr_push_data = ndr_push_init_ctx ( mem_ctx ) ;
call - > ndr_push_data - > flags = RAPNDR_FLAGS ;
2004-07-08 20:41:10 +04:00
return call ;
}
static void rap_cli_push_paramdesc ( struct rap_call * call , char desc )
{
int len = 0 ;
if ( call - > paramdesc ! = NULL )
len = strlen ( call - > paramdesc ) ;
2005-01-25 05:07:27 +03:00
call - > paramdesc = talloc_realloc ( call ,
2004-09-27 05:36:19 +04:00
call - > paramdesc ,
2005-01-07 07:39:16 +03:00
uint8_t ,
2004-07-08 20:41:10 +04:00
len + 2 ) ;
2005-01-25 05:07:27 +03:00
2004-07-08 20:41:10 +04:00
call - > paramdesc [ len ] = desc ;
call - > paramdesc [ len + 1 ] = ' \0 ' ;
}
2005-02-10 08:09:35 +03:00
static void rap_cli_push_word ( struct rap_call * call , uint16_t val )
2004-07-08 20:41:10 +04:00
{
rap_cli_push_paramdesc ( call , ' W ' ) ;
2005-02-10 00:10:23 +03:00
ndr_push_uint16 ( call - > ndr_push_param , NDR_SCALARS , val ) ;
2004-07-08 20:41:10 +04:00
}
2005-02-10 08:09:35 +03:00
static void rap_cli_push_dword ( struct rap_call * call , uint32_t val )
2004-07-08 20:41:10 +04:00
{
rap_cli_push_paramdesc ( call , ' D ' ) ;
2005-02-10 00:10:23 +03:00
ndr_push_uint32 ( call - > ndr_push_param , NDR_SCALARS , val ) ;
2004-07-08 20:41:10 +04:00
}
static void rap_cli_push_rcvbuf ( struct rap_call * call , int len )
{
rap_cli_push_paramdesc ( call , ' r ' ) ;
rap_cli_push_paramdesc ( call , ' L ' ) ;
2005-02-10 00:10:23 +03:00
ndr_push_uint16 ( call - > ndr_push_param , NDR_SCALARS , len ) ;
2004-07-12 20:35:48 +04:00
call - > rcv_datalen = len ;
2004-07-08 20:41:10 +04:00
}
static void rap_cli_expect_multiple_entries ( struct rap_call * call )
{
rap_cli_push_paramdesc ( call , ' e ' ) ;
rap_cli_push_paramdesc ( call , ' h ' ) ;
2005-02-10 08:09:35 +03:00
call - > rcv_paramlen + = 4 ; /* uint16_t entry count, uint16_t total */
2004-07-08 20:41:10 +04:00
}
static void rap_cli_push_string ( struct rap_call * call , const char * str )
{
if ( str = = NULL ) {
rap_cli_push_paramdesc ( call , ' O ' ) ;
return ;
}
rap_cli_push_paramdesc ( call , ' z ' ) ;
2004-07-11 18:39:25 +04:00
ndr_push_string ( call - > ndr_push_param , NDR_SCALARS , str ) ;
2004-07-08 20:41:10 +04:00
}
static void rap_cli_expect_format ( struct rap_call * call , const char * format )
{
call - > datadesc = format ;
}
2004-07-11 18:39:25 +04:00
static NTSTATUS rap_pull_string ( TALLOC_CTX * mem_ctx , struct ndr_pull * ndr ,
2005-02-10 08:09:35 +03:00
uint16_t convert , char * * dest )
2004-07-08 20:41:10 +04:00
{
2005-02-10 08:09:35 +03:00
uint16_t string_offset ;
uint16_t ignore ;
2004-11-25 22:13:41 +03:00
const char * p ;
2004-07-08 20:41:10 +04:00
size_t len ;
2005-02-10 00:10:23 +03:00
NDR_CHECK ( ndr_pull_uint16 ( ndr , NDR_SCALARS , & string_offset ) ) ;
NDR_CHECK ( ndr_pull_uint16 ( ndr , NDR_SCALARS , & ignore ) ) ;
2004-07-08 20:41:10 +04:00
string_offset - = convert ;
2004-07-11 18:39:25 +04:00
if ( string_offset + 1 > ndr - > data_size )
return NT_STATUS_INVALID_PARAMETER ;
2004-07-08 20:41:10 +04:00
2004-11-25 22:13:41 +03:00
p = ( const char * ) ( ndr - > data + string_offset ) ;
2004-07-11 18:39:25 +04:00
len = strnlen ( p , ndr - > data_size - string_offset ) ;
2004-07-08 20:41:10 +04:00
2004-07-11 18:39:25 +04:00
if ( string_offset + len + 1 > ndr - > data_size )
return NT_STATUS_INVALID_PARAMETER ;
2004-07-08 20:41:10 +04:00
2005-01-07 07:39:16 +03:00
* dest = talloc_zero_size ( mem_ctx , len + 1 ) ;
2004-07-08 20:41:10 +04:00
pull_ascii ( * dest , p , len + 1 , len , 0 ) ;
2004-07-11 18:39:25 +04:00
return NT_STATUS_OK ;
2004-07-08 20:41:10 +04:00
}
2005-01-25 05:07:27 +03:00
static NTSTATUS rap_cli_do_call ( struct smbcli_state * cli , struct rap_call * call )
2004-07-08 20:41:10 +04:00
{
NTSTATUS result ;
2004-07-11 18:39:25 +04:00
DATA_BLOB param_blob ;
struct ndr_push * params ;
2004-07-12 20:35:48 +04:00
struct smb_trans2 trans ;
2004-07-11 18:39:25 +04:00
2005-01-25 05:07:27 +03:00
params = ndr_push_init_ctx ( call ) ;
2004-07-11 18:39:25 +04:00
if ( params = = NULL )
return NT_STATUS_NO_MEMORY ;
params - > flags = RAPNDR_FLAGS ;
2004-07-08 20:41:10 +04:00
2004-07-12 20:35:48 +04:00
trans . in . max_param = call - > rcv_paramlen ;
2004-10-30 06:17:03 +04:00
trans . in . max_data = smb_raw_max_trans_data ( cli - > tree , call - > rcv_paramlen ) ;
2004-07-12 20:35:48 +04:00
trans . in . max_setup = 0 ;
trans . in . flags = 0 ;
trans . in . timeout = 0 ;
trans . in . setup_count = 0 ;
trans . in . setup = NULL ;
trans . in . trans_name = " \\ PIPE \\ LANMAN " ;
2004-07-08 20:41:10 +04:00
2005-02-10 00:10:23 +03:00
NDR_CHECK ( ndr_push_uint16 ( params , NDR_SCALARS , call - > callno ) ) ;
2005-01-25 04:21:59 +03:00
if ( call - > paramdesc )
NDR_CHECK ( ndr_push_string ( params , NDR_SCALARS , call - > paramdesc ) ) ;
if ( call - > datadesc )
NDR_CHECK ( ndr_push_string ( params , NDR_SCALARS , call - > datadesc ) ) ;
2004-07-08 20:41:10 +04:00
2004-07-11 18:39:25 +04:00
param_blob = ndr_push_blob ( call - > ndr_push_param ) ;
NDR_CHECK ( ndr_push_bytes ( params , param_blob . data ,
param_blob . length ) ) ;
2004-07-08 20:41:10 +04:00
2004-07-12 20:35:48 +04:00
trans . in . params = ndr_push_blob ( params ) ;
trans . in . data = data_blob ( NULL , 0 ) ;
2004-07-08 20:41:10 +04:00
2005-01-25 05:07:27 +03:00
result = smb_raw_trans ( cli - > tree , call , & trans ) ;
2004-07-08 20:41:10 +04:00
if ( ! NT_STATUS_IS_OK ( result ) )
return result ;
2005-01-25 05:07:27 +03:00
call - > ndr_pull_param = ndr_pull_init_blob ( & trans . out . params , call ) ;
2004-07-11 18:39:25 +04:00
call - > ndr_pull_param - > flags = RAPNDR_FLAGS ;
2004-07-08 20:41:10 +04:00
2005-01-25 05:07:27 +03:00
call - > ndr_pull_data = ndr_pull_init_blob ( & trans . out . data , call ) ;
2004-07-11 18:39:25 +04:00
call - > ndr_pull_data - > flags = RAPNDR_FLAGS ;
2004-07-08 20:41:10 +04:00
2004-07-11 18:39:25 +04:00
return result ;
}
2004-07-08 20:41:10 +04:00
2004-07-11 18:39:25 +04:00
# define NDR_OK(call) do { NTSTATUS _status; \
_status = call ; \
if ( ! NT_STATUS_IS_OK ( _status ) ) \
goto done ; \
} while ( 0 )
2004-07-08 20:41:10 +04:00
2004-08-04 17:23:35 +04:00
static NTSTATUS smbcli_rap_netshareenum ( struct smbcli_state * cli ,
2005-04-28 11:30:36 +04:00
TALLOC_CTX * mem_ctx ,
2005-01-25 05:07:27 +03:00
struct rap_NetShareEnum * r )
2004-07-08 20:41:10 +04:00
{
struct rap_call * call ;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL ;
int i ;
2005-01-25 13:03:57 +03:00
call = new_rap_cli_call ( NULL , RAP_WshareEnum ) ;
2004-07-08 20:41:10 +04:00
if ( call = = NULL )
return NT_STATUS_NO_MEMORY ;
rap_cli_push_word ( call , r - > in . level ) ; /* Level */
rap_cli_push_rcvbuf ( call , r - > in . bufsize ) ;
rap_cli_expect_multiple_entries ( call ) ;
switch ( r - > in . level ) {
case 0 :
rap_cli_expect_format ( call , " B13 " ) ;
break ;
case 1 :
rap_cli_expect_format ( call , " B13BWz " ) ;
break ;
}
2005-01-25 05:07:27 +03:00
result = rap_cli_do_call ( cli , call ) ;
2004-07-08 20:41:10 +04:00
if ( ! NT_STATUS_IS_OK ( result ) )
goto done ;
2005-02-10 00:10:23 +03:00
NDR_OK ( ndr_pull_uint16 ( call - > ndr_pull_param , NDR_SCALARS , & r - > out . status ) ) ;
NDR_OK ( ndr_pull_uint16 ( call - > ndr_pull_param , NDR_SCALARS , & r - > out . convert ) ) ;
NDR_OK ( ndr_pull_uint16 ( call - > ndr_pull_param , NDR_SCALARS , & r - > out . count ) ) ;
NDR_OK ( ndr_pull_uint16 ( call - > ndr_pull_param , NDR_SCALARS , & r - > out . available ) ) ;
2004-07-08 20:41:10 +04:00
2005-04-28 11:30:36 +04:00
r - > out . info = talloc_array ( mem_ctx , union rap_shareenum_info , r - > out . count ) ;
2004-07-08 20:41:10 +04:00
2005-01-25 05:07:27 +03:00
if ( r - > out . info = = NULL ) {
result = NT_STATUS_NO_MEMORY ;
goto done ;
}
2004-07-11 18:39:25 +04:00
2004-07-08 20:41:10 +04:00
for ( i = 0 ; i < r - > out . count ; i + + ) {
switch ( r - > in . level ) {
case 0 :
2004-07-11 18:39:25 +04:00
NDR_OK ( ndr_pull_bytes ( call - > ndr_pull_data ,
2004-11-25 22:13:41 +03:00
( uint8_t * ) r - > out . info [ i ] . info0 . name , 13 ) ) ;
2004-07-08 20:41:10 +04:00
break ;
case 1 :
2004-07-11 18:39:25 +04:00
NDR_OK ( ndr_pull_bytes ( call - > ndr_pull_data ,
2004-11-25 22:13:41 +03:00
( uint8_t * ) r - > out . info [ i ] . info1 . name , 13 ) ) ;
2004-07-11 18:39:25 +04:00
NDR_OK ( ndr_pull_bytes ( call - > ndr_pull_data ,
2004-11-25 22:13:41 +03:00
( uint8_t * ) & r - > out . info [ i ] . info1 . pad , 1 ) ) ;
2004-07-11 18:39:25 +04:00
NDR_OK ( ndr_pull_uint16 ( call - > ndr_pull_data ,
2005-02-10 00:10:23 +03:00
NDR_SCALARS , & r - > out . info [ i ] . info1 . type ) ) ;
2005-04-28 11:30:36 +04:00
NDR_OK ( rap_pull_string ( mem_ctx , call - > ndr_pull_data ,
2004-07-11 18:39:25 +04:00
r - > out . convert ,
& r - > out . info [ i ] . info1 . comment ) ) ;
break ;
2004-07-08 20:41:10 +04:00
}
}
result = NT_STATUS_OK ;
done :
2005-01-27 10:08:20 +03:00
talloc_free ( call ) ;
2004-07-08 20:41:10 +04:00
return result ;
}
2005-01-25 05:07:27 +03:00
static BOOL test_netshareenum ( struct smbcli_state * cli )
2004-07-08 20:41:10 +04:00
{
struct rap_NetShareEnum r ;
int i ;
2005-04-28 11:30:36 +04:00
TALLOC_CTX * tmp_ctx = talloc_new ( cli ) ;
2004-07-08 20:41:10 +04:00
r . in . level = 1 ;
r . in . bufsize = 8192 ;
2005-04-28 11:30:36 +04:00
if ( ! NT_STATUS_IS_OK ( smbcli_rap_netshareenum ( cli , tmp_ctx , & r ) ) )
2004-07-08 20:41:10 +04:00
return False ;
for ( i = 0 ; i < r . out . count ; i + + ) {
printf ( " %s %d %s \n " , r . out . info [ i ] . info1 . name ,
r . out . info [ i ] . info1 . type ,
r . out . info [ i ] . info1 . comment ) ;
}
2005-04-28 11:30:36 +04:00
talloc_free ( tmp_ctx ) ;
2004-07-08 20:41:10 +04:00
return True ;
}
2004-08-04 17:23:35 +04:00
static NTSTATUS smbcli_rap_netserverenum2 ( struct smbcli_state * cli ,
2005-04-28 11:30:36 +04:00
TALLOC_CTX * mem_ctx ,
2005-01-25 05:07:27 +03:00
struct rap_NetServerEnum2 * r )
2004-07-08 20:41:10 +04:00
{
struct rap_call * call ;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL ;
int i ;
2005-01-25 13:03:57 +03:00
call = new_rap_cli_call ( NULL , RAP_NetServerEnum2 ) ;
2004-07-08 20:41:10 +04:00
if ( call = = NULL )
return NT_STATUS_NO_MEMORY ;
rap_cli_push_word ( call , r - > in . level ) ;
rap_cli_push_rcvbuf ( call , r - > in . bufsize ) ;
rap_cli_expect_multiple_entries ( call ) ;
rap_cli_push_dword ( call , r - > in . servertype ) ;
rap_cli_push_string ( call , r - > in . domain ) ;
switch ( r - > in . level ) {
case 0 :
rap_cli_expect_format ( call , " B16 " ) ;
break ;
case 1 :
rap_cli_expect_format ( call , " B16BBDz " ) ;
break ;
}
2005-01-25 05:07:27 +03:00
result = rap_cli_do_call ( cli , call ) ;
2004-07-08 20:41:10 +04:00
if ( ! NT_STATUS_IS_OK ( result ) )
goto done ;
2004-07-11 18:39:25 +04:00
result = NT_STATUS_INVALID_PARAMETER ;
2005-02-10 00:10:23 +03:00
NDR_OK ( ndr_pull_uint16 ( call - > ndr_pull_param , NDR_SCALARS , & r - > out . status ) ) ;
NDR_OK ( ndr_pull_uint16 ( call - > ndr_pull_param , NDR_SCALARS , & r - > out . convert ) ) ;
NDR_OK ( ndr_pull_uint16 ( call - > ndr_pull_param , NDR_SCALARS , & r - > out . count ) ) ;
NDR_OK ( ndr_pull_uint16 ( call - > ndr_pull_param , NDR_SCALARS , & r - > out . available ) ) ;
2004-07-08 20:41:10 +04:00
2005-04-28 11:30:36 +04:00
r - > out . info = talloc_array ( mem_ctx , union rap_server_info , r - > out . count ) ;
2004-07-08 20:41:10 +04:00
2005-01-25 05:07:27 +03:00
if ( r - > out . info = = NULL ) {
result = NT_STATUS_NO_MEMORY ;
goto done ;
}
2004-07-11 18:39:25 +04:00
2004-07-08 20:41:10 +04:00
for ( i = 0 ; i < r - > out . count ; i + + ) {
switch ( r - > in . level ) {
case 0 :
2004-07-11 18:39:25 +04:00
NDR_OK ( ndr_pull_bytes ( call - > ndr_pull_data ,
2004-11-25 22:13:41 +03:00
( uint8_t * ) r - > out . info [ i ] . info0 . name , 16 ) ) ;
2004-07-08 20:41:10 +04:00
break ;
case 1 :
2004-07-11 18:39:25 +04:00
NDR_OK ( ndr_pull_bytes ( call - > ndr_pull_data ,
2004-11-25 22:13:41 +03:00
( uint8_t * ) r - > out . info [ i ] . info1 . name , 16 ) ) ;
2004-07-11 18:39:25 +04:00
NDR_OK ( ndr_pull_bytes ( call - > ndr_pull_data ,
& r - > out . info [ i ] . info1 . version_major , 1 ) ) ;
NDR_OK ( ndr_pull_bytes ( call - > ndr_pull_data ,
& r - > out . info [ i ] . info1 . version_minor , 1 ) ) ;
NDR_OK ( ndr_pull_uint32 ( call - > ndr_pull_data ,
2005-02-10 00:10:23 +03:00
NDR_SCALARS , & r - > out . info [ i ] . info1 . servertype ) ) ;
2005-04-28 11:30:36 +04:00
NDR_OK ( rap_pull_string ( mem_ctx , call - > ndr_pull_data ,
2004-07-11 18:39:25 +04:00
r - > out . convert ,
& r - > out . info [ i ] . info1 . comment ) ) ;
2004-07-08 20:41:10 +04:00
}
}
result = NT_STATUS_OK ;
done :
2005-01-27 10:08:20 +03:00
talloc_free ( call ) ;
2004-07-08 20:41:10 +04:00
return result ;
}
2005-01-25 05:07:27 +03:00
static BOOL test_netserverenum ( struct smbcli_state * cli )
2004-07-08 20:41:10 +04:00
{
struct rap_NetServerEnum2 r ;
int i ;
2005-04-28 11:30:36 +04:00
TALLOC_CTX * tmp_ctx = talloc_new ( cli ) ;
2004-07-08 20:41:10 +04:00
r . in . level = 0 ;
r . in . bufsize = 8192 ;
r . in . servertype = 0xffffffff ;
r . in . servertype = 0x80000000 ;
r . in . domain = NULL ;
2005-04-28 11:30:36 +04:00
if ( ! NT_STATUS_IS_OK ( smbcli_rap_netserverenum2 ( cli , tmp_ctx , & r ) ) )
2004-07-08 20:41:10 +04:00
return False ;
for ( i = 0 ; i < r . out . count ; i + + ) {
switch ( r . in . level ) {
case 0 :
printf ( " %s \n " , r . out . info [ i ] . info0 . name ) ;
break ;
case 1 :
printf ( " %s %x %s \n " , r . out . info [ i ] . info1 . name ,
r . out . info [ i ] . info1 . servertype ,
r . out . info [ i ] . info1 . comment ) ;
break ;
}
}
2005-04-28 11:30:36 +04:00
talloc_free ( tmp_ctx ) ;
2004-07-08 20:41:10 +04:00
return True ;
}
2005-01-25 05:07:27 +03:00
static BOOL test_rap ( struct smbcli_state * cli )
2004-07-08 20:41:10 +04:00
{
BOOL res = True ;
2005-01-25 05:07:27 +03:00
if ( ! test_netserverenum ( cli ) )
2004-07-08 20:41:10 +04:00
res = False ;
2005-01-25 05:07:27 +03:00
if ( ! test_netshareenum ( cli ) )
2004-07-08 20:41:10 +04:00
res = False ;
return res ;
}
2006-03-25 19:01:28 +03:00
BOOL torture_raw_rap ( struct torture_context * torture )
2004-07-08 20:41:10 +04:00
{
2004-08-04 17:23:35 +04:00
struct smbcli_state * cli ;
2004-07-08 20:41:10 +04:00
BOOL ret = True ;
TALLOC_CTX * mem_ctx ;
if ( ! torture_open_connection ( & cli ) ) {
return False ;
}
mem_ctx = talloc_init ( " torture_raw_rap " ) ;
2005-01-25 05:07:27 +03:00
if ( ! test_rap ( cli ) ) {
2004-07-08 20:41:10 +04:00
ret = False ;
}
torture_close_connection ( cli ) ;
2005-01-27 10:08:20 +03:00
talloc_free ( mem_ctx ) ;
2005-01-25 05:07:27 +03:00
2004-07-08 20:41:10 +04:00
return ret ;
}
2005-01-25 04:21:59 +03:00
2006-03-25 19:01:28 +03:00
BOOL torture_rap_scan ( struct torture_context * torture )
2005-01-25 04:21:59 +03:00
{
2005-01-25 05:07:27 +03:00
TALLOC_CTX * mem_ctx ;
2005-01-25 04:21:59 +03:00
struct smbcli_state * cli ;
2005-01-25 13:03:57 +03:00
int callno ;
2005-01-25 04:21:59 +03:00
2005-01-25 05:07:27 +03:00
mem_ctx = talloc_init ( " torture_rap_scan " ) ;
2005-01-25 04:21:59 +03:00
if ( ! torture_open_connection ( & cli ) ) {
return False ;
}
for ( callno = 0 ; callno < 0xffff ; callno + + ) {
2005-01-25 05:07:27 +03:00
struct rap_call * call = new_rap_cli_call ( mem_ctx , callno ) ;
2005-01-25 04:21:59 +03:00
NTSTATUS result ;
2005-01-25 05:07:27 +03:00
result = rap_cli_do_call ( cli , call ) ;
2005-01-25 04:21:59 +03:00
2005-01-25 13:03:57 +03:00
if ( ! NT_STATUS_EQUAL ( result , NT_STATUS_INVALID_PARAMETER ) )
continue ;
printf ( " callno %d is RAP call \n " , callno ) ;
2005-01-25 04:21:59 +03:00
}
torture_close_connection ( cli ) ;
2005-01-25 05:07:27 +03:00
2005-01-25 04:21:59 +03:00
return True ;
}