• Home
  • Raw
  • Download

Lines Matching refs:msg

288 static CURLcode smb_recv_message(struct connectdata *conn, void **msg)  in smb_recv_message()  argument
329 *msg = buf; in smb_recv_message()
409 const void *msg, size_t msg_len) in smb_send_message() argument
414 msg, msg_len); in smb_send_message()
421 const char *msg = "\x00\x0c\x00\x02NT LM 0.12"; in smb_send_negotiate() local
423 return smb_send_message(conn, SMB_COM_NEGOTIATE, msg, 15); in smb_send_negotiate()
429 struct smb_setup msg; in smb_send_setup() local
430 char *p = msg.bytes; in smb_send_setup()
439 if(byte_count > sizeof(msg.bytes)) in smb_send_setup()
451 memset(&msg, 0, sizeof(msg)); in smb_send_setup()
452 msg.word_count = SMB_WC_SETUP_ANDX; in smb_send_setup()
453 msg.andx.command = SMB_COM_NO_ANDX_COMMAND; in smb_send_setup()
454 msg.max_buffer_size = smb_swap16(MAX_MESSAGE_SIZE); in smb_send_setup()
455 msg.max_mpx_count = smb_swap16(1); in smb_send_setup()
456 msg.vc_number = smb_swap16(1); in smb_send_setup()
457 msg.session_key = smb_swap32(smbc->session_key); in smb_send_setup()
458 msg.capabilities = smb_swap32(SMB_CAP_LARGE_FILES); in smb_send_setup()
459 msg.lengths[0] = smb_swap16(sizeof(lm)); in smb_send_setup()
460 msg.lengths[1] = smb_swap16(sizeof(nt)); in smb_send_setup()
469 byte_count = p - msg.bytes; in smb_send_setup()
470 msg.byte_count = smb_swap16((unsigned short)byte_count); in smb_send_setup()
472 return smb_send_message(conn, SMB_COM_SETUP_ANDX, &msg, in smb_send_setup()
473 sizeof(msg) - sizeof(msg.bytes) + byte_count); in smb_send_setup()
479 struct smb_tree_connect msg; in smb_send_tree_connect() local
480 char *p = msg.bytes; in smb_send_tree_connect()
484 if(byte_count > sizeof(msg.bytes)) in smb_send_tree_connect()
487 memset(&msg, 0, sizeof(msg)); in smb_send_tree_connect()
488 msg.word_count = SMB_WC_TREE_CONNECT_ANDX; in smb_send_tree_connect()
489 msg.andx.command = SMB_COM_NO_ANDX_COMMAND; in smb_send_tree_connect()
490 msg.pw_len = 0; in smb_send_tree_connect()
496 byte_count = p - msg.bytes; in smb_send_tree_connect()
497 msg.byte_count = smb_swap16((unsigned short)byte_count); in smb_send_tree_connect()
499 return smb_send_message(conn, SMB_COM_TREE_CONNECT_ANDX, &msg, in smb_send_tree_connect()
500 sizeof(msg) - sizeof(msg.bytes) + byte_count); in smb_send_tree_connect()
506 struct smb_nt_create msg; in smb_send_open() local
509 if((strlen(req->path) + 1) > sizeof(msg.bytes)) in smb_send_open()
512 memset(&msg, 0, sizeof(msg)); in smb_send_open()
513 msg.word_count = SMB_WC_NT_CREATE_ANDX; in smb_send_open()
514 msg.andx.command = SMB_COM_NO_ANDX_COMMAND; in smb_send_open()
516 msg.name_length = smb_swap16((unsigned short)byte_count); in smb_send_open()
517 msg.share_access = smb_swap32(SMB_FILE_SHARE_ALL); in smb_send_open()
519 msg.access = smb_swap32(SMB_GENERIC_READ | SMB_GENERIC_WRITE); in smb_send_open()
520 msg.create_disposition = smb_swap32(SMB_FILE_OVERWRITE_IF); in smb_send_open()
523 msg.access = smb_swap32(SMB_GENERIC_READ); in smb_send_open()
524 msg.create_disposition = smb_swap32(SMB_FILE_OPEN); in smb_send_open()
526 msg.byte_count = smb_swap16((unsigned short) ++byte_count); in smb_send_open()
527 strcpy(msg.bytes, req->path); in smb_send_open()
529 return smb_send_message(conn, SMB_COM_NT_CREATE_ANDX, &msg, in smb_send_open()
530 sizeof(msg) - sizeof(msg.bytes) + byte_count); in smb_send_open()
536 struct smb_close msg; in smb_send_close() local
538 memset(&msg, 0, sizeof(msg)); in smb_send_close()
539 msg.word_count = SMB_WC_CLOSE; in smb_send_close()
540 msg.fid = smb_swap16(req->fid); in smb_send_close()
542 return smb_send_message(conn, SMB_COM_CLOSE, &msg, sizeof(msg)); in smb_send_close()
547 struct smb_tree_disconnect msg; in smb_send_tree_disconnect() local
549 memset(&msg, 0, sizeof(msg)); in smb_send_tree_disconnect()
551 return smb_send_message(conn, SMB_COM_TREE_DISCONNECT, &msg, sizeof(msg)); in smb_send_tree_disconnect()
558 struct smb_read msg; in smb_send_read() local
560 memset(&msg, 0, sizeof(msg)); in smb_send_read()
561 msg.word_count = SMB_WC_READ_ANDX; in smb_send_read()
562 msg.andx.command = SMB_COM_NO_ANDX_COMMAND; in smb_send_read()
563 msg.fid = smb_swap16(req->fid); in smb_send_read()
564 msg.offset = smb_swap32((unsigned int) offset); in smb_send_read()
565 msg.offset_high = smb_swap32((unsigned int) (offset >> 32)); in smb_send_read()
566 msg.min_bytes = smb_swap16(MAX_PAYLOAD_SIZE); in smb_send_read()
567 msg.max_bytes = smb_swap16(MAX_PAYLOAD_SIZE); in smb_send_read()
569 return smb_send_message(conn, SMB_COM_READ_ANDX, &msg, sizeof(msg)); in smb_send_read()
574 struct smb_write *msg = (struct smb_write *)conn->data->state.uploadbuffer; in smb_send_write() local
582 memset(msg, 0, sizeof(*msg)); in smb_send_write()
583 msg->word_count = SMB_WC_WRITE_ANDX; in smb_send_write()
584 msg->andx.command = SMB_COM_NO_ANDX_COMMAND; in smb_send_write()
585 msg->fid = smb_swap16(req->fid); in smb_send_write()
586 msg->offset = smb_swap32((unsigned int) offset); in smb_send_write()
587 msg->offset_high = smb_swap32((unsigned int) (offset >> 32)); in smb_send_write()
588 msg->data_length = smb_swap16((unsigned short) upload_size); in smb_send_write()
589 msg->data_offset = smb_swap16(sizeof(*msg) - sizeof(unsigned int)); in smb_send_write()
590 msg->byte_count = smb_swap16((unsigned short) (upload_size + 1)); in smb_send_write()
592 smb_format_message(conn, &msg->h, SMB_COM_WRITE_ANDX, in smb_send_write()
593 sizeof(*msg) - sizeof(msg->h) + (size_t) upload_size); in smb_send_write()
595 return smb_send(conn, sizeof(*msg), (size_t) upload_size); in smb_send_write()
598 static CURLcode smb_send_and_recv(struct connectdata *conn, void **msg) in smb_send_and_recv() argument
630 return smb_recv_message(conn, msg); in smb_send_and_recv()
639 void *msg = NULL; in smb_connection_state() local
663 result = smb_send_and_recv(conn, &msg); in smb_connection_state()
669 if(!msg) in smb_connection_state()
672 h = msg; in smb_connection_state()
680 nrsp = msg; in smb_connection_state()
719 void *msg = NULL; in smb_request_state() local
733 result = smb_send_and_recv(conn, &msg); in smb_request_state()
739 if(!msg) in smb_request_state()
742 h = msg; in smb_request_state()
762 req->fid = smb_swap16(((struct smb_nt_create_response *)msg)->fid); in smb_request_state()
771 smb_swap64(((struct smb_nt_create_response *)msg)->end_of_file); in smb_request_state()
783 len = Curl_read16_le(((unsigned char *) msg) + in smb_request_state()
785 off = Curl_read16_le(((unsigned char *) msg) + in smb_request_state()
795 (char *)msg + off + sizeof(unsigned int), in smb_request_state()
815 len = Curl_read16_le(((unsigned char *) msg) + in smb_request_state()