summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/libsmb/clientgen.c13
-rw-r--r--source3/libsmb/proto.h1
2 files changed, 14 insertions, 0 deletions
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index f274dc0b63..21ecab840a 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -501,6 +501,19 @@ uint32_t cli_state_capabilities(struct cli_state *cli)
return cli->capabilities;
}
+uint32_t cli_state_available_size(struct cli_state *cli, uint32_t ofs)
+{
+ uint32_t ret = cli->max_xmit;
+
+ if (ofs >= ret) {
+ return 0;
+ }
+
+ ret -= ofs;
+
+ return ret;
+}
+
struct cli_echo_state {
uint16_t vwv[1];
DATA_BLOB data;
diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h
index 83da457b53..c618fda2b1 100644
--- a/source3/libsmb/proto.h
+++ b/source3/libsmb/proto.h
@@ -180,6 +180,7 @@ uint16_t cli_state_set_uid(struct cli_state *cli, uint16_t uid);
bool cli_set_case_sensitive(struct cli_state *cli, bool case_sensitive);
enum protocol_types cli_state_protocol(struct cli_state *cli);
uint32_t cli_state_capabilities(struct cli_state *cli);
+uint32_t cli_state_available_size(struct cli_state *cli, uint32_t ofs);
struct tevent_req *cli_echo_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
struct cli_state *cli, uint16_t num_echos,
DATA_BLOB data);