https://github.com/tom-code/rust-sctp
linux sctp in rust with tokio
https://github.com/tom-code/rust-sctp
Last synced: about 2 months ago
JSON representation
linux sctp in rust with tokio
- Host: GitHub
- URL: https://github.com/tom-code/rust-sctp
- Owner: tom-code
- Created: 2024-06-01T16:33:37.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2026-01-13T08:34:18.000Z (2 months ago)
- Last Synced: 2026-01-13T10:52:10.964Z (2 months ago)
- Language: Rust
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# async sctp for rust
This is wrapper to use linux kernel sctp module in rust with focus on async/tokio compatibility.
Wrapper does not use lksctp library, but directly libc calls. This simplifies setup of cross compilation.
features:
- bindx - bind multiple IP addresses (for multihoming use)
- connectx - connect with multiple ip addresses (for multihoming use)
- set_ppid - configure default protocol identifier to be used in outgoing requests
- sendmsg with data and sctp_sndinfo
- sendmsg with data and default values
- recvmsg returning data
- implements tokio AsyncWrite and AsyncRead
- this sounds little strange, but it is usefull for protocols defined for both tcp and sctp to have as unified implementation as possible.
- this is used for example for diameter stack which could then use AsyncWrite/AsyncRead to send/receive from both tcp and sctp
- supports stream split for AsyncWrite/AsyncRead use. For sendmsg/recvmsg split is not required(they do not require mutable access)
- Write of complete message must be obviusly done in single write. It is ok to use write_all.
- Read with large enough buffer will always read one complete message.
- Read with smaller buffer than message will return portion of message, next read will return next portion.