mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +03:00
libcli/smb: add smb2cli_conn_req_possible()
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
111f529a2a
commit
7efdc323d1
@ -2453,6 +2453,28 @@ bool smbXcli_conn_has_async_calls(struct smbXcli_conn *conn)
|
||||
|| (talloc_array_length(conn->pending) != 0));
|
||||
}
|
||||
|
||||
bool smb2cli_conn_req_possible(struct smbXcli_conn *conn, uint32_t *max_dyn_len)
|
||||
{
|
||||
uint16_t credits = 1;
|
||||
|
||||
if (conn->smb2.cur_credits == 0) {
|
||||
if (max_dyn_len != NULL) {
|
||||
*max_dyn_len = 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if (conn->smb2.server.capabilities & SMB2_CAP_LARGE_MTU) {
|
||||
credits = conn->smb2.cur_credits;
|
||||
}
|
||||
|
||||
if (max_dyn_len != NULL) {
|
||||
*max_dyn_len = credits * 65536;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32_t smb2cli_conn_server_capabilities(struct smbXcli_conn *conn)
|
||||
{
|
||||
return conn->smb2.server.capabilities;
|
||||
|
@ -199,6 +199,7 @@ NTSTATUS smb1cli_echo_recv(struct tevent_req *req);
|
||||
NTSTATUS smb1cli_echo(struct smbXcli_conn *conn, uint32_t timeout_msec,
|
||||
uint16_t num_echos, DATA_BLOB data);
|
||||
|
||||
bool smb2cli_conn_req_possible(struct smbXcli_conn *conn, uint32_t *max_dyn_len);
|
||||
uint32_t smb2cli_conn_server_capabilities(struct smbXcli_conn *conn);
|
||||
uint16_t smb2cli_conn_server_security_mode(struct smbXcli_conn *conn);
|
||||
uint32_t smb2cli_conn_max_trans_size(struct smbXcli_conn *conn);
|
||||
|
Loading…
x
Reference in New Issue
Block a user