Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
c93cdcc
Add MSG_CONFIRM and MSG_DONTROUTE to RecvFlags
pd0wm Mar 12, 2024
21ba660
Add MsgHdrMut::control_len to get how much of control buffer was filled.
tobz Apr 15, 2024
630c8a7
Add Socket::passcred/set_passcred for working with SO_PASSCRED.
tobz Apr 15, 2024
6923954
Add test for Socket::passcred/set_passcred and fix formatting.
tobz Apr 17, 2024
8685db5
Use consistent language in change log
Thomasdezeeuw Apr 28, 2024
c8146aa
Release v0.5.7
Thomasdezeeuw Apr 28, 2024
127a4c9
fix typos
m-vz May 24, 2024
6a13053
Ignore clippy new_without_default
Thomasdezeeuw May 24, 2024
7fe1bff
Add: header_included_v6() and set_header_included_v6()
jjnicola Jun 18, 2024
c802777
Merge Check, CheckTier3, Docs and DocsTier3 CI jobs
Thomasdezeeuw Jun 19, 2024
8e331cb
Remove some unsuported targets
Thomasdezeeuw Jun 19, 2024
7fa106c
Update to FreeBSD 14.1 on CI
Thomasdezeeuw Jun 19, 2024
8c97337
Use FreeBSD 13.2 again
Thomasdezeeuw Jun 19, 2024
3a93893
Add Apple visionOS support
QuentinPerez Jul 2, 2024
68de29b
Remove Socket::(set_)header_included_v6 on unsupported OS
jjnicola Nov 21, 2024
33a98be
Add support for original_dst for windows (#529)
keithmattix Nov 27, 2024
60d118f
Release v0.5.8 (#537)
Thomasdezeeuw Nov 28, 2024
56e625e
Add Socket::(set_)recv_hoplimit_v6 (#543)
andreybuchinskiy Dec 5, 2024
0cb5119
Start v0.6 development
Thomasdezeeuw Jan 25, 2025
f0ed438
Remove Socket::(bind_)device_by_index (#548)
Thomasdezeeuw Jan 27, 2025
25337f1
Remove Socket::(set_)header_included (#547)
Thomasdezeeuw Jan 27, 2025
a38d197
Suffix Socket::(set_)ttl with v4
Thomasdezeeuw Jan 25, 2025
0e3f436
Suffix Socket::(set_)tos with v4
Thomasdezeeuw Jan 25, 2025
11428df
Suffix Socket::(set_)ip_transparent with v4
Thomasdezeeuw Jan 25, 2025
171d1eb
Suffix Socket::(set_)recv_tos with v4
Thomasdezeeuw Jan 25, 2025
0ae0c3a
Fix docs link for AsFd
goffrie Jan 27, 2025
23f7a86
Document support for OpenHarmony (#553)
Nugine Feb 16, 2025
62479f7
Improve documentation generation (#554)
proski Feb 18, 2025
34aba73
Ignore clippy::needless-lifetimes (#544)
Thomasdezeeuw Feb 24, 2025
5c1f3b0
Enable `IP_BOUND_IF` on illumos and Solaris (#561)
hawkw Mar 11, 2025
d35ef30
Use IPV6_HDRINCL on Linux(#563)
kntyskw Mar 16, 2025
33291e2
Enable `IP_BOUND_IF` on illumos and Solaris (#565)
hawkw Mar 18, 2025
36dec54
Derive Copy and Clone for InterfaceIndexOrAddress
boris-n Apr 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
freebsd_instance:
image_family: freebsd-13-2
image: freebsd-13-2-release-amd64

env:
RUST_BACKTRACE: full

task:
name: FreeBSD
setup_script:
- curl https://sh.rustup.rs -sSf --output rustup.sh
- fetch https://sh.rustup.rs -o rustup.sh
- sh rustup.sh -y --profile minimal
cargo_cache:
folder: $HOME/.cargo/registry
Expand Down
98 changes: 50 additions & 48 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,35 +51,65 @@ jobs:
- name: Check formatting
run: cargo fmt --all -- --check
Check:
name: Check
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
target: ["aarch64-apple-ios", "aarch64-linux-android", "x86_64-apple-darwin", "x86_64-unknown-fuchsia", "x86_64-pc-windows-msvc", "x86_64-pc-solaris", "x86_64-unknown-freebsd", "x86_64-unknown-illumos", "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl", "x86_64-unknown-netbsd", "x86_64-unknown-redox", "armv7-linux-androideabi", "i686-linux-android"]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: taiki-e/install-action@cargo-hack
- name: Run check
run: cargo hack check --feature-powerset --all-targets --examples --bins --tests --target ${{ matrix.target }}
CheckTier3:
name: Check
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: ["armv7-sony-vita-newlibeabihf", "i686-unknown-hurd-gnu"]
target:
- aarch64-apple-darwin
- aarch64-apple-ios
- aarch64-apple-tvos
# Broken, see https://github.com/rust-lang/socket2/issues/538.
#- aarch64-apple-visionos
- aarch64-apple-watchos
- aarch64-linux-android
- aarch64-unknown-freebsd
- aarch64-unknown-linux-gnu
- aarch64-unknown-linux-musl
- aarch64-unknown-linux-ohos
- aarch64-unknown-netbsd
- aarch64-unknown-openbsd
- aarch64-unknown-redox
- arm-linux-androideabi
- arm64_32-apple-watchos
- armv7-linux-androideabi
- armv7-sony-vita-newlibeabihf
- armv7-unknown-linux-ohos
- i686-linux-android
# Broken, see https://github.com/rust-lang/socket2/issues/539.
#- i686-unknown-hurd-gnu
- i686-unknown-linux-gnu
- sparcv9-sun-solaris
- x86_64-apple-darwin
- x86_64-apple-ios
- x86_64-pc-solaris
# Fails with:
# `rror calling dlltool 'x86_64-w64-mingw32-dlltool': No such file or
# directory (os error 2)`, build log:
# <https://github.com/rust-lang/socket2/actions/runs/9577808331/job/26406752150>.
#- x86_64-pc-windows-gnu
- x86_64-pc-windows-msvc
- x86_64-unknown-dragonfly
- x86_64-unknown-freebsd
- x86_64-unknown-fuchsia
- x86_64-unknown-illumos
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
- x86_64-unknown-linux-ohos
- x86_64-unknown-netbsd
- x86_64-unknown-openbsd
- x86_64-unknown-redox
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: "rust-src"
components: rust-src
- uses: taiki-e/install-action@cargo-hack
- name: Run check
run: cargo hack check -Z build-std=std,panic_abort --feature-powerset --all-targets --examples --bins --tests --target ${{ matrix.target }}
- name: Check build
run: cargo hack check -Z build-std=std,panic_abort --feature-powerset --target ${{ matrix.target }}
- name: Check docs
run: RUSTDOCFLAGS="-D warnings --cfg docsrs" cargo doc -Z build-std=std,panic_abort --no-deps --all-features --target ${{ matrix.target }}
Clippy:
name: Clippy
runs-on: ubuntu-latest
Expand All @@ -88,31 +118,3 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
- name: Run Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
Docs:
name: Docs
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: ["aarch64-apple-ios", "aarch64-linux-android", "x86_64-apple-darwin", "x86_64-unknown-fuchsia", "x86_64-pc-windows-msvc", "x86_64-pc-solaris", "x86_64-unknown-freebsd", "x86_64-unknown-illumos", "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl", "x86_64-unknown-netbsd", "x86_64-unknown-redox", "armv7-linux-androideabi", "i686-linux-android"]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly # NOTE: need nightly for `doc_cfg` feature.
with:
targets: ${{ matrix.target }}
- name: Check docs for docs.rs
run: RUSTDOCFLAGS="-D warnings --cfg docsrs" cargo doc --no-deps --all-features --target ${{ matrix.target }}
DocsTier3:
name: Docs
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: ["armv7-sony-vita-newlibeabihf", "i686-unknown-hurd-gnu"]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly # NOTE: need nightly for `doc_cfg` feature.
with:
components: "rust-src"
- name: Check docs for docs.rs
run: RUSTDOCFLAGS="-D warnings --cfg docsrs" cargo doc -Z build-std=std,panic_abort --no-deps --all-features --target ${{ matrix.target }}
50 changes: 34 additions & 16 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,39 @@
# 0.5.8

* Added `Socket::(set_)header_included_v4` and
`Socket::(set_)header_included_v6`
(https://github.com/rust-lang/socket2/pull/518).
* Added support for `Socket::original_dst` and
`Socket::original_dst_ipv6` on Windows
(https://github.com/rust-lang/socket2/pull/529).

# 0.5.7

* Added `Socket::(set_)passcred`
(https://github.com/rust-lang/socket2/pull/506).
* Added `RecvFlags::is_confirm` and `RecvFlags::is_dontroute`
(https://github.com/rust-lang/socket2/pull/499).
* Added `MsgHdrMut::control_len`
(https://github.com/rust-lang/socket2/pull/505).

# 0.5.6

* Add `Socket::(set_)multicast_all_v{4,6}`
* Added `Socket::(set_)multicast_all_v{4,6}`
(https://github.com/rust-lang/socket2/pull/485 and
(https://github.com/rust-lang/socket2/pull/486).
* Add support for GNU/Hurd
https://github.com/rust-lang/socket2/pull/486).
* Added support for GNU/Hurd
(https://github.com/rust-lang/socket2/pull/474).
* Fix compilation on Haiku
* Fixes compilation on Haiku
(https://github.com/rust-lang/socket2/pull/479 and
(https://github.com/rust-lang/socket2/pull/482).
* Fix compilation on OpenHarmony
https://github.com/rust-lang/socket2/pull/482).
* Fixes compilation on OpenHarmony
(https://github.com/rust-lang/socket2/pull/491).
* Update to window-sys v0.52
(https://github.com/rust-lang/socket2/pull/480).

# 0.5.5

* Add support for Vita
* Added support for Vita
(https://github.com/rust-lang/socket2/pull/465).

# 0.5.4
Expand All @@ -35,7 +53,7 @@
(https://github.com/rust-lang/socket2/pull/442).
* Added `Protocol::DIVERT` on FreeBSD and OpenBSD
(https://github.com/rust-lang/socket2/pull/448).
* Add `Socket::protocol` for Windows (using `WSAPROTOCOL_INFOW`)
* Added `Socket::protocol` for Windows (using `WSAPROTOCOL_INFOW`)
(https://github.com/rust-lang/socket2/pull/470).
* `From<SocketAddrV{4,6}>` for `SockAddr ` nows sets `ss_len` on platforms that
have the fields (most BSDs)
Expand All @@ -53,7 +71,7 @@

# 0.5.2

* Add Unix socket methods to `SockAddr`
* Added Unix socket methods to `SockAddr`
(https://github.com/rust-lang/socket2/pull/403 and
https://github.com/rust-lang/socket2/pull/429).
* Added `SockAddr::as_storage`
Expand Down Expand Up @@ -167,9 +185,9 @@

* Fixed compilation with the `all` on QNX Neutrino
(https://github.com/rust-lang/socket2/pull/419).
* Add support for ESP-IDF
* Added support for ESP-IDF
(https://github.com/rust-lang/socket2/pull/455).
* Add support for Vita
* Added support for Vita
(https://github.com/rust-lang/socket2/pull/475).

# 0.4.9
Expand All @@ -181,7 +199,7 @@

This release was broken for Windows.

* Add `Socket::peek_sender` (backport)
* Added `Socket::peek_sender` (backport)
(https://github.com/rust-lang/socket2/pull/404).

# 0.4.7
Expand All @@ -200,7 +218,7 @@ This release was broken for Windows.
(https://github.com/rust-lang/socket2/pull/307).
* Derive Clone for SockAddr
(https://github.com/rust-lang/socket2/pull/311).
* Fix cfg attributes for Fuchsia
* Fixes cfg attributes for Fuchsia
(https://github.com/rust-lang/socket2/pull/314).

# 0.4.5 (yanked)
Expand All @@ -219,7 +237,7 @@ This release was broken for Windows.

## Fixed

* Fix OpenBSD build
* OpenBSD build
(https://github.com/rust-lang/socket2/pull/291).

# 0.4.4
Expand Down Expand Up @@ -264,13 +282,13 @@ This release was broken for Windows.

## Added

* Add `SockAddr::new`
* Added `SockAddr::new`
* Support for `TCP_USER_TIMEOUT`.
* Support for `IP_BOUND_IF`.
* Support for `IP_TRANSPARENT`.
* Enable `Socket::type` on all platforms.
* Support for uclibc (for Haiku support).
* Add DragonFly support for TCP keepalive (`KEEPINTVL`/`KEEPCNT`).
* Added DragonFly support for TCP keepalive (`KEEPINTVL`/`KEEPCNT`).
* Documentation for proper use of `SockRef::from`, and the improper use.
* Assertion in `SockRef::from` to ensure the raw socket valid.

Expand Down
24 changes: 20 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "socket2"
version = "0.5.6"
version = "0.6.0"
publish = false # In development.
authors = [
"Alex Crichton <alex@alexcrichton.com>",
"Thomas de Zeeuw <thomasdezeeuw@gmail.com>"
Expand Down Expand Up @@ -28,14 +29,29 @@ include = [

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
targets = ["aarch64-apple-ios", "aarch64-linux-android", "x86_64-apple-darwin", "x86_64-unknown-fuchsia", "x86_64-pc-windows-msvc", "x86_64-pc-solaris", "x86_64-unknown-freebsd", "x86_64-unknown-illumos", "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl", "x86_64-unknown-netbsd", "x86_64-unknown-redox", "armv7-linux-androideabi", "i686-linux-android"]
default-target = "x86_64-unknown-linux-gnu"
targets = [
"aarch64-apple-ios",
"aarch64-linux-android",
"armv7-linux-androideabi",
"i686-linux-android",
"x86_64-apple-darwin",
"x86_64-pc-solaris",
"x86_64-pc-windows-msvc",
"x86_64-unknown-freebsd",
"x86_64-unknown-fuchsia",
"x86_64-unknown-illumos",
"x86_64-unknown-linux-gnu",
"x86_64-unknown-linux-musl",
"x86_64-unknown-netbsd",
"x86_64-unknown-redox",
]

[package.metadata.playground]
features = ["all"]

[target."cfg(unix)".dependencies]
libc = "0.2.150"
libc = "0.2.171"

[target.'cfg(windows)'.dependencies.windows-sys]
version = "0.52"
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ feature flag.
* NetBSD
* Redox
* Solaris
* OpenHarmony

# Minimum Supported Rust Version (MSRV)

Expand Down
Loading