Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/djg/cmsg-rs
Helper for working with Unix Domain Socket ancilliary control messages.
https://github.com/djg/cmsg-rs
cmsg rust sockets unix
Last synced: 27 days ago
JSON representation
Helper for working with Unix Domain Socket ancilliary control messages.
- Host: GitHub
- URL: https://github.com/djg/cmsg-rs
- Owner: djg
- License: mit
- Created: 2017-10-11T00:14:42.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-10-11T00:45:14.000Z (over 7 years ago)
- Last Synced: 2024-11-01T05:26:31.515Z (3 months ago)
- Topics: cmsg, rust, sockets, unix
- Language: Rust
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-MIT
Awesome Lists containing this project
README
# cmsg
[![Build Status](https://travis-ci.org/djg/cmsg-rs.svg?branch=master)](https://travis-ci.org/djg/cmsg-rs)
A library for working with ancilliary control messages for Unix Domain Sockets as described by [cmsg].
[cmsg]: http://man7.org/linux/man-pages/man3/cmsg.3.html
```toml
# Cargo.toml
[dependencies]
bytes = "0.4"
cmsg = "0.1"
```## Usage
To process received control messages, `cmsg::iterator()` is used to
create an iterator adapter over the raw bytes received from
`libc::recvmsg`.To create control messages, `cmsg::builder()` is used to create a
builder interface over the top of pre-allocated storage. Using
`Vec`, `bytes::BytesMut`, and stack-based arrays, via
`std::io::Cursor` are supported. The builder checks that the storages
is correctly aligned and maintains alignment of each appended message.# License
`cmsg-rs` is primarily distributed under the terms of the MIT license.
See LICENSE-MIT for details.