mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-23 01:13:23 +00:00
Support calling from inside via vsock
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
48f69c25a9
commit
60dd17fdd3
@ -35,7 +35,7 @@ pub const VIRTIO_VSOCK_HDR_LEN: usize = core::mem::size_of::<VirtioVsockHdr>();
|
||||
|
||||
/// Socket address.
|
||||
#[derive(Copy, Clone, Debug, Default, PartialEq, Eq)]
|
||||
pub struct VsockAddr {
|
||||
pub struct VsockDeviceAddr {
|
||||
/// Context Identifier.
|
||||
pub cid: u64,
|
||||
/// Port number.
|
||||
@ -93,15 +93,15 @@ impl VirtioVsockHdr {
|
||||
VirtioVsockOp::try_from(self.op).map_err(|err| err.into())
|
||||
}
|
||||
|
||||
pub fn source(&self) -> VsockAddr {
|
||||
VsockAddr {
|
||||
pub fn source(&self) -> VsockDeviceAddr {
|
||||
VsockDeviceAddr {
|
||||
cid: self.src_cid,
|
||||
port: self.src_port,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn destination(&self) -> VsockAddr {
|
||||
VsockAddr {
|
||||
pub fn destination(&self) -> VsockDeviceAddr {
|
||||
VsockDeviceAddr {
|
||||
cid: self.dst_cid,
|
||||
port: self.dst_port,
|
||||
}
|
||||
|
Reference in New Issue
Block a user