Lines Matching refs:msg
479 static CURLcode smb_recv_message(struct Curl_easy *data, void **msg) in smb_recv_message() argument
522 *msg = buf; in smb_recv_message()
603 const void *msg, size_t msg_len) in smb_send_message() argument
611 memcpy(smbc->send_buf + sizeof(struct smb_header), msg, msg_len); in smb_send_message()
618 const char *msg = "\x00\x0c\x00\x02NT LM 0.12"; in smb_send_negotiate() local
620 return smb_send_message(data, SMB_COM_NEGOTIATE, msg, 15); in smb_send_negotiate()
627 struct smb_setup msg; in smb_send_setup() local
628 char *p = msg.bytes; in smb_send_setup()
637 if(byte_count > sizeof(msg.bytes)) in smb_send_setup()
645 memset(&msg, 0, sizeof(msg) - sizeof(msg.bytes)); in smb_send_setup()
646 msg.word_count = SMB_WC_SETUP_ANDX; in smb_send_setup()
647 msg.andx.command = SMB_COM_NO_ANDX_COMMAND; in smb_send_setup()
648 msg.max_buffer_size = smb_swap16(MAX_MESSAGE_SIZE); in smb_send_setup()
649 msg.max_mpx_count = smb_swap16(1); in smb_send_setup()
650 msg.vc_number = smb_swap16(1); in smb_send_setup()
651 msg.session_key = smb_swap32(smbc->session_key); in smb_send_setup()
652 msg.capabilities = smb_swap32(SMB_CAP_LARGE_FILES); in smb_send_setup()
653 msg.lengths[0] = smb_swap16(sizeof(lm)); in smb_send_setup()
654 msg.lengths[1] = smb_swap16(sizeof(nt)); in smb_send_setup()
666 DEBUGASSERT(byte_count == (size_t)(p - msg.bytes)); in smb_send_setup()
667 msg.byte_count = smb_swap16((unsigned short)byte_count); in smb_send_setup()
669 return smb_send_message(data, SMB_COM_SETUP_ANDX, &msg, in smb_send_setup()
670 sizeof(msg) - sizeof(msg.bytes) + byte_count); in smb_send_setup()
675 struct smb_tree_connect msg; in smb_send_tree_connect() local
678 char *p = msg.bytes; in smb_send_tree_connect()
682 if(byte_count > sizeof(msg.bytes)) in smb_send_tree_connect()
685 memset(&msg, 0, sizeof(msg) - sizeof(msg.bytes)); in smb_send_tree_connect()
686 msg.word_count = SMB_WC_TREE_CONNECT_ANDX; in smb_send_tree_connect()
687 msg.andx.command = SMB_COM_NO_ANDX_COMMAND; in smb_send_tree_connect()
688 msg.pw_len = 0; in smb_send_tree_connect()
696 DEBUGASSERT(byte_count == (size_t)(p - msg.bytes)); in smb_send_tree_connect()
697 msg.byte_count = smb_swap16((unsigned short)byte_count); in smb_send_tree_connect()
699 return smb_send_message(data, SMB_COM_TREE_CONNECT_ANDX, &msg, in smb_send_tree_connect()
700 sizeof(msg) - sizeof(msg.bytes) + byte_count); in smb_send_tree_connect()
706 struct smb_nt_create msg; in smb_send_open() local
709 if(byte_count > sizeof(msg.bytes)) in smb_send_open()
712 memset(&msg, 0, sizeof(msg) - sizeof(msg.bytes)); in smb_send_open()
713 msg.word_count = SMB_WC_NT_CREATE_ANDX; in smb_send_open()
714 msg.andx.command = SMB_COM_NO_ANDX_COMMAND; in smb_send_open()
715 msg.name_length = smb_swap16((unsigned short)(byte_count - 1)); in smb_send_open()
716 msg.share_access = smb_swap32(SMB_FILE_SHARE_ALL); in smb_send_open()
718 msg.access = smb_swap32(SMB_GENERIC_READ | SMB_GENERIC_WRITE); in smb_send_open()
719 msg.create_disposition = smb_swap32(SMB_FILE_OVERWRITE_IF); in smb_send_open()
722 msg.access = smb_swap32(SMB_GENERIC_READ); in smb_send_open()
723 msg.create_disposition = smb_swap32(SMB_FILE_OPEN); in smb_send_open()
725 msg.byte_count = smb_swap16((unsigned short) byte_count); in smb_send_open()
726 strcpy(msg.bytes, req->path); in smb_send_open()
728 return smb_send_message(data, SMB_COM_NT_CREATE_ANDX, &msg, in smb_send_open()
729 sizeof(msg) - sizeof(msg.bytes) + byte_count); in smb_send_open()
735 struct smb_close msg; in smb_send_close() local
737 memset(&msg, 0, sizeof(msg)); in smb_send_close()
738 msg.word_count = SMB_WC_CLOSE; in smb_send_close()
739 msg.fid = smb_swap16(req->fid); in smb_send_close()
741 return smb_send_message(data, SMB_COM_CLOSE, &msg, sizeof(msg)); in smb_send_close()
746 struct smb_tree_disconnect msg; in smb_send_tree_disconnect() local
748 memset(&msg, 0, sizeof(msg)); in smb_send_tree_disconnect()
750 return smb_send_message(data, SMB_COM_TREE_DISCONNECT, &msg, sizeof(msg)); in smb_send_tree_disconnect()
757 struct smb_read msg; in smb_send_read() local
759 memset(&msg, 0, sizeof(msg)); in smb_send_read()
760 msg.word_count = SMB_WC_READ_ANDX; in smb_send_read()
761 msg.andx.command = SMB_COM_NO_ANDX_COMMAND; in smb_send_read()
762 msg.fid = smb_swap16(req->fid); in smb_send_read()
763 msg.offset = smb_swap32((unsigned int) offset); in smb_send_read()
764 msg.offset_high = smb_swap32((unsigned int) (offset >> 32)); in smb_send_read()
765 msg.min_bytes = smb_swap16(MAX_PAYLOAD_SIZE); in smb_send_read()
766 msg.max_bytes = smb_swap16(MAX_PAYLOAD_SIZE); in smb_send_read()
768 return smb_send_message(data, SMB_COM_READ_ANDX, &msg, sizeof(msg)); in smb_send_read()
775 struct smb_write *msg; in smb_send_write() local
780 msg = (struct smb_write *)smbc->send_buf; in smb_send_write()
784 memset(msg, 0, sizeof(*msg)); in smb_send_write()
785 msg->word_count = SMB_WC_WRITE_ANDX; in smb_send_write()
786 msg->andx.command = SMB_COM_NO_ANDX_COMMAND; in smb_send_write()
787 msg->fid = smb_swap16(req->fid); in smb_send_write()
788 msg->offset = smb_swap32((unsigned int) offset); in smb_send_write()
789 msg->offset_high = smb_swap32((unsigned int) (offset >> 32)); in smb_send_write()
790 msg->data_length = smb_swap16((unsigned short) upload_size); in smb_send_write()
791 msg->data_offset = smb_swap16(sizeof(*msg) - sizeof(unsigned int)); in smb_send_write()
792 msg->byte_count = smb_swap16((unsigned short) (upload_size + 1)); in smb_send_write()
794 smb_format_message(data, &msg->h, SMB_COM_WRITE_ANDX, in smb_send_write()
795 sizeof(*msg) - sizeof(msg->h) + (size_t) upload_size); in smb_send_write()
797 return smb_send(data, sizeof(*msg), (size_t) upload_size); in smb_send_write()
800 static CURLcode smb_send_and_recv(struct Curl_easy *data, void **msg) in smb_send_and_recv() argument
805 *msg = NULL; /* if it returns early */ in smb_send_and_recv()
835 return smb_recv_message(data, msg); in smb_send_and_recv()
845 void *msg = NULL; in smb_connection_state() local
869 result = smb_send_and_recv(data, &msg); in smb_connection_state()
875 if(!msg) in smb_connection_state()
878 h = msg; in smb_connection_state()
887 nrsp = msg; in smb_connection_state()
946 void *msg = NULL; in smb_request_state() local
966 result = smb_send_and_recv(data, &msg); in smb_request_state()
972 if(!msg) in smb_request_state()
975 h = msg; in smb_request_state()
997 smb_m = (const struct smb_nt_create_response*) msg; in smb_request_state()
1026 len = Curl_read16_le(((const unsigned char *) msg) + in smb_request_state()
1028 off = Curl_read16_le(((const unsigned char *) msg) + in smb_request_state()
1037 (char *)msg + off + sizeof(unsigned int), in smb_request_state()
1055 len = Curl_read16_le(((const unsigned char *) msg) + in smb_request_state()