Lines Matching refs:smbc

371   struct smb_conn *smbc = &data->conn->proto.smbc;  in conn_state()  local
383 if(smbc->state != newstate) in conn_state()
385 (void *)smbc, names[smbc->state], names[newstate]); in conn_state()
388 smbc->state = newstate; in conn_state()
436 struct smb_conn *smbc = &conn->proto.smbc; in smb_connect() local
446 smbc->state = SMB_CONNECTING; in smb_connect()
447 smbc->recv_buf = malloc(MAX_MESSAGE_SIZE); in smb_connect()
448 if(!smbc->recv_buf) in smb_connect()
450 smbc->send_buf = malloc(MAX_MESSAGE_SIZE); in smb_connect()
451 if(!smbc->send_buf) in smb_connect()
463 smbc->user = slash + 1; in smb_connect()
464 smbc->domain = strdup(conn->user); in smb_connect()
465 if(!smbc->domain) in smb_connect()
467 smbc->domain[slash - conn->user] = 0; in smb_connect()
470 smbc->user = conn->user; in smb_connect()
471 smbc->domain = strdup(conn->host.name); in smb_connect()
472 if(!smbc->domain) in smb_connect()
482 struct smb_conn *smbc = &conn->proto.smbc; in smb_recv_message() local
483 char *buf = smbc->recv_buf; in smb_recv_message()
487 size_t len = MAX_MESSAGE_SIZE - smbc->got; in smb_recv_message()
490 result = Curl_xfer_recv(data, buf + smbc->got, len, &bytes_read); in smb_recv_message()
497 smbc->got += bytes_read; in smb_recv_message()
500 if(smbc->got < sizeof(unsigned int)) in smb_recv_message()
506 if(smbc->got < nbt_size) in smb_recv_message()
529 struct smb_conn *smbc = &conn->proto.smbc; in smb_pop_message() local
531 smbc->got = 0; in smb_pop_message()
538 struct smb_conn *smbc = &conn->proto.smbc; in smb_format_message() local
549 h->uid = smb_swap16(smbc->uid); in smb_format_message()
560 struct smb_conn *smbc = &conn->proto.smbc; in smb_send() local
564 result = Curl_xfer_send(data, smbc->send_buf, len, FALSE, &bytes_written); in smb_send()
569 smbc->send_size = len; in smb_send()
570 smbc->sent = bytes_written; in smb_send()
573 smbc->upload_size = upload_size; in smb_send()
581 struct smb_conn *smbc = &conn->proto.smbc; in smb_flush() local
583 size_t len = smbc->send_size - smbc->sent; in smb_flush()
586 if(!smbc->send_size) in smb_flush()
589 result = Curl_xfer_send(data, smbc->send_buf + smbc->sent, len, FALSE, in smb_flush()
595 smbc->sent += bytes_written; in smb_flush()
597 smbc->send_size = 0; in smb_flush()
606 struct smb_conn *smbc = &conn->proto.smbc; in smb_send_message() local
608 smb_format_message(data, (struct smb_header *)smbc->send_buf, in smb_send_message()
611 memcpy(smbc->send_buf + sizeof(struct smb_header), msg, msg_len); in smb_send_message()
626 struct smb_conn *smbc = &conn->proto.smbc; in smb_send_setup() local
635 strlen(smbc->user) + strlen(smbc->domain) + in smb_send_setup()
641 Curl_ntlm_core_lm_resp(lm_hash, smbc->challenge, lm); in smb_send_setup()
643 Curl_ntlm_core_lm_resp(nt_hash, smbc->challenge, nt); in smb_send_setup()
651 msg.session_key = smb_swap32(smbc->session_key); in smb_send_setup()
664 smbc->user, 0, smbc->domain, 0, CURL_OS, 0, CLIENTNAME); in smb_send_setup()
677 struct smb_conn *smbc = &conn->proto.smbc; in smb_send_tree_connect() local
680 const size_t byte_count = strlen(conn->host.name) + strlen(smbc->share) + in smb_send_tree_connect()
694 conn->host.name, smbc->share, 0, SERVICENAME); in smb_send_tree_connect()
774 struct smb_conn *smbc = &conn->proto.smbc; in smb_send_write() local
780 msg = (struct smb_write *)smbc->send_buf; in smb_send_write()
803 struct smb_conn *smbc = &conn->proto.smbc; in smb_send_and_recv() local
808 if(!smbc->send_size && smbc->upload_size) { in smb_send_and_recv()
809 size_t nread = smbc->upload_size > (size_t)MAX_MESSAGE_SIZE ? in smb_send_and_recv()
810 (size_t)MAX_MESSAGE_SIZE : smbc->upload_size; in smb_send_and_recv()
813 result = Curl_client_read(data, smbc->send_buf, nread, &nread, &eos); in smb_send_and_recv()
819 smbc->upload_size -= nread; in smb_send_and_recv()
820 smbc->send_size = nread; in smb_send_and_recv()
821 smbc->sent = 0; in smb_send_and_recv()
825 if(smbc->send_size) { in smb_send_and_recv()
832 if(smbc->send_size || smbc->upload_size) in smb_send_and_recv()
841 struct smb_conn *smbc = &conn->proto.smbc; in smb_connection_state() local
847 if(smbc->state == SMB_CONNECTING) { in smb_connection_state()
880 switch(smbc->state) { in smb_connection_state()
882 if((smbc->got < sizeof(*nrsp) + sizeof(smbc->challenge) - 1) || in smb_connection_state()
888 memcpy(smbc->challenge, nrsp->bytes, sizeof(smbc->challenge)); in smb_connection_state()
889 smbc->session_key = smb_swap32(nrsp->session_key); in smb_connection_state()
903 smbc->uid = smb_swap16(h->uid); in smb_connection_state()
941 struct smb_conn *smbc = &conn->proto.smbc; in smb_request_state() local
990 if(h->status || smbc->got < sizeof(struct smb_nt_create_response)) { in smb_request_state()
1021 if(h->status || smbc->got < sizeof(struct smb_header) + 14) { in smb_request_state()
1031 if(off + sizeof(unsigned int) + len > smbc->got) { in smb_request_state()
1050 if(h->status || smbc->got < sizeof(struct smb_header) + 6) { in smb_request_state()
1125 struct smb_conn *smbc = &conn->proto.smbc; in smb_disconnect() local
1128 Curl_safefree(smbc->share); in smb_disconnect()
1129 Curl_safefree(smbc->domain); in smb_disconnect()
1130 Curl_safefree(smbc->recv_buf); in smb_disconnect()
1131 Curl_safefree(smbc->send_buf); in smb_disconnect()
1146 struct smb_conn *smbc = &conn->proto.smbc; in smb_do() local
1149 if(smbc->share) { in smb_do()
1159 struct smb_conn *smbc = &conn->proto.smbc; in smb_parse_url_path() local
1170 smbc->share = strdup((*path == '/' || *path == '\\') ? path + 1 : path); in smb_parse_url_path()
1172 if(!smbc->share) in smb_parse_url_path()
1175 slash = strchr(smbc->share, '/'); in smb_parse_url_path()
1177 slash = strchr(smbc->share, '\\'); in smb_parse_url_path()
1181 Curl_safefree(smbc->share); in smb_parse_url_path()