diff options
author | Stefan Metzmacher <metze@samba.org> | 2005-11-18 08:44:36 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:46:25 -0500 |
commit | 799724aae7f431ef721b15745a89f01b12b10d9c (patch) | |
tree | 11545355e8affa62c89aa00a94065d9eb0d24505 /source4/smb_server/receive.c | |
parent | d931455e6e627511935fc82d2c6bc4e23743ebc3 (diff) | |
download | samba-799724aae7f431ef721b15745a89f01b12b10d9c.tar.gz samba-799724aae7f431ef721b15745a89f01b12b10d9c.tar.xz samba-799724aae7f431ef721b15745a89f01b12b10d9c.zip |
r11774: - move SMB specific initialisation of the smbsrv_connection out of smb_server.c
- add a generic incoming packet handler, which handles the first incoming packet
and passes to the protocol specifc packet handler
metze
(This used to be commit f89deac1cb8a7e5651116d96b9a94d5cc8293076)
Diffstat (limited to 'source4/smb_server/receive.c')
-rw-r--r-- | source4/smb_server/receive.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/source4/smb_server/receive.c b/source4/smb_server/receive.c index 371333b647..aa54d9867e 100644 --- a/source4/smb_server/receive.c +++ b/source4/smb_server/receive.c @@ -625,3 +625,33 @@ error: SSVAL(req->out.vwv, VWV(1), 0); req_reply_dos_error(req, ERRSRV, ERRerror); } + +/* + * init the SMB protocol related stuff + */ +NTSTATUS smbsrv_init_smb_connection(struct smbsrv_connection *smb_conn) +{ + NTSTATUS status; + + /* now initialise a few default values associated with this smb socket */ + smb_conn->negotiate.max_send = 0xFFFF; + + /* this is the size that w2k uses, and it appears to be important for + good performance */ + smb_conn->negotiate.max_recv = lp_max_xmit(); + + smb_conn->negotiate.zone_offset = get_time_zone(time(NULL)); + + smb_conn->config.security = lp_security(); + smb_conn->config.nt_status_support = lp_nt_status_support(); + + status = smbsrv_init_sessions(smb_conn); + NT_STATUS_NOT_OK_RETURN(status); + + status = smbsrv_init_tcons(smb_conn); + NT_STATUS_NOT_OK_RETURN(status); + + srv_init_signing(smb_conn); + + return NT_STATUS_OK; +} |