Skip to content

Add support for rust sockets in the network interface#2603

Merged
stevenengler merged 4 commits intoshadow:mainfrom
stevenengler:wrap-tcp-rust
Dec 12, 2022
Merged

Add support for rust sockets in the network interface#2603
stevenengler merged 4 commits intoshadow:mainfrom
stevenengler:wrap-tcp-rust

Conversation

@stevenengler
Copy link
Copy Markdown
Contributor

This adds support for the InetSocket type in CompatSocket. We don't actually use this variant of CompatSocket yet since the C bind/connect/listen syscall handlers work only with LegacySocket objects. When we write these syscall handlers in rust, we can add our InetSocket directly to the network interface instead of downcasting to a TcpSocket and then to a LegacySocket like the C syscalls do.

This does break the tracker's per-socket statistics, but we don't currently use them, we're considering removing them, and I will try to update the tracker in another PR.

@stevenengler stevenengler added the Component: Main Composing the core Shadow executable label Dec 12, 2022
@stevenengler stevenengler self-assigned this Dec 12, 2022
@codecov
Copy link
Copy Markdown

codecov bot commented Dec 12, 2022

Codecov Report

Base: 67.26% // Head: 67.00% // Decreases project coverage by -0.26% ⚠️

Coverage data is based on head (140a5d7) compared to base (661e780).
Patch coverage: 4.34% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2603      +/-   ##
==========================================
- Coverage   67.26%   67.00%   -0.27%     
==========================================
  Files         197      197              
  Lines       29115    29182      +67     
  Branches     5737     5740       +3     
==========================================
- Hits        19584    19553      -31     
- Misses       4985     5085     +100     
+ Partials     4546     4544       -2     
Flag Coverage Δ
tests 67.00% <4.34%> (-0.27%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/main/host/descriptor/socket/inet/mod.rs 16.83% <0.00%> (-10.59%) ⬇️
src/main/host/descriptor/socket/inet/tcp.rs 60.13% <0.00%> (-12.89%) ⬇️
src/main/utility/legacy_callback_queue.rs 79.62% <100.00%> (+0.78%) ⬆️
src/main/utility/stream_len.rs 38.09% <0.00%> (-4.77%) ⬇️
src/main/host/descriptor/pipe.rs 77.50% <0.00%> (-4.38%) ⬇️
src/main/core/logger/shadow_logger.rs 67.25% <0.00%> (-2.93%) ⬇️
src/lib/shmem/src/scmutex.rs 87.64% <0.00%> (-2.36%) ⬇️
src/main/host/memory_manager/memory_mapper.rs 66.66% <0.00%> (-2.28%) ⬇️
src/main/utility/shm_cleanup.rs 59.09% <0.00%> (-2.28%) ⬇️
src/main/host/syscall/handler/fcntl.rs 46.96% <0.00%> (-1.52%) ⬇️
... and 7 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@stevenengler stevenengler merged commit 6ed1887 into shadow:main Dec 12, 2022
@stevenengler stevenengler deleted the wrap-tcp-rust branch December 12, 2022 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Main Composing the core Shadow executable

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants