summaryrefslogtreecommitdiff
path: root/libcli/smb
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-08-12 20:38:45 +0200
committerStefan Metzmacher <metze@samba.org>2009-08-15 10:46:35 +0200
commite2845b808997787701e54d2602c0ef08f9c4cff7 (patch)
treebc6943f93a964a7170df7be051a511e4715ad3ee /libcli/smb
parenta023b6c64b4e1516c2506f028b0e653028970de3 (diff)
downloadsamba-e2845b808997787701e54d2602c0ef08f9c4cff7.tar.gz
samba-e2845b808997787701e54d2602c0ef08f9c4cff7.tar.bz2
samba-e2845b808997787701e54d2602c0ef08f9c4cff7.zip
libcli/smb: add smb2_create_blob_find()
metze
Diffstat (limited to 'libcli/smb')
-rw-r--r--libcli/smb/smb2_create_blob.c17
-rw-r--r--libcli/smb/smb2_create_blob.h6
2 files changed, 23 insertions, 0 deletions
diff --git a/libcli/smb/smb2_create_blob.c b/libcli/smb/smb2_create_blob.c
index 0dad2240d0..444dc840af 100644
--- a/libcli/smb/smb2_create_blob.c
+++ b/libcli/smb/smb2_create_blob.c
@@ -184,3 +184,20 @@ NTSTATUS smb2_create_blob_add(TALLOC_CTX *mem_ctx, struct smb2_create_blobs *b,
return NT_STATUS_OK;
}
+
+/*
+ * return the first blob with the given tag
+ */
+struct smb2_create_blob *smb2_create_blob_find(const struct smb2_create_blobs *b,
+ const char *tag)
+{
+ uint32_t i;
+
+ for (i=0; i < b->num_blobs; i++) {
+ if (strcmp(b->blobs[i].tag, tag) == 0) {
+ return &b->blobs[i];
+ }
+ }
+
+ return NULL;
+}
diff --git a/libcli/smb/smb2_create_blob.h b/libcli/smb/smb2_create_blob.h
index e8b8f12fe3..008befe41a 100644
--- a/libcli/smb/smb2_create_blob.h
+++ b/libcli/smb/smb2_create_blob.h
@@ -48,4 +48,10 @@ NTSTATUS smb2_create_blob_push(TALLOC_CTX *mem_ctx, DATA_BLOB *buffer,
NTSTATUS smb2_create_blob_add(TALLOC_CTX *mem_ctx, struct smb2_create_blobs *b,
const char *tag, DATA_BLOB data);
+/*
+ * return the first blob with the given tag
+ */
+struct smb2_create_blob *smb2_create_blob_find(const struct smb2_create_blobs *b,
+ const char *tag);
+
#endif /* _LIBCLI_SMB_SMB2_CREATE_BLOB_H_ */