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:
parent
ebe0aa0e9c
commit
135104649f
1476
source4/libcli/rap/rap.c
Normal file
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
77
source4/libcli/rap/rap.h
Normal 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"
|
7
source4/libcli/rap/wscript_build
Normal file
7
source4/libcli/rap/wscript_build
Normal file
@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
bld.SAMBA_SUBSYSTEM('LIBCLI_RAP',
|
||||
source='rap.c',
|
||||
public_deps='LIBCLI_RAW',
|
||||
autoproto='proto.h'
|
||||
)
|
@ -91,3 +91,4 @@ bld.SAMBA_SUBSYSTEM('LIBCLI_RAW',
|
||||
)
|
||||
|
||||
bld.RECURSE('smb2')
|
||||
bld.RECURSE('rap')
|
||||
|
@ -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
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user