1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-27 22:50:26 +03:00

s4-rap: decouple rap client code from torture binary, add new LIBCLI_RAP subsystem.

Guenther
This commit is contained in:
Günther Deschner 2011-03-15 17:28:51 +01:00
parent ebe0aa0e9c
commit 135104649f
10 changed files with 1567 additions and 1510 deletions

1476
source4/libcli/rap/rap.c Normal file

File diff suppressed because it is too large Load Diff

77
source4/libcli/rap/rap.h Normal file
View File

@ -0,0 +1,77 @@
/*
Unix SMB/CIFS implementation.
RAP client
Copyright (C) Volker Lendecke 2004
Copyright (C) Tim Potter 2005
Copyright (C) Jelmer Vernooij 2007
Copyright (C) Guenther Deschner 2010
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/>.
*/
#define RAP_GOTO(call) do { \
NTSTATUS _status; \
_status = call; \
if (!NT_STATUS_IS_OK(_status)) { \
result = _status; \
goto done; \
} \
} while (0)
#define RAP_RETURN(call) do { \
NTSTATUS _status; \
_status = call; \
if (!NT_STATUS_IS_OK(_status)) { \
return _status; \
} \
} while (0)
#define NDR_GOTO(call) do { \
enum ndr_err_code _ndr_err; \
_ndr_err = call; \
if (!NDR_ERR_CODE_IS_SUCCESS(_ndr_err)) { \
result = ndr_map_error2ntstatus(_ndr_err); \
goto done; \
} \
} while (0)
#define NDR_RETURN(call) do { \
enum ndr_err_code _ndr_err; \
_ndr_err = call; \
if (!NDR_ERR_CODE_IS_SUCCESS(_ndr_err)) { \
return ndr_map_error2ntstatus(_ndr_err); \
} \
} while (0)
struct rap_call {
uint16_t callno;
char *paramdesc;
const char *datadesc;
const char *auxdatadesc;
uint16_t status;
uint16_t convert;
uint16_t rcv_paramlen, rcv_datalen;
struct ndr_push *ndr_push_param;
struct ndr_push *ndr_push_data;
struct ndr_pull *ndr_pull_param;
struct ndr_pull *ndr_pull_data;
};
#define RAPNDR_FLAGS (LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
#include "../librpc/gen_ndr/rap.h"
#include "libcli/rap/proto.h"

View File

@ -0,0 +1,7 @@
#!/usr/bin/env python
bld.SAMBA_SUBSYSTEM('LIBCLI_RAP',
source='rap.c',
public_deps='LIBCLI_RAW',
autoproto='proto.h'
)

View File

@ -91,3 +91,4 @@ bld.SAMBA_SUBSYSTEM('LIBCLI_RAW',
)
bld.RECURSE('smb2')
bld.RECURSE('rap')

View File

@ -27,7 +27,7 @@
#include "torture/smbtorture.h"
#include "torture/util.h"
#include "../librpc/gen_ndr/rap.h"
#include "libcli/rap/rap.h"
#include "torture/rap/proto.h"
#include "param/param.h"

File diff suppressed because it is too large Load Diff

View File

@ -21,7 +21,7 @@
#include "libcli/libcli.h"
#include "torture/smbtorture.h"
#include "torture/util.h"
#include "../librpc/gen_ndr/rap.h"
#include "libcli/rap/rap.h"
#include "torture/rap/proto.h"
#include "param/param.h"
#include "torture/rpc/torture_rpc.h"

View File

@ -24,7 +24,7 @@
#include "torture/util.h"
#include "torture/smbtorture.h"
#include "torture/util.h"
#include "../librpc/gen_ndr/rap.h"
#include "libcli/rap/rap.h"
#include "torture/rap/proto.h"
#include "param/param.h"
#include "../lib/crypto/crypto.h"

View File

@ -22,9 +22,8 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
#include "libcli/raw/raw_proto.h"
#include "../librpc/gen_ndr/rap.h"
#include "torture/util.h"
#include "torture/rap/proto.h"
#include "libcli/rap/rap.h"
#include "librpc/gen_ndr/ndr_lsa_c.h"
#include "librpc/gen_ndr/ndr_samr_c.h"
#include "librpc/gen_ndr/ndr_netlogon_c.h"

View File

@ -55,7 +55,7 @@ bld.SAMBA_MODULE('TORTURE_RAP',
autoproto='rap/proto.h',
subsystem='smbtorture',
init_function='torture_rap_init',
deps='TORTURE_UTIL LIBCLI_SMB NDR_RAP',
deps='TORTURE_UTIL LIBCLI_SMB NDR_RAP LIBCLI_RAP',
internal_module=True
)