summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/auth/smbencrypt.c4
-rw-r--r--source4/libcli/cliconnect.c1
-rw-r--r--source4/libcli/clilist.c1
-rw-r--r--source4/libcli/climessage.c1
-rw-r--r--source4/libcli/clireadwrite.c1
-rw-r--r--source4/libcli/composite/composite.h37
-rw-r--r--source4/libcli/ldap/config.mk3
-rw-r--r--source4/libcli/ldap/ldap.c5
-rw-r--r--source4/libcli/ldap/ldap.h4
-rw-r--r--source4/libcli/ldap/ldap_bind.c7
-rw-r--r--source4/libcli/ldap/ldap_client.c23
-rw-r--r--source4/libcli/ldap/ldap_client.h44
-rw-r--r--source4/libcli/ldap/ldap_ildap.c6
-rw-r--r--source4/libcli/ldap/ldap_msg.c2
-rw-r--r--source4/libcli/nbt/libnbt.h75
-rw-r--r--source4/libcli/nbt/namequery.c1
-rw-r--r--source4/libcli/nbt/namerefresh.c11
-rw-r--r--source4/libcli/nbt/nameregister.c15
-rw-r--r--source4/libcli/nbt/namerelease.c7
-rw-r--r--source4/libcli/nbt/nbtname.c2
-rw-r--r--source4/libcli/nbt/nbtsocket.c6
-rw-r--r--source4/libcli/raw/clierror.c4
-rw-r--r--source4/libcli/raw/clioplock.c1
-rw-r--r--source4/libcli/raw/clisession.c3
-rw-r--r--source4/libcli/raw/clisocket.c4
-rw-r--r--source4/libcli/raw/clitransport.c8
-rw-r--r--source4/libcli/raw/clitree.c7
-rw-r--r--source4/libcli/raw/libcliraw.h76
-rw-r--r--source4/libcli/raw/rawacl.c1
-rw-r--r--source4/libcli/raw/rawfile.c25
-rw-r--r--source4/libcli/raw/rawfileinfo.c9
-rw-r--r--source4/libcli/raw/rawfsinfo.c3
-rw-r--r--source4/libcli/raw/rawioctl.c3
-rw-r--r--source4/libcli/raw/rawnegotiate.c1
-rw-r--r--source4/libcli/raw/rawnotify.c5
-rw-r--r--source4/libcli/raw/rawreadwrite.c11
-rw-r--r--source4/libcli/raw/rawrequest.c7
-rw-r--r--source4/libcli/raw/rawsearch.c3
-rw-r--r--source4/libcli/raw/rawsetfileinfo.c7
-rw-r--r--source4/libcli/raw/rawshadow.c1
-rw-r--r--source4/libcli/raw/rawtrans.c9
-rw-r--r--source4/libcli/raw/smb_signing.c1
-rw-r--r--source4/libcli/smb2/close.c1
-rw-r--r--source4/libcli/smb2/connect.c1
-rw-r--r--source4/libcli/smb2/create.c1
-rw-r--r--source4/libcli/smb2/find.c1
-rw-r--r--source4/libcli/smb2/getinfo.c1
-rw-r--r--source4/libcli/smb2/negprot.c2
-rw-r--r--source4/libcli/smb2/notify.c1
-rw-r--r--source4/libcli/smb2/setinfo.c1
-rw-r--r--source4/libcli/smb2/transport.c1
-rw-r--r--source4/libcli/smb_composite/appendacl.c1
-rw-r--r--source4/libcli/smb_composite/connect.c1
-rw-r--r--source4/libcli/smb_composite/fsinfo.c1
-rw-r--r--source4/libcli/smb_composite/savefile.c1
-rw-r--r--source4/libcli/smb_composite/sesssetup.c2
-rw-r--r--source4/libcli/util/error.h3
-rw-r--r--source4/libcli/util/errormap.c1
58 files changed, 371 insertions, 94 deletions
diff --git a/source4/libcli/auth/smbencrypt.c b/source4/libcli/auth/smbencrypt.c
index cefb55e205..7de9627302 100644
--- a/source4/libcli/auth/smbencrypt.c
+++ b/source4/libcli/auth/smbencrypt.c
@@ -63,7 +63,7 @@ bool SMBencrypt(const char *passwd, const uint8_t *c8, uint8_t p24[24])
* @param p16 return password hashed with md4, caller allocated 16 byte buffer
*/
-_PUBLIC_ bool E_md4hash(const char *passwd, uint8_t p16[16])
+bool E_md4hash(const char *passwd, uint8_t p16[16])
{
int len;
void *wpwd;
@@ -91,7 +91,7 @@ _PUBLIC_ bool E_md4hash(const char *passwd, uint8_t p16[16])
* @note p16 is filled in regardless
*/
-_PUBLIC_ bool E_deshash(const char *passwd, uint8_t p16[16])
+bool E_deshash(const char *passwd, uint8_t p16[16])
{
bool ret = true;
fstring dospwd;
diff --git a/source4/libcli/cliconnect.c b/source4/libcli/cliconnect.c
index 666dfe8446..4858a96110 100644
--- a/source4/libcli/cliconnect.c
+++ b/source4/libcli/cliconnect.c
@@ -23,6 +23,7 @@
#include "includes.h"
#include "libcli/libcli.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
#include "libcli/auth/libcli_auth.h"
#include "libcli/smb_composite/smb_composite.h"
#include "param/param.h"
diff --git a/source4/libcli/clilist.c b/source4/libcli/clilist.c
index 07393a3491..5d43606c61 100644
--- a/source4/libcli/clilist.c
+++ b/source4/libcli/clilist.c
@@ -21,6 +21,7 @@
#include "includes.h"
#include "libcli/libcli.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
struct search_private {
struct clilist_file_info *dirlist;
diff --git a/source4/libcli/climessage.c b/source4/libcli/climessage.c
index 6002ccfc59..5ed0e8e3cd 100644
--- a/source4/libcli/climessage.c
+++ b/source4/libcli/climessage.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
#include "libcli/libcli.h"
diff --git a/source4/libcli/clireadwrite.c b/source4/libcli/clireadwrite.c
index f5ba799bbc..ae2367918c 100644
--- a/source4/libcli/clireadwrite.c
+++ b/source4/libcli/clireadwrite.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
#include "libcli/libcli.h"
/****************************************************************************
diff --git a/source4/libcli/composite/composite.h b/source4/libcli/composite/composite.h
index db0ecf9af6..f1bed20361 100644
--- a/source4/libcli/composite/composite.h
+++ b/source4/libcli/composite/composite.h
@@ -19,6 +19,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#ifndef __COMPOSITE_H__
+#define __COMPOSITE_H__
+
#include "libcli/raw/interfaces.h"
/*
@@ -68,4 +71,36 @@ struct smb2_request;
struct rpc_request;
struct nbt_name_request;
-#include "libcli/composite/proto.h"
+struct composite_context *composite_create(TALLOC_CTX *mem_ctx, struct event_context *ev);
+bool composite_nomem(const void *p, struct composite_context *ctx);
+void composite_continue(struct composite_context *ctx,
+ struct composite_context *new_ctx,
+ void (*continuation)(struct composite_context *),
+ void *private_data);
+void composite_continue_rpc(struct composite_context *ctx,
+ struct rpc_request *new_req,
+ void (*continuation)(struct rpc_request *),
+ void *private_data);
+void composite_continue_irpc(struct composite_context *ctx,
+ struct irpc_request *new_req,
+ void (*continuation)(struct irpc_request *),
+ void *private_data);
+void composite_continue_smb(struct composite_context *ctx,
+ struct smbcli_request *new_req,
+ void (*continuation)(struct smbcli_request *),
+ void *private_data);
+void composite_continue_smb2(struct composite_context *ctx,
+ struct smb2_request *new_req,
+ void (*continuation)(struct smb2_request *),
+ void *private_data);
+void composite_continue_nbt(struct composite_context *ctx,
+ struct nbt_name_request *new_req,
+ void (*continuation)(struct nbt_name_request *),
+ void *private_data);
+bool composite_is_ok(struct composite_context *ctx);
+void composite_done(struct composite_context *ctx);
+void composite_error(struct composite_context *ctx, NTSTATUS status);
+NTSTATUS composite_wait(struct composite_context *c);
+
+
+#endif /* __COMPOSITE_H__ */
diff --git a/source4/libcli/ldap/config.mk b/source4/libcli/ldap/config.mk
index bcdedd3440..0c5236c138 100644
--- a/source4/libcli/ldap/config.mk
+++ b/source4/libcli/ldap/config.mk
@@ -10,9 +10,8 @@ PUBLIC_DEPENDENCIES = LIBSAMBA-ERRORS LIBEVENTS LIBPACKET
PRIVATE_DEPENDENCIES = LIBCLI_COMPOSITE samba-socket NDR_SAMR LIBTLS ASN1_UTIL \
LDAP_ENCODE LIBNDR LP_RESOLVE gensec
-PUBLIC_HEADERS += libcli/ldap/ldap.h
+PUBLIC_HEADERS += libcli/ldap/ldap.h libcli/ldap/ldap_ndr.h
[SUBSYSTEM::LDAP_ENCODE]
-PRIVATE_PROTO_HEADER = ldap_ndr.h
OBJ_FILES = ldap_ndr.o
# FIXME PRIVATE_DEPENDENCIES = LIBLDB
diff --git a/source4/libcli/ldap/ldap.c b/source4/libcli/ldap/ldap.c
index 00a0631753..fc6de7993e 100644
--- a/source4/libcli/ldap/ldap.c
+++ b/source4/libcli/ldap/ldap.c
@@ -25,6 +25,7 @@
#include "includes.h"
#include "lib/util/asn1.h"
#include "libcli/ldap/ldap.h"
+#include "libcli/ldap/ldap_proto.h"
static bool ldap_push_filter(struct asn1_data *data, struct ldb_parse_tree *tree)
@@ -187,7 +188,7 @@ static void ldap_encode_response(struct asn1_data *data, struct ldap_Result *res
}
}
-bool ldap_encode(struct ldap_message *msg, DATA_BLOB *result, TALLOC_CTX *mem_ctx)
+_PUBLIC_ bool ldap_encode(struct ldap_message *msg, DATA_BLOB *result, TALLOC_CTX *mem_ctx)
{
struct asn1_data *data = asn1_init(mem_ctx);
int i, j;
@@ -927,7 +928,7 @@ static void ldap_decode_attribs(TALLOC_CTX *mem_ctx, struct asn1_data *data,
/* This routine returns LDAP status codes */
-NTSTATUS ldap_decode(struct asn1_data *data, struct ldap_message *msg)
+_PUBLIC_ NTSTATUS ldap_decode(struct asn1_data *data, struct ldap_message *msg)
{
uint8_t tag;
diff --git a/source4/libcli/ldap/ldap.h b/source4/libcli/ldap/ldap.h
index 6f5e86744e..a336a7ad85 100644
--- a/source4/libcli/ldap/ldap.h
+++ b/source4/libcli/ldap/ldap.h
@@ -254,6 +254,8 @@ struct cli_credentials;
struct dom_sid;
struct asn1_data;
-#include "libcli/ldap/ldap_proto.h"
+struct ldap_message *new_ldap_message(TALLOC_CTX *mem_ctx);
+NTSTATUS ldap_decode(struct asn1_data *data, struct ldap_message *msg);
+bool ldap_encode(struct ldap_message *msg, DATA_BLOB *result, TALLOC_CTX *mem_ctx);
#endif
diff --git a/source4/libcli/ldap/ldap_bind.c b/source4/libcli/ldap/ldap_bind.c
index fd15ff2fc7..2c04edf950 100644
--- a/source4/libcli/ldap/ldap_bind.c
+++ b/source4/libcli/ldap/ldap_bind.c
@@ -23,6 +23,7 @@
#include "includes.h"
#include "libcli/ldap/ldap.h"
+#include "libcli/ldap/ldap_proto.h"
#include "libcli/ldap/ldap_client.h"
#include "lib/tls/tls.h"
#include "auth/gensec/gensec.h"
@@ -35,7 +36,7 @@ struct ldap_simple_creds {
const char *pw;
};
-NTSTATUS ldap_rebind(struct ldap_connection *conn)
+_PUBLIC_ NTSTATUS ldap_rebind(struct ldap_connection *conn)
{
NTSTATUS status;
struct ldap_simple_creds *creds;
@@ -88,7 +89,7 @@ static struct ldap_message *new_ldap_simple_bind_msg(struct ldap_connection *con
/*
perform a simple username/password bind
*/
-NTSTATUS ldap_bind_simple(struct ldap_connection *conn,
+_PUBLIC_ NTSTATUS ldap_bind_simple(struct ldap_connection *conn,
const char *userdn, const char *password)
{
struct ldap_request *req;
@@ -199,7 +200,7 @@ static struct ldap_message *new_ldap_sasl_bind_msg(struct ldap_connection *conn,
/*
perform a sasl bind using the given credentials
*/
-NTSTATUS ldap_bind_sasl(struct ldap_connection *conn,
+_PUBLIC_ NTSTATUS ldap_bind_sasl(struct ldap_connection *conn,
struct cli_credentials *creds,
struct loadparm_context *lp_ctx)
{
diff --git a/source4/libcli/ldap/ldap_client.c b/source4/libcli/ldap/ldap_client.c
index d99851ee15..296a7b11f2 100644
--- a/source4/libcli/ldap/ldap_client.c
+++ b/source4/libcli/ldap/ldap_client.c
@@ -28,6 +28,7 @@
#include "lib/events/events.h"
#include "lib/socket/socket.h"
#include "libcli/ldap/ldap.h"
+#include "libcli/ldap/ldap_proto.h"
#include "libcli/ldap/ldap_client.h"
#include "libcli/composite/composite.h"
#include "lib/stream/packet.h"
@@ -41,7 +42,7 @@
/**
create a new ldap_connection stucture. The event context is optional
*/
-struct ldap_connection *ldap4_new_connection(TALLOC_CTX *mem_ctx,
+_PUBLIC_ struct ldap_connection *ldap4_new_connection(TALLOC_CTX *mem_ctx,
struct loadparm_context *lp_ctx,
struct event_context *ev)
{
@@ -293,7 +294,7 @@ struct ldap_connect_state {
static void ldap_connect_recv_unix_conn(struct composite_context *ctx);
static void ldap_connect_recv_tcp_conn(struct composite_context *ctx);
-struct composite_context *ldap_connect_send(struct ldap_connection *conn,
+_PUBLIC_ struct composite_context *ldap_connect_send(struct ldap_connection *conn,
const char *url)
{
struct composite_context *result, *ctx;
@@ -476,7 +477,7 @@ _PUBLIC_ NTSTATUS ldap_connect_recv(struct composite_context *ctx)
return status;
}
-NTSTATUS ldap_connect(struct ldap_connection *conn, const char *url)
+_PUBLIC_ NTSTATUS ldap_connect(struct ldap_connection *conn, const char *url)
{
struct composite_context *ctx = ldap_connect_send(conn, url);
return ldap_connect_recv(ctx);
@@ -484,7 +485,7 @@ NTSTATUS ldap_connect(struct ldap_connection *conn, const char *url)
/* set reconnect parameters */
-void ldap_set_reconn_params(struct ldap_connection *conn, int max_retries)
+_PUBLIC_ void ldap_set_reconn_params(struct ldap_connection *conn, int max_retries)
{
if (conn) {
conn->reconnect.max_retries = max_retries;
@@ -569,7 +570,7 @@ static void ldap_request_complete(struct event_context *ev, struct timed_event *
/*
send a ldap message - async interface
*/
-struct ldap_request *ldap_request_send(struct ldap_connection *conn,
+_PUBLIC_ struct ldap_request *ldap_request_send(struct ldap_connection *conn,
struct ldap_message *msg)
{
struct ldap_request *req;
@@ -645,7 +646,7 @@ failed:
wait for a request to complete
note that this does not destroy the request
*/
-NTSTATUS ldap_request_wait(struct ldap_request *req)
+_PUBLIC_ NTSTATUS ldap_request_wait(struct ldap_request *req)
{
while (req->state < LDAP_REQUEST_DONE) {
if (event_loop_once(req->conn->event.event_ctx) != 0) {
@@ -709,7 +710,7 @@ static const struct {
/*
used to setup the status code from a ldap response
*/
-NTSTATUS ldap_check_response(struct ldap_connection *conn, struct ldap_Result *r)
+_PUBLIC_ NTSTATUS ldap_check_response(struct ldap_connection *conn, struct ldap_Result *r)
{
int i;
const char *codename = "unknown";
@@ -742,7 +743,7 @@ NTSTATUS ldap_check_response(struct ldap_connection *conn, struct ldap_Result *r
/*
return error string representing the last error
*/
-const char *ldap_errstr(struct ldap_connection *conn,
+_PUBLIC_ const char *ldap_errstr(struct ldap_connection *conn,
TALLOC_CTX *mem_ctx,
NTSTATUS status)
{
@@ -756,7 +757,7 @@ const char *ldap_errstr(struct ldap_connection *conn,
/*
return the Nth result message, waiting if necessary
*/
-NTSTATUS ldap_result_n(struct ldap_request *req, int n, struct ldap_message **msg)
+_PUBLIC_ NTSTATUS ldap_result_n(struct ldap_request *req, int n, struct ldap_message **msg)
{
*msg = NULL;
@@ -784,7 +785,7 @@ NTSTATUS ldap_result_n(struct ldap_request *req, int n, struct ldap_message **ms
/*
return a single result message, checking if it is of the expected LDAP type
*/
-NTSTATUS ldap_result_one(struct ldap_request *req, struct ldap_message **msg, int type)
+_PUBLIC_ NTSTATUS ldap_result_one(struct ldap_request *req, struct ldap_message **msg, int type)
{
NTSTATUS status;
status = ldap_result_n(req, 0, msg);
@@ -802,7 +803,7 @@ NTSTATUS ldap_result_one(struct ldap_request *req, struct ldap_message **msg, in
a simple ldap transaction, for single result requests that only need a status code
this relies on single valued requests having the response type == request type + 1
*/
-NTSTATUS ldap_transaction(struct ldap_connection *conn, struct ldap_message *msg)
+_PUBLIC_ NTSTATUS ldap_transaction(struct ldap_connection *conn, struct ldap_message *msg)
{
struct ldap_request *req = ldap_request_send(conn, msg);
struct ldap_message *res;
diff --git a/source4/libcli/ldap/ldap_client.h b/source4/libcli/ldap/ldap_client.h
index d5ff441aff..13b0bf725c 100644
--- a/source4/libcli/ldap/ldap_client.h
+++ b/source4/libcli/ldap/ldap_client.h
@@ -94,3 +94,47 @@ struct ldap_connection {
struct packet_context *packet;
};
+
+struct ldap_connection *ldap4_new_connection(TALLOC_CTX *mem_ctx,
+ struct loadparm_context *lp_ctx,
+ struct event_context *ev);
+
+NTSTATUS ldap_connect(struct ldap_connection *conn, const char *url);
+struct composite_context *ldap_connect_send(struct ldap_connection *conn,
+ const char *url);
+
+NTSTATUS ldap_rebind(struct ldap_connection *conn);
+NTSTATUS ldap_bind_simple(struct ldap_connection *conn,
+ const char *userdn, const char *password);
+NTSTATUS ldap_bind_sasl(struct ldap_connection *conn,
+ struct cli_credentials *creds,
+ struct loadparm_context *lp_ctx);
+struct ldap_request *ldap_request_send(struct ldap_connection *conn,
+ struct ldap_message *msg);
+NTSTATUS ldap_request_wait(struct ldap_request *req);
+struct composite_context;
+NTSTATUS ldap_connect_recv(struct composite_context *ctx);
+NTSTATUS ldap_result_n(struct ldap_request *req, int n, struct ldap_message **msg);
+NTSTATUS ldap_result_one(struct ldap_request *req, struct ldap_message **msg, int type);
+NTSTATUS ldap_transaction(struct ldap_connection *conn, struct ldap_message *msg);
+const char *ldap_errstr(struct ldap_connection *conn,
+ TALLOC_CTX *mem_ctx,
+ NTSTATUS status);
+NTSTATUS ldap_check_response(struct ldap_connection *conn, struct ldap_Result *r);
+void ldap_set_reconn_params(struct ldap_connection *conn, int max_retries);
+int ildap_count_entries(struct ldap_connection *conn, struct ldap_message **res);
+NTSTATUS ildap_search_bytree(struct ldap_connection *conn, const char *basedn,
+ int scope, struct ldb_parse_tree *tree,
+ const char * const *attrs, bool attributesonly,
+ struct ldb_control **control_req,
+ struct ldb_control ***control_res,
+ struct ldap_message ***results);
+NTSTATUS ildap_search(struct ldap_connection *conn, const char *basedn,
+ int scope, const char *expression,
+ const char * const *attrs, bool attributesonly,
+ struct ldb_control **control_req,
+ struct ldb_control ***control_res,
+ struct ldap_message ***results);
+
+
+
diff --git a/source4/libcli/ldap/ldap_ildap.c b/source4/libcli/ldap/ldap_ildap.c
index 7b592c65ae..8f21af0690 100644
--- a/source4/libcli/ldap/ldap_ildap.c
+++ b/source4/libcli/ldap/ldap_ildap.c
@@ -28,7 +28,7 @@
/*
count the returned search entries
*/
-int ildap_count_entries(struct ldap_connection *conn, struct ldap_message **res)
+_PUBLIC_ int ildap_count_entries(struct ldap_connection *conn, struct ldap_message **res)
{
int i;
for (i=0;res && res[i];i++) /* noop */ ;
@@ -39,7 +39,7 @@ int ildap_count_entries(struct ldap_connection *conn, struct ldap_message **res)
/*
perform a synchronous ldap search
*/
-NTSTATUS ildap_search_bytree(struct ldap_connection *conn, const char *basedn,
+_PUBLIC_ NTSTATUS ildap_search_bytree(struct ldap_connection *conn, const char *basedn,
int scope, struct ldb_parse_tree *tree,
const char * const *attrs, bool attributesonly,
struct ldb_control **control_req,
@@ -112,7 +112,7 @@ NTSTATUS ildap_search_bytree(struct ldap_connection *conn, const char *basedn,
/*
perform a ldap search
*/
-NTSTATUS ildap_search(struct ldap_connection *conn, const char *basedn,
+_PUBLIC_ NTSTATUS ildap_search(struct ldap_connection *conn, const char *basedn,
int scope, const char *expression,
const char * const *attrs, bool attributesonly,
struct ldb_control **control_req,
diff --git a/source4/libcli/ldap/ldap_msg.c b/source4/libcli/ldap/ldap_msg.c
index 12832b8ec4..c712e1e654 100644
--- a/source4/libcli/ldap/ldap_msg.c
+++ b/source4/libcli/ldap/ldap_msg.c
@@ -26,7 +26,7 @@
#include "libcli/ldap/ldap_client.h"
-struct ldap_message *new_ldap_message(TALLOC_CTX *mem_ctx)
+_PUBLIC_ struct ldap_message *new_ldap_message(TALLOC_CTX *mem_ctx)
{
return talloc_zero(mem_ctx, struct ldap_message);
}
diff --git a/source4/libcli/nbt/libnbt.h b/source4/libcli/nbt/libnbt.h
index bc85d87b89..14cec3a024 100644
--- a/source4/libcli/nbt/libnbt.h
+++ b/source4/libcli/nbt/libnbt.h
@@ -23,6 +23,7 @@
#define __LIBNBT_H__
#include "librpc/gen_ndr/nbt.h"
+#include "librpc/ndr/libndr.h"
/*
possible states for pending requests
@@ -273,6 +274,78 @@ struct nbt_name_release {
} out;
};
-#include "libcli/nbt/nbt_proto.h"
+struct nbt_name_socket *nbt_name_socket_init(TALLOC_CTX *mem_ctx,
+ struct event_context *event_ctx,
+ struct smb_iconv_convenience *iconv_convenience);
+struct nbt_name_request *nbt_name_query_send(struct nbt_name_socket *nbtsock,
+ struct nbt_name_query *io);
+NTSTATUS nbt_name_query_recv(struct nbt_name_request *req,
+ TALLOC_CTX *mem_ctx, struct nbt_name_query *io);
+NTSTATUS nbt_name_query(struct nbt_name_socket *nbtsock,
+ TALLOC_CTX *mem_ctx, struct nbt_name_query *io);
+struct nbt_name_request *nbt_name_status_send(struct nbt_name_socket *nbtsock,
+ struct nbt_name_status *io);
+NTSTATUS nbt_name_status_recv(struct nbt_name_request *req,
+ TALLOC_CTX *mem_ctx, struct nbt_name_status *io);
+NTSTATUS nbt_name_status(struct nbt_name_socket *nbtsock,
+ TALLOC_CTX *mem_ctx, struct nbt_name_status *io);
+
+NTSTATUS nbt_name_dup(TALLOC_CTX *mem_ctx, struct nbt_name *name, struct nbt_name *newname);
+NTSTATUS nbt_name_to_blob(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, DATA_BLOB *blob, struct nbt_name *name);
+NTSTATUS nbt_name_from_blob(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob, struct nbt_name *name);
+void nbt_choose_called_name(TALLOC_CTX *mem_ctx, struct nbt_name *n, const char *name, int type);
+char *nbt_name_string(TALLOC_CTX *mem_ctx, const struct nbt_name *name);
+NTSTATUS nbt_name_register(struct nbt_name_socket *nbtsock,
+ TALLOC_CTX *mem_ctx, struct nbt_name_register *io);
+NTSTATUS nbt_name_refresh(struct nbt_name_socket *nbtsock,
+ TALLOC_CTX *mem_ctx, struct nbt_name_refresh *io);
+NTSTATUS nbt_name_release(struct nbt_name_socket *nbtsock,
+ TALLOC_CTX *mem_ctx, struct nbt_name_release *io);
+NTSTATUS nbt_name_register_wins(struct nbt_name_socket *nbtsock,
+ TALLOC_CTX *mem_ctx,
+ struct nbt_name_register_wins *io);
+NTSTATUS nbt_name_refresh_wins(struct nbt_name_socket *nbtsock,
+ TALLOC_CTX *mem_ctx,
+ struct nbt_name_refresh_wins *io);
+NTSTATUS nbt_name_register_recv(struct nbt_name_request *req,
+ TALLOC_CTX *mem_ctx, struct nbt_name_register *io);
+struct nbt_name_request *nbt_name_register_send(struct nbt_name_socket *nbtsock,
+ struct nbt_name_register *io);
+NTSTATUS nbt_name_release_recv(struct nbt_name_request *req,
+ TALLOC_CTX *mem_ctx, struct nbt_name_release *io);
+
+struct nbt_name_request *nbt_name_release_send(struct nbt_name_socket *nbtsock,
+ struct nbt_name_release *io);
+
+NTSTATUS nbt_name_refresh_recv(struct nbt_name_request *req,
+ TALLOC_CTX *mem_ctx, struct nbt_name_refresh *io);
+
+NTSTATUS nbt_set_incoming_handler(struct nbt_name_socket *nbtsock,
+ void (*handler)(struct nbt_name_socket *, struct nbt_name_packet *,
+ struct socket_address *),
+ void *private);
+NTSTATUS nbt_name_reply_send(struct nbt_name_socket *nbtsock,
+ struct socket_address *dest,
+ struct nbt_name_packet *request);
+
+
+NDR_SCALAR_PROTO(wrepl_nbt_name, const struct nbt_name *)
+NDR_SCALAR_PROTO(nbt_string, const char *);
+NDR_BUFFER_PROTO(nbt_name, struct nbt_name)
+NTSTATUS nbt_rcode_to_ntstatus(uint8_t rcode);
+
+struct composite_context;
+struct composite_context *nbt_name_register_bcast_send(struct nbt_name_socket *nbtsock,
+ struct nbt_name_register_bcast *io);
+NTSTATUS nbt_name_register_bcast_recv(struct composite_context *c);
+struct composite_context *nbt_name_register_wins_send(struct nbt_name_socket *nbtsock,
+ struct nbt_name_register_wins *io);
+NTSTATUS nbt_name_refresh_wins_recv(struct composite_context *c, TALLOC_CTX *mem_ctx,
+ struct nbt_name_refresh_wins *io);
+struct composite_context *nbt_name_refresh_wins_send(struct nbt_name_socket *nbtsock,
+ struct nbt_name_refresh_wins *io);
+NTSTATUS nbt_name_register_wins_recv(struct composite_context *c, TALLOC_CTX *mem_ctx,
+ struct nbt_name_register_wins *io);
+
#endif /* __LIBNBT_H__ */
diff --git a/source4/libcli/nbt/namequery.c b/source4/libcli/nbt/namequery.c
index e3432bfda1..2e1bcd818b 100644
--- a/source4/libcli/nbt/namequery.c
+++ b/source4/libcli/nbt/namequery.c
@@ -21,6 +21,7 @@
#include "includes.h"
#include "libcli/nbt/libnbt.h"
+#include "libcli/nbt/nbt_proto.h"
#include "lib/socket/socket.h"
#include "param/param.h"
diff --git a/source4/libcli/nbt/namerefresh.c b/source4/libcli/nbt/namerefresh.c
index 1157c110a1..b372e4a3f3 100644
--- a/source4/libcli/nbt/namerefresh.c
+++ b/source4/libcli/nbt/namerefresh.c
@@ -21,6 +21,7 @@
#include "includes.h"
#include "libcli/nbt/libnbt.h"
+#include "libcli/nbt/nbt_proto.h"
#include "libcli/composite/composite.h"
#include "lib/socket/socket.h"
#include "param/param.h"
@@ -86,7 +87,7 @@ failed:
/*
wait for a refresh reply
*/
-NTSTATUS nbt_name_refresh_recv(struct nbt_name_request *req,
+_PUBLIC_ NTSTATUS nbt_name_refresh_recv(struct nbt_name_request *req,
TALLOC_CTX *mem_ctx, struct nbt_name_refresh *io)
{
NTSTATUS status;
@@ -128,7 +129,7 @@ NTSTATUS nbt_name_refresh_recv(struct nbt_name_request *req,
/*
synchronous name refresh request
*/
-NTSTATUS nbt_name_refresh(struct nbt_name_socket *nbtsock,
+_PUBLIC_ NTSTATUS nbt_name_refresh(struct nbt_name_socket *nbtsock,
TALLOC_CTX *mem_ctx, struct nbt_name_refresh *io)
{
struct nbt_name_request *req = nbt_name_refresh_send(nbtsock, io);
@@ -217,7 +218,7 @@ done:
/**
the async send call for a multi-server WINS refresh
*/
-struct composite_context *nbt_name_refresh_wins_send(struct nbt_name_socket *nbtsock,
+_PUBLIC_ struct composite_context *nbt_name_refresh_wins_send(struct nbt_name_socket *nbtsock,
struct nbt_name_refresh_wins *io)
{
struct composite_context *c;
@@ -274,7 +275,7 @@ failed:
/*
multi-homed WINS name refresh - recv side
*/
-NTSTATUS nbt_name_refresh_wins_recv(struct composite_context *c, TALLOC_CTX *mem_ctx,
+_PUBLIC_ NTSTATUS nbt_name_refresh_wins_recv(struct composite_context *c, TALLOC_CTX *mem_ctx,
struct nbt_name_refresh_wins *io)
{
NTSTATUS status;
@@ -292,7 +293,7 @@ NTSTATUS nbt_name_refresh_wins_recv(struct composite_context *c, TALLOC_CTX *mem
/*
multi-homed WINS refresh - sync interface
*/
-NTSTATUS nbt_name_refresh_wins(struct nbt_name_socket *nbtsock,
+_PUBLIC_ NTSTATUS nbt_name_refresh_wins(struct nbt_name_socket *nbtsock,
TALLOC_CTX *mem_ctx,
struct nbt_name_refresh_wins *io)
{
diff --git a/source4/libcli/nbt/nameregister.c b/source4/libcli/nbt/nameregister.c
index 6667564664..9c5ae43d40 100644
--- a/source4/libcli/nbt/nameregister.c
+++ b/source4/libcli/nbt/nameregister.c
@@ -21,6 +21,7 @@
#include "includes.h"
#include "libcli/nbt/libnbt.h"
+#include "libcli/nbt/nbt_proto.h"
#include "libcli/composite/composite.h"
#include "lib/socket/socket.h"
#include "librpc/gen_ndr/ndr_nbt.h"
@@ -94,7 +95,7 @@ failed:
/*
wait for a registration reply
*/
-NTSTATUS nbt_name_register_recv(struct nbt_name_request *req,
+_PUBLIC_ NTSTATUS nbt_name_register_recv(struct nbt_name_request *req,
TALLOC_CTX *mem_ctx, struct nbt_name_register *io)
{
NTSTATUS status;
@@ -136,7 +137,7 @@ NTSTATUS nbt_name_register_recv(struct nbt_name_request *req,
/*
synchronous name registration request
*/
-NTSTATUS nbt_name_register(struct nbt_name_socket *nbtsock,
+_PUBLIC_ NTSTATUS nbt_name_register(struct nbt_name_socket *nbtsock,
TALLOC_CTX *mem_ctx, struct nbt_name_register *io)
{
struct nbt_name_request *req = nbt_name_register_send(nbtsock, io);
@@ -207,7 +208,7 @@ done:
/*
the async send call for a 4 stage name registration
*/
-struct composite_context *nbt_name_register_bcast_send(struct nbt_name_socket *nbtsock,
+_PUBLIC_ struct composite_context *nbt_name_register_bcast_send(struct nbt_name_socket *nbtsock,
struct nbt_name_register_bcast *io)
{
struct composite_context *c;
@@ -256,7 +257,7 @@ failed:
/*
broadcast 4 part name register - recv
*/
-NTSTATUS nbt_name_register_bcast_recv(struct composite_context *c)
+_PUBLIC_ NTSTATUS nbt_name_register_bcast_recv(struct composite_context *c)
{
NTSTATUS status;
status = composite_wait(c);
@@ -355,7 +356,7 @@ done:
/*
the async send call for a multi-server WINS register
*/
-struct composite_context *nbt_name_register_wins_send(struct nbt_name_socket *nbtsock,
+_PUBLIC_ struct composite_context *nbt_name_register_wins_send(struct nbt_name_socket *nbtsock,
struct nbt_name_register_wins *io)
{
struct composite_context *c;
@@ -414,7 +415,7 @@ failed:
/*
multi-homed WINS name register - recv side
*/
-NTSTATUS nbt_name_register_wins_recv(struct composite_context *c, TALLOC_CTX *mem_ctx,
+_PUBLIC_ NTSTATUS nbt_name_register_wins_recv(struct composite_context *c, TALLOC_CTX *mem_ctx,
struct nbt_name_register_wins *io)
{
NTSTATUS status;
@@ -432,7 +433,7 @@ NTSTATUS nbt_name_register_wins_recv(struct composite_context *c, TALLOC_CTX *me
/*
multi-homed WINS register - sync interface
*/
-NTSTATUS nbt_name_register_wins(struct nbt_name_socket *nbtsock,
+_PUBLIC_ NTSTATUS nbt_name_register_wins(struct nbt_name_socket *nbtsock,
TALLOC_CTX *mem_ctx,
struct nbt_name_register_wins *io)
{
diff --git a/source4/libcli/nbt/namerelease.c b/source4/libcli/nbt/namerelease.c
index d735892516..ba3af41752 100644
--- a/source4/libcli/nbt/namerelease.c
+++ b/source4/libcli/nbt/namerelease.c
@@ -21,13 +21,14 @@
#include "includes.h"
#include "libcli/nbt/libnbt.h"
+#include "libcli/nbt/nbt_proto.h"
#include "lib/socket/socket.h"
#include "param/param.h"
/*
send a nbt name release request
*/
-struct nbt_name_request *nbt_name_release_send(struct nbt_name_socket *nbtsock,
+_PUBLIC_ struct nbt_name_request *nbt_name_release_send(struct nbt_name_socket *nbtsock,
struct nbt_name_release *io)
{
struct nbt_name_request *req;
@@ -84,7 +85,7 @@ failed:
/*
wait for a release reply
*/
-NTSTATUS nbt_name_release_recv(struct nbt_name_request *req,
+_PUBLIC_ NTSTATUS nbt_name_release_recv(struct nbt_name_request *req,
TALLOC_CTX *mem_ctx, struct nbt_name_release *io)
{
NTSTATUS status;
@@ -126,7 +127,7 @@ NTSTATUS nbt_name_release_recv(struct nbt_name_request *req,
/*
synchronous name release request
*/
-NTSTATUS nbt_name_release(struct nbt_name_socket *nbtsock,
+_PUBLIC_ NTSTATUS nbt_name_release(struct nbt_name_socket *nbtsock,
TALLOC_CTX *mem_ctx, struct nbt_name_release *io)
{
struct nbt_name_request *req = nbt_name_release_send(nbtsock, io);
diff --git a/source4/libcli/nbt/nbtname.c b/source4/libcli/nbt/nbtname.c
index ae9f3f6b05..0d9073ccbb 100644
--- a/source4/libcli/nbt/nbtname.c
+++ b/source4/libcli/nbt/nbtname.c
@@ -500,7 +500,7 @@ _PUBLIC_ char *nbt_name_string(TALLOC_CTX *mem_ctx, const struct nbt_name *name)
/**
pull a nbt name, WINS Replication uses another on wire format for nbt name
*/
-_PUBLIC_ enum ndr_err_code ndr_pull_wrepl_nbt_name(struct ndr_pull *ndr, int ndr_flags, struct nbt_name **_r)
+_PUBLIC_ enum ndr_err_code ndr_pull_wrepl_nbt_name(struct ndr_pull *ndr, int ndr_flags, const struct nbt_name **_r)
{
struct nbt_name *r;
uint8_t *namebuf;
diff --git a/source4/libcli/nbt/nbtsocket.c b/source4/libcli/nbt/nbtsocket.c
index 95a1643efc..747127980a 100644
--- a/source4/libcli/nbt/nbtsocket.c
+++ b/source4/libcli/nbt/nbtsocket.c
@@ -423,7 +423,7 @@ failed:
/*
send off a nbt name reply
*/
-NTSTATUS nbt_name_reply_send(struct nbt_name_socket *nbtsock,
+_PUBLIC_ NTSTATUS nbt_name_reply_send(struct nbt_name_socket *nbtsock,
struct socket_address *dest,
struct nbt_name_packet *request)
{
@@ -486,7 +486,7 @@ NTSTATUS nbt_name_request_recv(struct nbt_name_request *req)
/*
setup a handler for incoming requests
*/
-NTSTATUS nbt_set_incoming_handler(struct nbt_name_socket *nbtsock,
+_PUBLIC_ NTSTATUS nbt_set_incoming_handler(struct nbt_name_socket *nbtsock,
void (*handler)(struct nbt_name_socket *, struct nbt_name_packet *,
struct socket_address *),
void *private)
@@ -501,7 +501,7 @@ NTSTATUS nbt_set_incoming_handler(struct nbt_name_socket *nbtsock,
/*
turn a NBT rcode into a NTSTATUS
*/
-NTSTATUS nbt_rcode_to_ntstatus(uint8_t rcode)
+_PUBLIC_ NTSTATUS nbt_rcode_to_ntstatus(uint8_t rcode)
{
int i;
struct {
diff --git a/source4/libcli/raw/clierror.c b/source4/libcli/raw/clierror.c
index c515259ee7..157bd847d4 100644
--- a/source4/libcli/raw/clierror.c
+++ b/source4/libcli/raw/clierror.c
@@ -25,7 +25,7 @@
/***************************************************************************
Return an error message from the last response
****************************************************************************/
-const char *smbcli_errstr(struct smbcli_tree *tree)
+_PUBLIC_ const char *smbcli_errstr(struct smbcli_tree *tree)
{
switch (tree->session->transport->error.etype) {
case ETYPE_SMB:
@@ -45,7 +45,7 @@ const char *smbcli_errstr(struct smbcli_tree *tree)
/* Return the 32-bit NT status code from the last packet */
-NTSTATUS smbcli_nt_error(struct smbcli_tree *tree)
+_PUBLIC_ NTSTATUS smbcli_nt_error(struct smbcli_tree *tree)
{
switch (tree->session->transport->error.etype) {
case ETYPE_SMB:
diff --git a/source4/libcli/raw/clioplock.c b/source4/libcli/raw/clioplock.c
index ae4e58ae01..47ffb6dd31 100644
--- a/source4/libcli/raw/clioplock.c
+++ b/source4/libcli/raw/clioplock.c
@@ -19,6 +19,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
/****************************************************************************
send an ack for an oplock break request
diff --git a/source4/libcli/raw/clisession.c b/source4/libcli/raw/clisession.c
index 5a33d9cffc..ad4ca7b471 100644
--- a/source4/libcli/raw/clisession.c
+++ b/source4/libcli/raw/clisession.c
@@ -21,6 +21,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
#include "system/filesys.h"
#include "param/param.h"
@@ -291,7 +292,7 @@ struct smbcli_request *smb_raw_exit_send(struct smbcli_session *session)
/****************************************************************************
Send a exit (sync interface)
*****************************************************************************/
-NTSTATUS smb_raw_exit(struct smbcli_session *session)
+_PUBLIC_ NTSTATUS smb_raw_exit(struct smbcli_session *session)
{
struct smbcli_request *req = smb_raw_exit_send(session);
return smbcli_request_simple_recv(req);
diff --git a/source4/libcli/raw/clisocket.c b/source4/libcli/raw/clisocket.c
index eaa02e1047..1dcf2d1c53 100644
--- a/source4/libcli/raw/clisocket.c
+++ b/source4/libcli/raw/clisocket.c
@@ -170,7 +170,7 @@ NTSTATUS smbcli_sock_connect(TALLOC_CTX *mem_ctx,
/****************************************************************************
mark the socket as dead
****************************************************************************/
-void smbcli_sock_dead(struct smbcli_socket *sock)
+_PUBLIC_ void smbcli_sock_dead(struct smbcli_socket *sock)
{
talloc_free(sock->event.fde);
sock->event.fde = NULL;
@@ -189,7 +189,7 @@ void smbcli_sock_set_options(struct smbcli_socket *sock, const char *options)
/****************************************************************************
resolve a hostname and connect
****************************************************************************/
-struct smbcli_socket *smbcli_sock_connect_byname(const char *host, const char **ports,
+_PUBLIC_ struct smbcli_socket *smbcli_sock_connect_byname(const char *host, const char **ports,
TALLOC_CTX *mem_ctx,
struct resolve_context *resolve_ctx,
struct event_context *event_ctx)
diff --git a/source4/libcli/raw/clitransport.c b/source4/libcli/raw/clitransport.c
index 5c14e9f9b8..34fb96230d 100644
--- a/source4/libcli/raw/clitransport.c
+++ b/source4/libcli/raw/clitransport.c
@@ -21,12 +21,14 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
#include "lib/socket/socket.h"
#include "lib/util/dlinklist.h"
#include "lib/events/events.h"
#include "lib/stream/packet.h"
#include "librpc/gen_ndr/ndr_nbt.h"
#include "param/param.h"
+#include "libcli/nbt/libnbt.h"
/*
@@ -322,7 +324,7 @@ static void idle_handler(struct event_context *ev,
setup the idle handler for a transport
the period is in microseconds
*/
-void smbcli_transport_idle_handler(struct smbcli_transport *transport,
+_PUBLIC_ void smbcli_transport_idle_handler(struct smbcli_transport *transport,
void (*idle_func)(struct smbcli_transport *, void *),
uint64_t period,
void *private)
@@ -502,7 +504,7 @@ error:
process some read/write requests that are pending
return false if the socket is dead
*/
-bool smbcli_transport_process(struct smbcli_transport *transport)
+_PUBLIC_ bool smbcli_transport_process(struct smbcli_transport *transport)
{
NTSTATUS status;
size_t npending;
@@ -599,7 +601,7 @@ void smbcli_transport_send(struct smbcli_request *req)
/****************************************************************************
Send an SMBecho (async send)
*****************************************************************************/
-struct smbcli_request *smb_raw_echo_send(struct smbcli_transport *transport,
+_PUBLIC_ struct smbcli_request *smb_raw_echo_send(struct smbcli_transport *transport,
struct smb_echo *p)
{
struct smbcli_request *req;
diff --git a/source4/libcli/raw/clitree.c b/source4/libcli/raw/clitree.c
index 507bde999a..d5075f9271 100644
--- a/source4/libcli/raw/clitree.c
+++ b/source4/libcli/raw/clitree.c
@@ -22,6 +22,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
#include "libcli/smb_composite/smb_composite.h"
#include "param/param.h"
@@ -33,7 +34,7 @@
/****************************************************************************
Initialize the tree context
****************************************************************************/
-struct smbcli_tree *smbcli_tree_init(struct smbcli_session *session,
+_PUBLIC_ struct smbcli_tree *smbcli_tree_init(struct smbcli_session *session,
TALLOC_CTX *parent_ctx, bool primary)
{
struct smbcli_tree *tree;
@@ -141,7 +142,7 @@ failed:
/****************************************************************************
Send a tconX (sync interface)
****************************************************************************/
-NTSTATUS smb_raw_tcon(struct smbcli_tree *tree, TALLOC_CTX *mem_ctx,
+_PUBLIC_ NTSTATUS smb_raw_tcon(struct smbcli_tree *tree, TALLOC_CTX *mem_ctx,
union smb_tcon *parms)
{
struct smbcli_request *req = smb_raw_tcon_send(tree, parms);
@@ -152,7 +153,7 @@ NTSTATUS smb_raw_tcon(struct smbcli_tree *tree, TALLOC_CTX *mem_ctx,
/****************************************************************************
Send a tree disconnect.
****************************************************************************/
-NTSTATUS smb_tree_disconnect(struct smbcli_tree *tree)
+_PUBLIC_ NTSTATUS smb_tree_disconnect(struct smbcli_tree *tree)
{
struct smbcli_request *req;
diff --git a/source4/libcli/raw/libcliraw.h b/source4/libcli/raw/libcliraw.h
index 0578a9eab1..16a98ad66e 100644
--- a/source4/libcli/raw/libcliraw.h
+++ b/source4/libcli/raw/libcliraw.h
@@ -286,6 +286,80 @@ struct smbcli_request {
}
#include "libcli/raw/interfaces.h"
-#include "libcli/raw/raw_proto.h"
+
+NTSTATUS smb_raw_read_recv(struct smbcli_request *req, union smb_read *parms);
+struct smbcli_request *smb_raw_read_send(struct smbcli_tree *tree, union smb_read *parms);
+NTSTATUS smb_raw_trans_recv(struct smbcli_request *req,
+ TALLOC_CTX *mem_ctx,
+ struct smb_trans2 *parms);
+size_t smb_raw_max_trans_data(struct smbcli_tree *tree, size_t param_size);
+struct smbcli_request *smb_raw_trans_send(struct smbcli_tree *tree, struct smb_trans2 *parms);
+NTSTATUS smbcli_request_destroy(struct smbcli_request *req);
+struct smbcli_request *smb_raw_write_send(struct smbcli_tree *tree, union smb_write *parms);
+struct smbcli_request *smb_raw_close_send(struct smbcli_tree *tree, union smb_close *parms);
+NTSTATUS smb_raw_open_recv(struct smbcli_request *req, TALLOC_CTX *mem_ctx, union smb_open *parms);
+struct smbcli_request *smb_raw_open_send(struct smbcli_tree *tree, union smb_open *parms);
+
+bool smbcli_transport_process(struct smbcli_transport *transport);
+const char *smbcli_errstr(struct smbcli_tree *tree);
+NTSTATUS smb_raw_fsinfo(struct smbcli_tree *tree, TALLOC_CTX *mem_ctx, union smb_fsinfo *fsinfo);
+NTSTATUS smb_raw_pathinfo(struct smbcli_tree *tree, TALLOC_CTX *mem_ctx, union smb_fileinfo *parms);
+NTSTATUS smb_raw_shadow_data(struct smbcli_tree *tree, TALLOC_CTX *mem_ctx, struct smb_shadow_copy *info);
+NTSTATUS smb_raw_fileinfo(struct smbcli_tree *tree, TALLOC_CTX *mem_ctx, union smb_fileinfo *parms);
+struct smbcli_tree *smbcli_tree_init(struct smbcli_session *session, TALLOC_CTX *parent_ctx, bool primary);
+NTSTATUS smb_raw_tcon(struct smbcli_tree *tree, TALLOC_CTX *mem_ctx, union smb_tcon *parms);
+void smbcli_oplock_handler(struct smbcli_transport *transport,
+ bool (*handler)(struct smbcli_transport *, uint16_t, uint16_t, uint8_t, void *),
+ void *private);
+void smbcli_transport_idle_handler(struct smbcli_transport *transport,
+ void (*idle_func)(struct smbcli_transport *, void *),
+ uint64_t period,
+ void *private);
+NTSTATUS smbcli_request_simple_recv(struct smbcli_request *req);
+bool smbcli_oplock_ack(struct smbcli_tree *tree, uint16_t fnum, uint16_t ack_level);
+NTSTATUS smb_raw_open(struct smbcli_tree *tree, TALLOC_CTX *mem_ctx, union smb_open *parms);
+NTSTATUS smb_raw_close(struct smbcli_tree *tree, union smb_close *parms);
+NTSTATUS smb_raw_unlink(struct smbcli_tree *tree, union smb_unlink *parms);
+NTSTATUS smb_raw_chkpath(struct smbcli_tree *tree, union smb_chkpath *parms);
+NTSTATUS smb_raw_mkdir(struct smbcli_tree *tree, union smb_mkdir *parms);
+NTSTATUS smb_raw_rmdir(struct smbcli_tree *tree, struct smb_rmdir *parms);
+NTSTATUS smb_raw_rename(struct smbcli_tree *tree, union smb_rename *parms);
+NTSTATUS smb_raw_seek(struct smbcli_tree *tree, union smb_seek *parms);
+NTSTATUS smb_raw_read(struct smbcli_tree *tree, union smb_read *parms);
+NTSTATUS smb_raw_write(struct smbcli_tree *tree, union smb_write *parms);
+NTSTATUS smb_raw_lock(struct smbcli_tree *tree, union smb_lock *parms);
+NTSTATUS smb_raw_setpathinfo(struct smbcli_tree *tree, union smb_setfileinfo *parms);
+NTSTATUS smb_raw_setfileinfo(struct smbcli_tree *tree, union smb_setfileinfo *parms);
+
+struct smbcli_request *smb_raw_changenotify_send(struct smbcli_tree *tree, union smb_notify *parms);
+NTSTATUS smb_raw_changenotify_recv(struct smbcli_request *req, TALLOC_CTX *mem_ctx, union smb_notify *parms);
+
+NTSTATUS smb_tree_disconnect(struct smbcli_tree *tree);
+NTSTATUS smbcli_nt_error(struct smbcli_tree *tree);
+NTSTATUS smb_raw_exit(struct smbcli_session *session);
+NTSTATUS smb_raw_pathinfo_recv(struct smbcli_request *req,
+ TALLOC_CTX *mem_ctx,
+ union smb_fileinfo *parms);
+struct smbcli_request *smb_raw_pathinfo_send(struct smbcli_tree *tree,
+ union smb_fileinfo *parms);
+struct smbcli_request *smb_raw_setpathinfo_send(struct smbcli_tree *tree,
+ union smb_setfileinfo *parms);
+struct smbcli_request *smb_raw_echo_send(struct smbcli_transport *transport,
+ struct smb_echo *p);
+NTSTATUS smb_raw_search_first(struct smbcli_tree *tree,
+ TALLOC_CTX *mem_ctx,
+ union smb_search_first *io, void *private,
+ smbcli_search_callback callback);
+NTSTATUS smb_raw_flush(struct smbcli_tree *tree, union smb_flush *parms);
+
+NTSTATUS smb_raw_trans(struct smbcli_tree *tree,
+ TALLOC_CTX *mem_ctx,
+ struct smb_trans2 *parms);
+
+struct smbcli_socket *smbcli_sock_connect_byname(const char *host, const char **ports,
+ TALLOC_CTX *mem_ctx,
+ struct resolve_context *resolve_ctx,
+ struct event_context *event_ctx);
+void smbcli_sock_dead(struct smbcli_socket *sock);
#endif /* __LIBCLI_RAW__H__ */
diff --git a/source4/libcli/raw/rawacl.c b/source4/libcli/raw/rawacl.c
index 847d133173..466b94f4a9 100644
--- a/source4/libcli/raw/rawacl.c
+++ b/source4/libcli/raw/rawacl.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
#include "librpc/gen_ndr/ndr_security.h"
#include "param/param.h"
diff --git a/source4/libcli/raw/rawfile.c b/source4/libcli/raw/rawfile.c
index 725034c3a9..3c5c1b742b 100644
--- a/source4/libcli/raw/rawfile.c
+++ b/source4/libcli/raw/rawfile.c
@@ -22,6 +22,7 @@
#include "includes.h"
#include "smb.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
#include "librpc/gen_ndr/ndr_security.h"
#define SETUP_REQUEST(cmd, wct, buflen) do { \
@@ -92,7 +93,7 @@ struct smbcli_request *smb_raw_rename_send(struct smbcli_tree *tree,
/****************************************************************************
Rename a file - sync interface
****************************************************************************/
-NTSTATUS smb_raw_rename(struct smbcli_tree *tree,
+_PUBLIC_ NTSTATUS smb_raw_rename(struct smbcli_tree *tree,
union smb_rename *parms)
{
struct smbcli_request *req = smb_raw_rename_send(tree, parms);
@@ -123,7 +124,7 @@ struct smbcli_request *smb_raw_unlink_send(struct smbcli_tree *tree,
/*
delete a file - sync interface
*/
-NTSTATUS smb_raw_unlink(struct smbcli_tree *tree,
+_PUBLIC_ NTSTATUS smb_raw_unlink(struct smbcli_tree *tree,
union smb_unlink *parms)
{
struct smbcli_request *req = smb_raw_unlink_send(tree, parms);
@@ -201,7 +202,7 @@ struct smbcli_request *smb_raw_mkdir_send(struct smbcli_tree *tree,
/****************************************************************************
Create a directory - sync interface
****************************************************************************/
-NTSTATUS smb_raw_mkdir(struct smbcli_tree *tree,
+_PUBLIC_ NTSTATUS smb_raw_mkdir(struct smbcli_tree *tree,
union smb_mkdir *parms)
{
struct smbcli_request *req = smb_raw_mkdir_send(tree, parms);
@@ -231,7 +232,7 @@ struct smbcli_request *smb_raw_rmdir_send(struct smbcli_tree *tree,
/****************************************************************************
Remove a directory - sync interface
****************************************************************************/
-NTSTATUS smb_raw_rmdir(struct smbcli_tree *tree,
+_PUBLIC_ NTSTATUS smb_raw_rmdir(struct smbcli_tree *tree,
struct smb_rmdir *parms)
{
struct smbcli_request *req = smb_raw_rmdir_send(tree, parms);
@@ -448,7 +449,7 @@ static NTSTATUS smb_raw_t2open_recv(struct smbcli_request *req, TALLOC_CTX *mem_
/****************************************************************************
Open a file - async send
****************************************************************************/
-struct smbcli_request *smb_raw_open_send(struct smbcli_tree *tree, union smb_open *parms)
+_PUBLIC_ struct smbcli_request *smb_raw_open_send(struct smbcli_tree *tree, union smb_open *parms)
{
int len;
struct smbcli_request *req = NULL;
@@ -585,7 +586,7 @@ struct smbcli_request *smb_raw_open_send(struct smbcli_tree *tree, union smb_ope
/****************************************************************************
Open a file - async recv
****************************************************************************/
-NTSTATUS smb_raw_open_recv(struct smbcli_request *req, TALLOC_CTX *mem_ctx, union smb_open *parms)
+_PUBLIC_ NTSTATUS smb_raw_open_recv(struct smbcli_request *req, TALLOC_CTX *mem_ctx, union smb_open *parms)
{
NTSTATUS status;
@@ -720,7 +721,7 @@ failed:
/****************************************************************************
Open a file - sync interface
****************************************************************************/
-NTSTATUS smb_raw_open(struct smbcli_tree *tree, TALLOC_CTX *mem_ctx, union smb_open *parms)
+_PUBLIC_ NTSTATUS smb_raw_open(struct smbcli_tree *tree, TALLOC_CTX *mem_ctx, union smb_open *parms)
{
struct smbcli_request *req = smb_raw_open_send(tree, parms);
return smb_raw_open_recv(req, mem_ctx, parms);
@@ -730,7 +731,7 @@ NTSTATUS smb_raw_open(struct smbcli_tree *tree, TALLOC_CTX *mem_ctx, union smb_o
/****************************************************************************
Close a file - async send
****************************************************************************/
-struct smbcli_request *smb_raw_close_send(struct smbcli_tree *tree, union smb_close *parms)
+_PUBLIC_ struct smbcli_request *smb_raw_close_send(struct smbcli_tree *tree, union smb_close *parms)
{
struct smbcli_request *req = NULL;
@@ -766,7 +767,7 @@ struct smbcli_request *smb_raw_close_send(struct smbcli_tree *tree, union smb_cl
/****************************************************************************
Close a file - sync interface
****************************************************************************/
-NTSTATUS smb_raw_close(struct smbcli_tree *tree, union smb_close *parms)
+_PUBLIC_ NTSTATUS smb_raw_close(struct smbcli_tree *tree, union smb_close *parms)
{
struct smbcli_request *req = smb_raw_close_send(tree, parms);
return smbcli_request_simple_recv(req);
@@ -843,7 +844,7 @@ struct smbcli_request *smb_raw_lock_send(struct smbcli_tree *tree, union smb_loc
/****************************************************************************
Locking calls - sync interface
****************************************************************************/
-NTSTATUS smb_raw_lock(struct smbcli_tree *tree, union smb_lock *parms)
+_PUBLIC_ NTSTATUS smb_raw_lock(struct smbcli_tree *tree, union smb_lock *parms)
{
struct smbcli_request *req = smb_raw_lock_send(tree, parms);
return smbcli_request_simple_recv(req);
@@ -913,7 +914,7 @@ struct smbcli_request *smb_raw_flush_send(struct smbcli_tree *tree, union smb_fl
/****************************************************************************
flush a file - sync interface
****************************************************************************/
-NTSTATUS smb_raw_flush(struct smbcli_tree *tree, union smb_flush *parms)
+_PUBLIC_ NTSTATUS smb_raw_flush(struct smbcli_tree *tree, union smb_flush *parms)
{
struct smbcli_request *req = smb_raw_flush_send(tree, parms);
return smbcli_request_simple_recv(req);
@@ -962,7 +963,7 @@ failed:
/*
seek a file - sync interface
*/
-NTSTATUS smb_raw_seek(struct smbcli_tree *tree,
+_PUBLIC_ NTSTATUS smb_raw_seek(struct smbcli_tree *tree,
union smb_seek *parms)
{
struct smbcli_request *req = smb_raw_seek_send(tree, parms);
diff --git a/source4/libcli/raw/rawfileinfo.c b/source4/libcli/raw/rawfileinfo.c
index ed5475e926..71900be49c 100644
--- a/source4/libcli/raw/rawfileinfo.c
+++ b/source4/libcli/raw/rawfileinfo.c
@@ -21,6 +21,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
#include "librpc/gen_ndr/ndr_security.h"
#include "param/param.h"
@@ -711,7 +712,7 @@ NTSTATUS smb_raw_fileinfo_recv(struct smbcli_request *req,
/****************************************************************************
Query file info (sync interface)
****************************************************************************/
-NTSTATUS smb_raw_fileinfo(struct smbcli_tree *tree,
+_PUBLIC_ NTSTATUS smb_raw_fileinfo(struct smbcli_tree *tree,
TALLOC_CTX *mem_ctx,
union smb_fileinfo *parms)
{
@@ -722,7 +723,7 @@ NTSTATUS smb_raw_fileinfo(struct smbcli_tree *tree,
/****************************************************************************
Query path info (async send)
****************************************************************************/
-struct smbcli_request *smb_raw_pathinfo_send(struct smbcli_tree *tree,
+_PUBLIC_ struct smbcli_request *smb_raw_pathinfo_send(struct smbcli_tree *tree,
union smb_fileinfo *parms)
{
DATA_BLOB data;
@@ -756,7 +757,7 @@ struct smbcli_request *smb_raw_pathinfo_send(struct smbcli_tree *tree,
/****************************************************************************
Query path info (async recv)
****************************************************************************/
-NTSTATUS smb_raw_pathinfo_recv(struct smbcli_request *req,
+_PUBLIC_ NTSTATUS smb_raw_pathinfo_recv(struct smbcli_request *req,
TALLOC_CTX *mem_ctx,
union smb_fileinfo *parms)
{
@@ -767,7 +768,7 @@ NTSTATUS smb_raw_pathinfo_recv(struct smbcli_request *req,
/****************************************************************************
Query path info (sync interface)
****************************************************************************/
-NTSTATUS smb_raw_pathinfo(struct smbcli_tree *tree,
+_PUBLIC_ NTSTATUS smb_raw_pathinfo(struct smbcli_tree *tree,
TALLOC_CTX *mem_ctx,
union smb_fileinfo *parms)
{
diff --git a/source4/libcli/raw/rawfsinfo.c b/source4/libcli/raw/rawfsinfo.c
index bfb5db828e..43a0919e38 100644
--- a/source4/libcli/raw/rawfsinfo.c
+++ b/source4/libcli/raw/rawfsinfo.c
@@ -21,6 +21,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
#include "librpc/gen_ndr/ndr_misc.h"
/****************************************************************************
@@ -326,7 +327,7 @@ failed:
/****************************************************************************
Query FSInfo raw interface (sync interface)
****************************************************************************/
-NTSTATUS smb_raw_fsinfo(struct smbcli_tree *tree,
+_PUBLIC_ NTSTATUS smb_raw_fsinfo(struct smbcli_tree *tree,
TALLOC_CTX *mem_ctx,
union smb_fsinfo *fsinfo)
{
diff --git a/source4/libcli/raw/rawioctl.c b/source4/libcli/raw/rawioctl.c
index 957e554c6b..77c7b03f15 100644
--- a/source4/libcli/raw/rawioctl.c
+++ b/source4/libcli/raw/rawioctl.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
#define SETUP_REQUEST(cmd, wct, buflen) do { \
req = smbcli_request_setup(tree, cmd, wct, buflen); \
@@ -163,7 +164,7 @@ NTSTATUS smb_raw_ioctl_recv(struct smbcli_request *req,
/*
send a raw ioctl - sync interface
*/
-_PUBLIC_ NTSTATUS smb_raw_ioctl(struct smbcli_tree *tree,
+NTSTATUS smb_raw_ioctl(struct smbcli_tree *tree,
TALLOC_CTX *mem_ctx, union smb_ioctl *parms)
{
struct smbcli_request *req;
diff --git a/source4/libcli/raw/rawnegotiate.c b/source4/libcli/raw/rawnegotiate.c
index 6c16935f21..f0de4b48bd 100644
--- a/source4/libcli/raw/rawnegotiate.c
+++ b/source4/libcli/raw/rawnegotiate.c
@@ -22,6 +22,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
#include "system/time.h"
#include "param/param.h"
diff --git a/source4/libcli/raw/rawnotify.c b/source4/libcli/raw/rawnotify.c
index 91a12a8618..bf7578d7fc 100644
--- a/source4/libcli/raw/rawnotify.c
+++ b/source4/libcli/raw/rawnotify.c
@@ -19,12 +19,13 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
#include "lib/util/dlinklist.h"
/****************************************************************************
change notify (async send)
****************************************************************************/
-struct smbcli_request *smb_raw_changenotify_send(struct smbcli_tree *tree, union smb_notify *parms)
+_PUBLIC_ struct smbcli_request *smb_raw_changenotify_send(struct smbcli_tree *tree, union smb_notify *parms)
{
struct smb_nttrans nt;
uint8_t setup[8];
@@ -51,7 +52,7 @@ struct smbcli_request *smb_raw_changenotify_send(struct smbcli_tree *tree, union
/****************************************************************************
change notify (async recv)
****************************************************************************/
-NTSTATUS smb_raw_changenotify_recv(struct smbcli_request *req,
+_PUBLIC_ NTSTATUS smb_raw_changenotify_recv(struct smbcli_request *req,
TALLOC_CTX *mem_ctx, union smb_notify *parms)
{
struct smb_nttrans nt;
diff --git a/source4/libcli/raw/rawreadwrite.c b/source4/libcli/raw/rawreadwrite.c
index 9e4edaf99c..a8c7996310 100644
--- a/source4/libcli/raw/rawreadwrite.c
+++ b/source4/libcli/raw/rawreadwrite.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
#define SETUP_REQUEST(cmd, wct, buflen) do { \
req = smbcli_request_setup(tree, cmd, wct, buflen); \
@@ -29,7 +30,7 @@
/****************************************************************************
low level read operation (async send)
****************************************************************************/
-struct smbcli_request *smb_raw_read_send(struct smbcli_tree *tree, union smb_read *parms)
+_PUBLIC_ struct smbcli_request *smb_raw_read_send(struct smbcli_tree *tree, union smb_read *parms)
{
bool bigoffset = false;
struct smbcli_request *req = NULL;
@@ -115,7 +116,7 @@ struct smbcli_request *smb_raw_read_send(struct smbcli_tree *tree, union smb_rea
/****************************************************************************
low level read operation (async recv)
****************************************************************************/
-NTSTATUS smb_raw_read_recv(struct smbcli_request *req, union smb_read *parms)
+_PUBLIC_ NTSTATUS smb_raw_read_recv(struct smbcli_request *req, union smb_read *parms)
{
if (!smbcli_request_receive(req) ||
smbcli_request_is_error(req)) {
@@ -197,7 +198,7 @@ failed:
/****************************************************************************
low level read operation (sync interface)
****************************************************************************/
-NTSTATUS smb_raw_read(struct smbcli_tree *tree, union smb_read *parms)
+_PUBLIC_ NTSTATUS smb_raw_read(struct smbcli_tree *tree, union smb_read *parms)
{
struct smbcli_request *req = smb_raw_read_send(tree, parms);
return smb_raw_read_recv(req, parms);
@@ -207,7 +208,7 @@ NTSTATUS smb_raw_read(struct smbcli_tree *tree, union smb_read *parms)
/****************************************************************************
raw write interface (async send)
****************************************************************************/
-struct smbcli_request *smb_raw_write_send(struct smbcli_tree *tree, union smb_write *parms)
+_PUBLIC_ struct smbcli_request *smb_raw_write_send(struct smbcli_tree *tree, union smb_write *parms)
{
bool bigoffset = false;
struct smbcli_request *req = NULL;
@@ -341,7 +342,7 @@ failed:
/****************************************************************************
raw write interface (sync interface)
****************************************************************************/
-NTSTATUS smb_raw_write(struct smbcli_tree *tree, union smb_write *parms)
+_PUBLIC_ NTSTATUS smb_raw_write(struct smbcli_tree *tree, union smb_write *parms)
{
struct smbcli_request *req = smb_raw_write_send(tree, parms);
return smb_raw_write_recv(req, parms);
diff --git a/source4/libcli/raw/rawrequest.c b/source4/libcli/raw/rawrequest.c
index 355d092583..a42c710547 100644
--- a/source4/libcli/raw/rawrequest.c
+++ b/source4/libcli/raw/rawrequest.c
@@ -24,9 +24,12 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
#include "lib/util/dlinklist.h"
#include "lib/events/events.h"
#include "param/param.h"
+#include "librpc/ndr/libndr.h"
+#include "librpc/gen_ndr/ndr_misc.h"
/* we over allocate the data buffer to prevent too many realloc calls */
#define REQ_OVER_ALLOCATION 0
@@ -49,7 +52,7 @@ void smb_setup_bufinfo(struct smbcli_request *req)
/* destroy a request structure and return final status */
-NTSTATUS smbcli_request_destroy(struct smbcli_request *req)
+_PUBLIC_ NTSTATUS smbcli_request_destroy(struct smbcli_request *req)
{
NTSTATUS status;
@@ -405,7 +408,7 @@ bool smbcli_handle_oplock_break(struct smbcli_transport *transport, uint_t len,
wait for a reply to be received for a packet that just returns an error
code and nothing more
*/
-NTSTATUS smbcli_request_simple_recv(struct smbcli_request *req)
+_PUBLIC_ NTSTATUS smbcli_request_simple_recv(struct smbcli_request *req)
{
(void) smbcli_request_receive(req);
return smbcli_request_destroy(req);
diff --git a/source4/libcli/raw/rawsearch.c b/source4/libcli/raw/rawsearch.c
index fb2b09467c..99141574e2 100644
--- a/source4/libcli/raw/rawsearch.c
+++ b/source4/libcli/raw/rawsearch.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
/****************************************************************************
Old style search backend - process output.
@@ -718,7 +719,7 @@ static NTSTATUS smb_raw_t2search_backend(struct smbcli_tree *tree,
/* Implements trans2findfirst2 and old search
*/
-NTSTATUS smb_raw_search_first(struct smbcli_tree *tree,
+_PUBLIC_ NTSTATUS smb_raw_search_first(struct smbcli_tree *tree,
TALLOC_CTX *mem_ctx,
union smb_search_first *io, void *private,
smbcli_search_callback callback)
diff --git a/source4/libcli/raw/rawsetfileinfo.c b/source4/libcli/raw/rawsetfileinfo.c
index f1e4ee3686..16052e8708 100644
--- a/source4/libcli/raw/rawsetfileinfo.c
+++ b/source4/libcli/raw/rawsetfileinfo.c
@@ -21,6 +21,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
#include "librpc/gen_ndr/ndr_security.h"
@@ -409,7 +410,7 @@ struct smbcli_request *smb_raw_setfileinfo_send(struct smbcli_tree *tree,
/****************************************************************************
Set file info (async send)
****************************************************************************/
-NTSTATUS smb_raw_setfileinfo(struct smbcli_tree *tree,
+_PUBLIC_ NTSTATUS smb_raw_setfileinfo(struct smbcli_tree *tree,
union smb_setfileinfo *parms)
{
struct smbcli_request *req = smb_raw_setfileinfo_send(tree, parms);
@@ -420,7 +421,7 @@ NTSTATUS smb_raw_setfileinfo(struct smbcli_tree *tree,
/****************************************************************************
Set path info (async send)
****************************************************************************/
-struct smbcli_request *smb_raw_setpathinfo_send(struct smbcli_tree *tree,
+_PUBLIC_ struct smbcli_request *smb_raw_setpathinfo_send(struct smbcli_tree *tree,
union smb_setfileinfo *parms)
{
DATA_BLOB blob;
@@ -456,7 +457,7 @@ struct smbcli_request *smb_raw_setpathinfo_send(struct smbcli_tree *tree,
/****************************************************************************
Set path info (sync interface)
****************************************************************************/
-NTSTATUS smb_raw_setpathinfo(struct smbcli_tree *tree,
+_PUBLIC_ NTSTATUS smb_raw_setpathinfo(struct smbcli_tree *tree,
union smb_setfileinfo *parms)
{
struct smbcli_request *req = smb_raw_setpathinfo_send(tree, parms);
diff --git a/source4/libcli/raw/rawshadow.c b/source4/libcli/raw/rawshadow.c
index 4c58c91383..b318c3e025 100644
--- a/source4/libcli/raw/rawshadow.c
+++ b/source4/libcli/raw/rawshadow.c
@@ -21,6 +21,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
#include "libcli/raw/ioctl.h"
/*
diff --git a/source4/libcli/raw/rawtrans.c b/source4/libcli/raw/rawtrans.c
index 53670d22a3..29881afd2b 100644
--- a/source4/libcli/raw/rawtrans.c
+++ b/source4/libcli/raw/rawtrans.c
@@ -21,6 +21,7 @@
#include "includes.h"
#include "lib/util/dlinklist.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
#define TORTURE_TRANS_DATA 0
@@ -192,7 +193,7 @@ failed:
return smbcli_request_destroy(req);
}
-NTSTATUS smb_raw_trans_recv(struct smbcli_request *req,
+_PUBLIC_ NTSTATUS smb_raw_trans_recv(struct smbcli_request *req,
TALLOC_CTX *mem_ctx,
struct smb_trans2 *parms)
{
@@ -365,7 +366,7 @@ struct smbcli_request *smb_raw_trans_send_backend(struct smbcli_tree *tree,
trans/trans2 raw async interface - only BLOBs used in this interface.
note that this doesn't yet support multi-part requests
*/
-struct smbcli_request *smb_raw_trans_send(struct smbcli_tree *tree,
+_PUBLIC_ struct smbcli_request *smb_raw_trans_send(struct smbcli_tree *tree,
struct smb_trans2 *parms)
{
return smb_raw_trans_send_backend(tree, parms, SMBtrans);
@@ -394,7 +395,7 @@ NTSTATUS smb_raw_trans2(struct smbcli_tree *tree,
/*
trans synchronous blob interface
*/
-NTSTATUS smb_raw_trans(struct smbcli_tree *tree,
+_PUBLIC_ NTSTATUS smb_raw_trans(struct smbcli_tree *tree,
TALLOC_CTX *mem_ctx,
struct smb_trans2 *parms)
{
@@ -631,7 +632,7 @@ NTSTATUS smb_raw_nttrans(struct smbcli_tree *tree,
TODO: we only need to avoid multi-part replies because the
multi-part trans receive code is broken.
*/
-size_t smb_raw_max_trans_data(struct smbcli_tree *tree, size_t param_size)
+_PUBLIC_ size_t smb_raw_max_trans_data(struct smbcli_tree *tree, size_t param_size)
{
return tree->session->transport->negotiate.max_xmit - (70 + param_size);
}
diff --git a/source4/libcli/raw/smb_signing.c b/source4/libcli/raw/smb_signing.c
index 4acfb9d16d..97bb688d1a 100644
--- a/source4/libcli/raw/smb_signing.c
+++ b/source4/libcli/raw/smb_signing.c
@@ -22,6 +22,7 @@
#include "includes.h"
#include "smb.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
#include "lib/crypto/crypto.h"
#include "param/param.h"
diff --git a/source4/libcli/smb2/close.c b/source4/libcli/smb2/close.c
index 04c0c85499..4e6f33095f 100644
--- a/source4/libcli/smb2/close.c
+++ b/source4/libcli/smb2/close.c
@@ -21,6 +21,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
#include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h"
diff --git a/source4/libcli/smb2/connect.c b/source4/libcli/smb2/connect.c
index 85ddafc031..d68b85ad54 100644
--- a/source4/libcli/smb2/connect.c
+++ b/source4/libcli/smb2/connect.c
@@ -21,6 +21,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
#include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h"
#include "libcli/composite/composite.h"
diff --git a/source4/libcli/smb2/create.c b/source4/libcli/smb2/create.c
index cca83a040c..999c10ab08 100644
--- a/source4/libcli/smb2/create.c
+++ b/source4/libcli/smb2/create.c
@@ -21,6 +21,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
#include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h"
diff --git a/source4/libcli/smb2/find.c b/source4/libcli/smb2/find.c
index 6d0a9c8072..6b4902a026 100644
--- a/source4/libcli/smb2/find.c
+++ b/source4/libcli/smb2/find.c
@@ -21,6 +21,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
#include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h"
diff --git a/source4/libcli/smb2/getinfo.c b/source4/libcli/smb2/getinfo.c
index e9f47140f5..b462bab1de 100644
--- a/source4/libcli/smb2/getinfo.c
+++ b/source4/libcli/smb2/getinfo.c
@@ -21,6 +21,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
#include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h"
diff --git a/source4/libcli/smb2/negprot.c b/source4/libcli/smb2/negprot.c
index 6b879e2add..c1f0cf0b24 100644
--- a/source4/libcli/smb2/negprot.c
+++ b/source4/libcli/smb2/negprot.c
@@ -21,8 +21,10 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
#include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h"
+#include "librpc/ndr/libndr.h"
/*
send a negprot request
diff --git a/source4/libcli/smb2/notify.c b/source4/libcli/smb2/notify.c
index e7c38a27f9..096d790a31 100644
--- a/source4/libcli/smb2/notify.c
+++ b/source4/libcli/smb2/notify.c
@@ -21,6 +21,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
#include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h"
diff --git a/source4/libcli/smb2/setinfo.c b/source4/libcli/smb2/setinfo.c
index a6e22d9a68..69c0f45b63 100644
--- a/source4/libcli/smb2/setinfo.c
+++ b/source4/libcli/smb2/setinfo.c
@@ -21,6 +21,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
#include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h"
diff --git a/source4/libcli/smb2/transport.c b/source4/libcli/smb2/transport.c
index 1d601fdbfe..af19fcb0a9 100644
--- a/source4/libcli/smb2/transport.c
+++ b/source4/libcli/smb2/transport.c
@@ -21,6 +21,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
#include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h"
#include "lib/socket/socket.h"
diff --git a/source4/libcli/smb_composite/appendacl.c b/source4/libcli/smb_composite/appendacl.c
index 0fda8c4d65..1f06b96e75 100644
--- a/source4/libcli/smb_composite/appendacl.c
+++ b/source4/libcli/smb_composite/appendacl.c
@@ -1,5 +1,6 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
#include "libcli/composite/composite.h"
#include "libcli/security/security.h"
#include "libcli/smb_composite/smb_composite.h"
diff --git a/source4/libcli/smb_composite/connect.c b/source4/libcli/smb_composite/connect.c
index 22573442a2..c44c62f868 100644
--- a/source4/libcli/smb_composite/connect.c
+++ b/source4/libcli/smb_composite/connect.c
@@ -22,6 +22,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
#include "libcli/composite/composite.h"
#include "libcli/smb_composite/smb_composite.h"
#include "lib/events/events.h"
diff --git a/source4/libcli/smb_composite/fsinfo.c b/source4/libcli/smb_composite/fsinfo.c
index e4dd4436ba..2ec13df9b6 100644
--- a/source4/libcli/smb_composite/fsinfo.c
+++ b/source4/libcli/smb_composite/fsinfo.c
@@ -4,6 +4,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
#include "libcli/composite/composite.h"
#include "libcli/smb_composite/smb_composite.h"
#include "param/param.h"
diff --git a/source4/libcli/smb_composite/savefile.c b/source4/libcli/smb_composite/savefile.c
index b94be9e9b1..f02ca46f06 100644
--- a/source4/libcli/smb_composite/savefile.c
+++ b/source4/libcli/smb_composite/savefile.c
@@ -22,6 +22,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
#include "libcli/composite/composite.h"
#include "libcli/smb_composite/smb_composite.h"
diff --git a/source4/libcli/smb_composite/sesssetup.c b/source4/libcli/smb_composite/sesssetup.c
index 75a2a579a2..1427fe525b 100644
--- a/source4/libcli/smb_composite/sesssetup.c
+++ b/source4/libcli/smb_composite/sesssetup.c
@@ -22,8 +22,10 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
#include "libcli/composite/composite.h"
#include "libcli/smb_composite/smb_composite.h"
+#include "libcli/smb_composite/proto.h"
#include "libcli/auth/libcli_auth.h"
#include "auth/auth.h"
#include "auth/gensec/gensec.h"
diff --git a/source4/libcli/util/error.h b/source4/libcli/util/error.h
index e054948fbe..84255448a0 100644
--- a/source4/libcli/util/error.h
+++ b/source4/libcli/util/error.h
@@ -22,7 +22,6 @@
#include "libcli/util/werror.h"
#include "libcli/util/doserr.h"
#include "libcli/util/ntstatus.h"
-#include "librpc/ndr/libndr.h"
/** NT error on DOS connection! (NT_STATUS_OK) */
bool ntstatus_dos_equal(NTSTATUS status1, NTSTATUS status2);
@@ -47,6 +46,8 @@ WERROR ntstatus_to_werror(NTSTATUS error);
*********************************************************************/
NTSTATUS map_nt_error_from_unix(int unix_error);
+enum ndr_err_code;
+
/*********************************************************************
Map an NT error code from a NDR error code.
*********************************************************************/
diff --git a/source4/libcli/util/errormap.c b/source4/libcli/util/errormap.c
index b8458d4bf3..2257955c76 100644
--- a/source4/libcli/util/errormap.c
+++ b/source4/libcli/util/errormap.c
@@ -21,6 +21,7 @@
#include "includes.h"
#include "param/param.h"
+#include "librpc/ndr/libndr.h"
/* This map was extracted by the ERRMAPEXTRACT smbtorture command.
The setup was a Samba HEAD (2002-01-03) PDC and an Win2k member