summary refs log tree commit diff
path: root/sys_util/src/net.rs
Commit message (Collapse)AuthorAge
* sys_util: recv entire UnixSeqpacket packets into VecZach Reizner2020-02-06
| | | | | | | | | | | | | | | | | | This change adds the `recv_*_vec` suite of methods for getting an entire packet into a `Vec` without needing to know the packet size through some other means. TEST=cargo test -p sys_util -p msg_socket BUG=None Change-Id: Ia4f931ccb91f6de6ee2103387fd95dfad3d3d38b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2034025 Commit-Queue: Zach Reizner <zachr@chromium.org> Tested-by: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Auto-Submit: Zach Reizner <zachr@chromium.org> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-by: Stephen Barber <smbarber@chromium.org>
* crosvm: fix clippy warningsJakub Staron2019-06-08
| | | | | | | | | | | | | | | | | | | Resolve a couple of minor clippy warnings: - unneeded return statement - use `if let` instead of `match` for single pattern destruction - use `values()` function to iterate over map values - supress warning about `ptr::null()` as expressed by the comment BUG=None TEST=./bin/clippy TEST=cargo build Change-Id: Ic4cea94cd3a25a9edf6ef38119de8c46dcfec563 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1646739 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Stephen Barber <smbarber@chromium.org> Commit-Queue: Jakub StaroĊ„ <jstaron@google.com>
* eliminate usage of uninitializedZach Reizner2019-05-23
| | | | | | | | | | | | | | | | | uninitialized is deprecated and considered too dangerous to use for any of the use cases we were using. BUG=None TEST=passes smoke_test Change-Id: I5392cb8ec132f374d9b5590f72eb2cb329a82421 Reviewed-on: https://chromium-review.googlesource.com/1626795 Commit-Ready: Zach Reizner <zachr@chromium.org> Tested-by: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org> Reviewed-by: Stephen Barber <smbarber@chromium.org>
* clippy: Iterate without calling .iter()David Tolnay2019-04-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | See: https://rust-lang.github.io/rust-clippy/master/index.html#explicit_iter_loop https://rust-lang.github.io/rust-clippy/master/index.html#explicit_into_iter_loop Before: for element in slice.iter() {...} After: for element in slice {...} TEST=grep -r '\.iter() {' TEST=grep -r '\.iter_mut() {' TEST=grep -r '\.into_iter() {' TEST=cargo check --all-features TEST=local kokoro Change-Id: I27f0df7cfa1064b2c8b162cba263513926a433a9 Reviewed-on: https://chromium-review.googlesource.com/1568525 Commit-Ready: David Tolnay <dtolnay@chromium.org> Tested-by: David Tolnay <dtolnay@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
* sys_util: Use expect_err instead of panickingChirantan Ekbote2019-04-09
| | | | | | | | | | | | | | Use expect_err in the unix_seqpacket_zero_timeout test instead of `#[should_panic]` as the panic is causing a memory leak. BUG=chromium:950576 TEST=`USE=asan FEATURES=test emerge-amd64-generic sys_util` Change-Id: I7a42bbbc741a84398989393e3294747cd01cee14 Reviewed-on: https://chromium-review.googlesource.com/1558933 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
* sys_util: net: Make clippy cleanDylan Reid2019-03-26
| | | | | | | | | Use from instead of as. Signed-off-by: Dylan Reid <dgreid@chromium.org> Change-Id: I02342bd352cd98417011ceb5a79ba5bde5551a07 Reviewed-on: https://chromium-review.googlesource.com/1510071 Tested-by: kokoro <noreply+kokoro@google.com>
* sys_util: remove deprecated functionspaulhsia2019-03-05
| | | | | | | | | | | | | | | | | Remove `write` and `read` after the only user in CL:1488597 change its usage. TEST=cargo test -p sys_util BUG=chromium:848187 CQ-DEPEND=CL:1488597 Change-Id: I15e03077f8970ea8350c7f64de9b64b16a08bfc1 Reviewed-on: https://chromium-review.googlesource.com/1488553 Commit-Ready: Chih-Yang Hsia <paulhsia@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Tested-by: Chih-Yang Hsia <paulhsia@chromium.org> Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org>
* sys_util: add seqpacket featuresZach Reizner2019-02-28
| | | | | | | | | | | | | | | | This change adds the ability to make seqpacket pairs, and set the timeouts of the sockets. This also adds a TcpListener style api for accepting UnixSeqpacket sockets. TEST=cargo test -p sys_util BUG=chromium:848187 Change-Id: I9f9bb5224cdfaf257d8e4a1bdaac8128be874951 Reviewed-on: https://chromium-review.googlesource.com/1482371 Commit-Ready: Zach Reizner <zachr@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Tested-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
* sys_util: Fix unit test error in armpaulhsia2019-01-23
| | | | | | | | | | | | | | | | | `libc::c_char` is `u8` instead of `i8` in arm, the test should use `libc::c_char` directly. Test unit tests with different architectures. BUG=chromium:907520 TEST=$ FEATURES=test emerge-{kevin,eve} sys_util Change-Id: Ie70da89470487d95675cb06b761e9ae9057bc38f Reviewed-on: https://chromium-review.googlesource.com/1430400 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: kokoro <noreply+kokoro@google.com> Tested-by: Chih-Yang Hsia <paulhsia@chromium.org> Reviewed-by: David Tolnay <dtolnay@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org>
* sys_util: Add net module includes UnixSeqpacketpaulhsia2019-01-10
std::os::net only supprts UnixDatagram and UnixStream, so we need this to support the connection to socket opened with SOCK_SEQPACKET flag. It only supports public API connect, write, try_clone, and read now. BUG=chromium:907520 TEST=Use $ FEATURES=test emerge-eve sys_util to run unit tests. Change-Id: I61a9acd4fa2e601e93b1f76dc1758cb61a433205 Reviewed-on: https://chromium-review.googlesource.com/1390077 Commit-Ready: Chih-Yang Hsia <paulhsia@chromium.org> Tested-by: Chih-Yang Hsia <paulhsia@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org>