Lines Matching refs:msg

286 static CURLcode smb_recv_message(struct connectdata *conn, void **msg)  in smb_recv_message()  argument
327 *msg = buf; in smb_recv_message()
407 const void *msg, size_t msg_len) in smb_send_message() argument
412 msg, msg_len); in smb_send_message()
419 const char *msg = "\x00\x0c\x00\x02NT LM 0.12"; in smb_send_negotiate() local
421 return smb_send_message(conn, SMB_COM_NEGOTIATE, msg, 15); in smb_send_negotiate()
427 struct smb_setup msg; in smb_send_setup() local
428 char *p = msg.bytes; in smb_send_setup()
437 if(byte_count > sizeof(msg.bytes)) in smb_send_setup()
449 memset(&msg, 0, sizeof(msg)); in smb_send_setup()
450 msg.word_count = SMB_WC_SETUP_ANDX; in smb_send_setup()
451 msg.andx.command = SMB_COM_NO_ANDX_COMMAND; in smb_send_setup()
452 msg.max_buffer_size = smb_swap16(MAX_MESSAGE_SIZE); in smb_send_setup()
453 msg.max_mpx_count = smb_swap16(1); in smb_send_setup()
454 msg.vc_number = smb_swap16(1); in smb_send_setup()
455 msg.session_key = smb_swap32(smbc->session_key); in smb_send_setup()
456 msg.capabilities = smb_swap32(SMB_CAP_LARGE_FILES); in smb_send_setup()
457 msg.lengths[0] = smb_swap16(sizeof(lm)); in smb_send_setup()
458 msg.lengths[1] = smb_swap16(sizeof(nt)); in smb_send_setup()
467 byte_count = p - msg.bytes; in smb_send_setup()
468 msg.byte_count = smb_swap16((unsigned short)byte_count); in smb_send_setup()
470 return smb_send_message(conn, SMB_COM_SETUP_ANDX, &msg, in smb_send_setup()
471 sizeof(msg) - sizeof(msg.bytes) + byte_count); in smb_send_setup()
477 struct smb_tree_connect msg; in smb_send_tree_connect() local
478 char *p = msg.bytes; in smb_send_tree_connect()
482 if(byte_count > sizeof(msg.bytes)) in smb_send_tree_connect()
485 memset(&msg, 0, sizeof(msg)); in smb_send_tree_connect()
486 msg.word_count = SMB_WC_TREE_CONNECT_ANDX; in smb_send_tree_connect()
487 msg.andx.command = SMB_COM_NO_ANDX_COMMAND; in smb_send_tree_connect()
488 msg.pw_len = 0; in smb_send_tree_connect()
494 byte_count = p - msg.bytes; in smb_send_tree_connect()
495 msg.byte_count = smb_swap16((unsigned short)byte_count); in smb_send_tree_connect()
497 return smb_send_message(conn, SMB_COM_TREE_CONNECT_ANDX, &msg, in smb_send_tree_connect()
498 sizeof(msg) - sizeof(msg.bytes) + byte_count); in smb_send_tree_connect()
504 struct smb_nt_create msg; in smb_send_open() local
507 if((strlen(req->path) + 1) > sizeof(msg.bytes)) in smb_send_open()
510 memset(&msg, 0, sizeof(msg)); in smb_send_open()
511 msg.word_count = SMB_WC_NT_CREATE_ANDX; in smb_send_open()
512 msg.andx.command = SMB_COM_NO_ANDX_COMMAND; in smb_send_open()
514 msg.name_length = smb_swap16((unsigned short)byte_count); in smb_send_open()
515 msg.share_access = smb_swap32(SMB_FILE_SHARE_ALL); in smb_send_open()
517 msg.access = smb_swap32(SMB_GENERIC_READ | SMB_GENERIC_WRITE); in smb_send_open()
518 msg.create_disposition = smb_swap32(SMB_FILE_OVERWRITE_IF); in smb_send_open()
521 msg.access = smb_swap32(SMB_GENERIC_READ); in smb_send_open()
522 msg.create_disposition = smb_swap32(SMB_FILE_OPEN); in smb_send_open()
524 msg.byte_count = smb_swap16((unsigned short) ++byte_count); in smb_send_open()
525 strcpy(msg.bytes, req->path); in smb_send_open()
527 return smb_send_message(conn, SMB_COM_NT_CREATE_ANDX, &msg, in smb_send_open()
528 sizeof(msg) - sizeof(msg.bytes) + byte_count); in smb_send_open()
534 struct smb_close msg; in smb_send_close() local
536 memset(&msg, 0, sizeof(msg)); in smb_send_close()
537 msg.word_count = SMB_WC_CLOSE; in smb_send_close()
538 msg.fid = smb_swap16(req->fid); in smb_send_close()
540 return smb_send_message(conn, SMB_COM_CLOSE, &msg, sizeof(msg)); in smb_send_close()
545 struct smb_tree_disconnect msg; in smb_send_tree_disconnect() local
547 memset(&msg, 0, sizeof(msg)); in smb_send_tree_disconnect()
549 return smb_send_message(conn, SMB_COM_TREE_DISCONNECT, &msg, sizeof(msg)); in smb_send_tree_disconnect()
556 struct smb_read msg; in smb_send_read() local
558 memset(&msg, 0, sizeof(msg)); in smb_send_read()
559 msg.word_count = SMB_WC_READ_ANDX; in smb_send_read()
560 msg.andx.command = SMB_COM_NO_ANDX_COMMAND; in smb_send_read()
561 msg.fid = smb_swap16(req->fid); in smb_send_read()
562 msg.offset = smb_swap32((unsigned int) offset); in smb_send_read()
563 msg.offset_high = smb_swap32((unsigned int) (offset >> 32)); in smb_send_read()
564 msg.min_bytes = smb_swap16(MAX_PAYLOAD_SIZE); in smb_send_read()
565 msg.max_bytes = smb_swap16(MAX_PAYLOAD_SIZE); in smb_send_read()
567 return smb_send_message(conn, SMB_COM_READ_ANDX, &msg, sizeof(msg)); in smb_send_read()
572 struct smb_write *msg = (struct smb_write *)conn->data->state.uploadbuffer; in smb_send_write() local
580 memset(msg, 0, sizeof(*msg)); in smb_send_write()
581 msg->word_count = SMB_WC_WRITE_ANDX; in smb_send_write()
582 msg->andx.command = SMB_COM_NO_ANDX_COMMAND; in smb_send_write()
583 msg->fid = smb_swap16(req->fid); in smb_send_write()
584 msg->offset = smb_swap32((unsigned int) offset); in smb_send_write()
585 msg->offset_high = smb_swap32((unsigned int) (offset >> 32)); in smb_send_write()
586 msg->data_length = smb_swap16((unsigned short) upload_size); in smb_send_write()
587 msg->data_offset = smb_swap16(sizeof(*msg) - sizeof(unsigned int)); in smb_send_write()
588 msg->byte_count = smb_swap16((unsigned short) (upload_size + 1)); in smb_send_write()
590 smb_format_message(conn, &msg->h, SMB_COM_WRITE_ANDX, in smb_send_write()
591 sizeof(*msg) - sizeof(msg->h) + (size_t) upload_size); in smb_send_write()
593 return smb_send(conn, sizeof(*msg), (size_t) upload_size); in smb_send_write()
596 static CURLcode smb_send_and_recv(struct connectdata *conn, void **msg) in smb_send_and_recv() argument
628 return smb_recv_message(conn, msg); in smb_send_and_recv()
637 void *msg = NULL; in smb_connection_state() local
661 result = smb_send_and_recv(conn, &msg); in smb_connection_state()
667 if(!msg) in smb_connection_state()
670 h = msg; in smb_connection_state()
678 nrsp = msg; in smb_connection_state()
717 void *msg = NULL; in smb_request_state() local
731 result = smb_send_and_recv(conn, &msg); in smb_request_state()
737 if(!msg) in smb_request_state()
740 h = msg; in smb_request_state()
760 req->fid = smb_swap16(((struct smb_nt_create_response *)msg)->fid); in smb_request_state()
769 smb_swap64(((struct smb_nt_create_response *)msg)->end_of_file); in smb_request_state()
781 len = Curl_read16_le(((unsigned char *) msg) + in smb_request_state()
783 off = Curl_read16_le(((unsigned char *) msg) + in smb_request_state()
793 (char *)msg + off + sizeof(unsigned int), in smb_request_state()
813 len = Curl_read16_le(((unsigned char *) msg) + in smb_request_state()