s3:param: Correctly set up cli_maxprotocol, cli_minprotocol in our parameter block.

Set to PROTOCOL_NT1, PROTOCOL_CORE by default.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=9829

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
s3:client: avoid interpret_protocol()

lp_set_cmdline("client max protocol",...) and
lp_cli_maxprotocol() are the more generic solution.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
s3:torture: avoid interpret_protocol()

lp_set_cmdline("client max protocol",...) and
lp_cli_maxprotocol() are the more generic solution.

https://bugzilla.samba.org/show_bug.cgi?id=9514

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
s3:lib: remove unused interpret_protocol()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
s3:libsmb: Modify cli_start_connection_connected() to use lp_cli_minprotocol()/lp_cli_maxprotocol() instead of hard coding PROTOCOL_CORE, PROTOCOL_NT1.

https://bugzilla.samba.org/show_bug.cgi?id=9514

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
s3:libsmb: Ensure we ask for DEFAULT_SMB2_MAX_CREDITS on successful negprot.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
s3:lib/netapi: make use of lp_cli_maxprotocol()

https://bugzilla.samba.org/show_bug.cgi?id=9514

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
s3:winbindd: make use of lp_cli_{min,max}protocol()

This changes winbindd back to use NT1 as defeault.

https://bugzilla.samba.org/show_bug.cgi?id=9514

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
s3:libsmb: use lp_cli_minprotocol() in do_connect()

https://bugzilla.samba.org/show_bug.cgi?id=9514

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
s3:libsmb: make use of lp_cli_{min,max}protocol() in SMBC_server_internal()

https://bugzilla.samba.org/show_bug.cgi?id=9514

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
s3:smbcacls: Add -m<MAX PROTOCOL> option to smbcacls.

https://bugzilla.samba.org/show_bug.cgi?id=9514

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
libcli/smb: fix the credit handling on a SMB1 => SMB2 negotiate

Our cur_credit value had 1 credit too many in the case of
an SMB1 => SMB2 upgrade. When we max out the credits the server
disconnected the connection.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
libcli/smb: Fix smb2cli_write_recv() and smb2cli_write() to return the bytes written.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
libcli/smb: Change smb2cli_create() and smb2cli_create_recv() to return a parameter blob of the newly opened/created file.

Will use in the smb2 client code.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
libcli/smb: calculate the credit charge on the input and output dyn_len

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
libcli/smb: pass max_dyn_len to smb2cli_req_create()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
libcli/smb: pass max_dyn_len to smb2cli_req_send()

This way we can calculate the correct credit charge
for requests with large output buffers.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
libcli/smb: add smb1cli_conn_req_possible()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
libcli/smb: add smb2cli_conn_req_possible()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
s3:libsmb: rewrite cli_push* to use smb1cli_conn_req_possible()

This works out if it's possible to ship the next request dynamically
instead of relying on fixed values.

The default window size is 16 MByte.

We limit the number of outstanding chunks/requests to 256.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>