summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-10-12 01:46:15 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-10-12 01:46:15 +0200
commit348be5f1e44c0b17ff87a8964a36e83b291a6518 (patch)
treeba17e6f8898397238f9da4eaacbc2e4a01646619 /source3/include
parent218f482fbfe96b2cddec8c05f6b8f174481d2e27 (diff)
downloadsamba-348be5f1e44c0b17ff87a8964a36e83b291a6518.tar.gz
samba-348be5f1e44c0b17ff87a8964a36e83b291a6518.tar.bz2
samba-348be5f1e44c0b17ff87a8964a36e83b291a6518.zip
Share data_blob implementation.
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/includes.h1
-rw-r--r--source3/include/messages.h7
-rw-r--r--source3/include/packet.h4
-rw-r--r--source3/include/proto.h12
-rw-r--r--source3/include/smb.h9
5 files changed, 6 insertions, 27 deletions
diff --git a/source3/include/includes.h b/source3/include/includes.h
index 2935a26f50..b78a2abaf4 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -654,6 +654,7 @@ typedef char fstring[FSTRING_LEN];
#include "../talloc/talloc.h"
+#include "../lib/util/data_blob.h"
#include "../lib/util/time.h"
/* And a little extension. Abort on type mismatch */
#define talloc_get_type_abort(ptr, type) \
diff --git a/source3/include/messages.h b/source3/include/messages.h
index db805a2093..785f116e1c 100644
--- a/source3/include/messages.h
+++ b/source3/include/messages.h
@@ -82,7 +82,6 @@ struct server_id {
struct messaging_context;
struct messaging_rec;
-struct data_blob;
/*
* struct messaging_context belongs to messages.c, but because we still have
@@ -102,7 +101,7 @@ struct messaging_context {
struct messaging_backend {
NTSTATUS (*send_fn)(struct messaging_context *msg_ctx,
struct server_id pid, int msg_type,
- const struct data_blob *data,
+ const DATA_BLOB *data,
struct messaging_backend *backend);
void *private_data;
};
@@ -138,12 +137,12 @@ NTSTATUS messaging_register(struct messaging_context *msg_ctx,
void *private_data,
uint32_t msg_type,
struct server_id server_id,
- struct data_blob *data));
+ DATA_BLOB *data));
void messaging_deregister(struct messaging_context *ctx, uint32_t msg_type,
void *private_data);
NTSTATUS messaging_send(struct messaging_context *msg_ctx,
struct server_id server,
- uint32_t msg_type, const struct data_blob *data);
+ uint32_t msg_type, const DATA_BLOB *data);
NTSTATUS messaging_send_buf(struct messaging_context *msg_ctx,
struct server_id server, uint32_t msg_type,
const uint8 *buf, size_t len);
diff --git a/source3/include/packet.h b/source3/include/packet.h
index d5174229ca..05974da8fc 100644
--- a/source3/include/packet.h
+++ b/source3/include/packet.h
@@ -46,10 +46,10 @@ NTSTATUS packet_fd_read_sync(struct packet_context *ctx);
* Otherwise return True and store the callback result in *status
*/
bool packet_handler(struct packet_context *ctx,
- bool (*full_req)(const struct data_blob *data,
+ bool (*full_req)(const DATA_BLOB *data,
size_t *length,
void *private_data),
- NTSTATUS (*callback)(const struct data_blob *data,
+ NTSTATUS (*callback)(const DATA_BLOB *data,
void *private_data),
void *private_data,
NTSTATUS *status);
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 34db104905..3a7400657e 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -435,18 +435,6 @@ int connections_forall(int (*fn)(struct db_record *rec,
void *private_data);
bool connections_init(bool rw);
-/* The following definitions come from lib/data_blob.c */
-
-DATA_BLOB data_blob(const void *p, size_t length);
-DATA_BLOB data_blob_talloc(TALLOC_CTX *mem_ctx, const void *p, size_t length);
-void data_blob_free(DATA_BLOB *d);
-void data_blob_clear(DATA_BLOB *d);
-void data_blob_clear_free(DATA_BLOB *d);
-DATA_BLOB data_blob_string_const(const char *str);
-DATA_BLOB data_blob_const(const void *p, size_t length);
-DATA_BLOB data_blob_talloc_zero(TALLOC_CTX *mem_ctx, size_t length);
-_PUBLIC_ char *data_blob_hex_string(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob);
-
/* The following definitions come from lib/dbwrap_util.c */
int32_t dbwrap_fetch_int32(struct db_context *db, const char *keystr);
diff --git a/source3/include/smb.h b/source3/include/smb.h
index 5062529ade..6aca7526fd 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -246,15 +246,6 @@ struct id_map {
enum id_mapping status;
};
-/* used to hold an arbitrary blob of data */
-typedef struct data_blob {
- uint8 *data;
- size_t length;
- void (*free)(struct data_blob *data_blob);
-} DATA_BLOB;
-
-extern const DATA_BLOB data_blob_null;
-
#include "librpc/gen_ndr/misc.h"
#include "librpc/gen_ndr/security.h"
#include "librpc/ndr/libndr.h"