Lines Matching refs:hdr
148 let hdr = node.send_request_header(MasterReq::GET_FEATURES, None)?; in get_features() localVariable
149 let val = node.recv_reply::<VhostUserU64>(&hdr)?; in get_features()
158 let hdr = node.send_request_with_body(MasterReq::SET_FEATURES, &val, None)?; in set_features() localVariable
160 node.wait_for_ack(&hdr) in set_features()
168 let hdr = node.send_request_header(MasterReq::SET_OWNER, None)?; in set_owner() localVariable
169 node.wait_for_ack(&hdr) in set_owner()
174 let hdr = node.send_request_header(MasterReq::RESET_OWNER, None)?; in reset_owner() localVariable
175 node.wait_for_ack(&hdr) in reset_owner()
204 let hdr = node.send_request_with_payload( in set_mem_table() localVariable
210 node.wait_for_ack(&hdr) in set_mem_table()
233 let hdr = node.send_request_header(MasterReq::SET_LOG_FD, Some(&fds))?; in set_log_fd() localVariable
234 node.wait_for_ack(&hdr) in set_log_fd()
245 let hdr = node.send_request_with_body(MasterReq::SET_VRING_NUM, &val, None)?; in set_vring_num() localVariable
246 node.wait_for_ack(&hdr) in set_vring_num()
259 let hdr = node.send_request_with_body(MasterReq::SET_VRING_ADDR, &val, None)?; in set_vring_addr() localVariable
260 node.wait_for_ack(&hdr) in set_vring_addr()
271 let hdr = node.send_request_with_body(MasterReq::SET_VRING_BASE, &val, None)?; in set_vring_base() localVariable
272 node.wait_for_ack(&hdr) in set_vring_base()
282 let hdr = node.send_request_with_body(MasterReq::GET_VRING_BASE, &req, None)?; in get_vring_base() localVariable
283 let reply = node.recv_reply::<VhostUserVringState>(&hdr)?; in get_vring_base()
296 let hdr = node.send_fd_for_vring( in set_vring_call() localVariable
301 node.wait_for_ack(&hdr) in set_vring_call()
313 let hdr = node.send_fd_for_vring( in set_vring_kick() localVariable
318 node.wait_for_ack(&hdr) in set_vring_kick()
329 let hdr = node.send_fd_for_vring( in set_vring_err() localVariable
334 node.wait_for_ack(&hdr) in set_vring_err()
345 let hdr = node.send_request_header(MasterReq::GET_PROTOCOL_FEATURES, None)?; in get_protocol_features() localVariable
346 let val = node.recv_reply::<VhostUserU64>(&hdr)?; in get_protocol_features()
363 let hdr = node.send_request_with_body(MasterReq::SET_PROTOCOL_FEATURES, &val, None)?; in set_protocol_features() localVariable
368 node.wait_for_ack(&hdr) in set_protocol_features()
377 let hdr = node.send_request_header(MasterReq::GET_QUEUE_NUM, None)?; in get_queue_num() localVariable
378 let val = node.recv_reply::<VhostUserU64>(&hdr)?; in get_queue_num()
397 let hdr = node.send_request_with_body(MasterReq::SET_VRING_ENABLE, &val, None)?; in set_vring_enable() localVariable
398 node.wait_for_ack(&hdr) in set_vring_enable()
422 let hdr = node.send_request_with_payload(MasterReq::GET_CONFIG, &body, buf, None)?; in get_config() localVariable
424 node.recv_reply_with_payload::<VhostUserConfig>(&hdr)?; in get_config()
454 let hdr = node.send_request_with_payload(MasterReq::SET_CONFIG, &body, buf, None)?; in set_config() localVariable
455 node.wait_for_ack(&hdr) in set_config()
464 let hdr = node.send_request_header(MasterReq::SET_SLAVE_REQ_FD, Some(&fds))?; in set_slave_request_fd() localVariable
465 node.wait_for_ack(&hdr) in set_slave_request_fd()
477 let hdr = node.send_request_with_body(MasterReq::GET_INFLIGHT_FD, inflight, None)?; in get_inflight_fd() localVariable
478 let (inflight, files) = node.recv_reply_with_files::<VhostUserInflight>(&hdr)?; in get_inflight_fd()
500 let hdr = node.send_request_with_body(MasterReq::SET_INFLIGHT_FD, inflight, Some(&[fd]))?; in set_inflight_fd() localVariable
501 node.wait_for_ack(&hdr) in set_inflight_fd()
511 let hdr = node.send_request_header(MasterReq::GET_MAX_MEM_SLOTS, None)?; in get_max_mem_slots() localVariable
512 let val = node.recv_reply::<VhostUserU64>(&hdr)?; in get_max_mem_slots()
535 let hdr = node.send_request_with_body(MasterReq::ADD_MEM_REG, &body, Some(&fds))?; in add_mem_region() localVariable
536 node.wait_for_ack(&hdr) in add_mem_region()
555 let hdr = node.send_request_with_body(MasterReq::REM_MEM_REG, &body, None)?; in remove_mem_region() localVariable
556 node.wait_for_ack(&hdr) in remove_mem_region()
620 let hdr = self.new_request_header(code, 0); in send_request_header() localVariable
621 self.main_sock.send_header(&hdr, fds)?; in send_request_header()
622 Ok(hdr) in send_request_header()
636 let hdr = self.new_request_header(code, mem::size_of::<T>() as u32); in send_request_with_body() localVariable
637 self.main_sock.send_message(&hdr, msg, fds)?; in send_request_with_body()
638 Ok(hdr) in send_request_with_body()
659 let hdr = self.new_request_header(code, len as u32); in send_request_with_payload() localVariable
661 .send_message_with_payload(&hdr, msg, payload, fds)?; in send_request_with_payload()
662 Ok(hdr) in send_request_with_payload()
680 let hdr = self.new_request_header(code, mem::size_of::<VhostUserU64>() as u32); in send_fd_for_vring() localVariable
681 self.main_sock.send_message(&hdr, &msg, Some(&[fd]))?; in send_fd_for_vring()
682 Ok(hdr) in send_fd_for_vring()
687 hdr: &VhostUserMsgHeader<MasterReq>, in recv_reply()
689 if mem::size_of::<T>() > MAX_MSG_SIZE || hdr.is_reply() { in recv_reply()
695 if !reply.is_reply_for(hdr) || rfds.is_some() || !body.is_valid() { in recv_reply()
703 hdr: &VhostUserMsgHeader<MasterReq>, in recv_reply_with_files()
705 if mem::size_of::<T>() > MAX_MSG_SIZE || hdr.is_reply() { in recv_reply_with_files()
711 if !reply.is_reply_for(hdr) || files.is_none() || !body.is_valid() { in recv_reply_with_files()
719 hdr: &VhostUserMsgHeader<MasterReq>, in recv_reply_with_payload()
722 || hdr.get_size() as usize <= mem::size_of::<T>() in recv_reply_with_payload()
723 || hdr.get_size() as usize > MAX_MSG_SIZE in recv_reply_with_payload()
724 || hdr.is_reply() in recv_reply_with_payload()
730 let mut buf: Vec<u8> = vec![0; hdr.get_size() as usize - mem::size_of::<T>()]; in recv_reply_with_payload()
732 if !reply.is_reply_for(hdr) in recv_reply_with_payload()
744 fn wait_for_ack(&mut self, hdr: &VhostUserMsgHeader<MasterReq>) -> VhostUserResult<()> { in wait_for_ack()
746 || !hdr.is_need_reply() in wait_for_ack()
753 if !reply.is_reply_for(hdr) || rfds.is_some() || !body.is_valid() { in wait_for_ack()
796 let (hdr, rfds) = slave.recv_header().unwrap(); in create_master()
797 assert_eq!(hdr.get_code(), MasterReq::SET_OWNER); in create_master()
798 assert_eq!(hdr.get_size(), 0); in create_master()
799 assert_eq!(hdr.get_version(), 0x1); in create_master()
802 let (hdr, rfds) = slave.recv_header().unwrap(); in create_master()
803 assert_eq!(hdr.get_code(), MasterReq::RESET_OWNER); in create_master()
804 assert_eq!(hdr.get_size(), 0); in create_master()
805 assert_eq!(hdr.get_version(), 0x1); in create_master()
814 let (hdr, rfds) = peer.recv_header().unwrap(); in test_features()
815 assert_eq!(hdr.get_code(), MasterReq::SET_OWNER); in test_features()
816 assert_eq!(hdr.get_size(), 0); in test_features()
817 assert_eq!(hdr.get_version(), 0x1); in test_features()
820 let hdr = VhostUserMsgHeader::new(MasterReq::GET_FEATURES, 0x4, 8); in test_features() localVariable
822 peer.send_message(&hdr, &msg, None).unwrap(); in test_features()
828 let hdr = VhostUserMsgHeader::new(MasterReq::SET_FEATURES, 0x4, 8); in test_features() localVariable
830 peer.send_message(&hdr, &msg, None).unwrap(); in test_features()
837 let hdr = VhostUserMsgHeader::new(MasterReq::GET_FEATURES, 0x4, 8); in test_features() localVariable
839 peer.send_message(&hdr, &msg, None).unwrap(); in test_features()
848 let (hdr, rfds) = peer.recv_header().unwrap(); in test_protocol_features()
849 assert_eq!(hdr.get_code(), MasterReq::SET_OWNER); in test_protocol_features()
858 let hdr = VhostUserMsgHeader::new(MasterReq::GET_FEATURES, 0x4, 8); in test_protocol_features() localVariable
860 peer.send_message(&hdr, &msg, None).unwrap(); in test_protocol_features()
873 let hdr = VhostUserMsgHeader::new(MasterReq::GET_PROTOCOL_FEATURES, 0x4, 8); in test_protocol_features() localVariable
875 peer.send_message(&hdr, &msg, None).unwrap(); in test_protocol_features()
887 let hdr = VhostUserMsgHeader::new(MasterReq::SET_PROTOCOL_FEATURES, 0x4, 8); in test_protocol_features() localVariable
889 peer.send_message(&hdr, &msg, None).unwrap(); in test_protocol_features()
956 let mut hdr = VhostUserMsgHeader::new(MasterReq::GET_CONFIG, 0x4, 16); in test_master_get_config_negative0() localVariable
958 peer.send_message_with_payload(&hdr, &msg, &buf[0..4], None) in test_master_get_config_negative0()
964 hdr.set_code(MasterReq::GET_FEATURES); in test_master_get_config_negative0()
965 peer.send_message_with_payload(&hdr, &msg, &buf[0..4], None) in test_master_get_config_negative0()
970 hdr.set_code(MasterReq::GET_CONFIG); in test_master_get_config_negative0()
978 let mut hdr = VhostUserMsgHeader::new(MasterReq::GET_CONFIG, 0x4, 16); in test_master_get_config_negative1() localVariable
980 peer.send_message_with_payload(&hdr, &msg, &buf[0..4], None) in test_master_get_config_negative1()
986 hdr.set_reply(false); in test_master_get_config_negative1()
987 peer.send_message_with_payload(&hdr, &msg, &buf[0..4], None) in test_master_get_config_negative1()
999 let hdr = VhostUserMsgHeader::new(MasterReq::GET_CONFIG, 0x4, 16); in test_master_get_config_negative2() localVariable
1001 peer.send_message_with_payload(&hdr, &msg, &buf[0..4], None) in test_master_get_config_negative2()
1013 let hdr = VhostUserMsgHeader::new(MasterReq::GET_CONFIG, 0x4, 16); in test_master_get_config_negative3() localVariable
1015 peer.send_message_with_payload(&hdr, &msg, &buf[0..4], None) in test_master_get_config_negative3()
1022 peer.send_message_with_payload(&hdr, &msg, &buf[0..4], None) in test_master_get_config_negative3()
1034 let hdr = VhostUserMsgHeader::new(MasterReq::GET_CONFIG, 0x4, 16); in test_master_get_config_negative4() localVariable
1036 peer.send_message_with_payload(&hdr, &msg, &buf[0..4], None) in test_master_get_config_negative4()
1043 peer.send_message_with_payload(&hdr, &msg, &buf[0..4], None) in test_master_get_config_negative4()
1055 let hdr = VhostUserMsgHeader::new(MasterReq::GET_CONFIG, 0x4, 16); in test_master_get_config_negative5() localVariable
1057 peer.send_message_with_payload(&hdr, &msg, &buf[0..4], None) in test_master_get_config_negative5()
1064 peer.send_message_with_payload(&hdr, &msg, &buf[0..4], None) in test_master_get_config_negative5()
1076 let hdr = VhostUserMsgHeader::new(MasterReq::GET_CONFIG, 0x4, 16); in test_master_get_config_negative6() localVariable
1078 peer.send_message_with_payload(&hdr, &msg, &buf[0..4], None) in test_master_get_config_negative6()
1085 peer.send_message_with_payload(&hdr, &msg, &buf[0..6], None) in test_master_get_config_negative6()