Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/asomers/capsicum-net
Rust bindings for FreeBSD's cap_net library
https://github.com/asomers/capsicum-net
Last synced: 3 months ago
JSON representation
Rust bindings for FreeBSD's cap_net library
- Host: GitHub
- URL: https://github.com/asomers/capsicum-net
- Owner: asomers
- License: apache-2.0
- Created: 2023-12-07T19:50:47.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-10-11T22:37:25.000Z (3 months ago)
- Last Synced: 2024-10-14T02:46:17.491Z (3 months ago)
- Language: Rust
- Size: 85 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# capsicum-net
Rust bindings to FreeBSD's [cap_net(3)] library. `cap_net` allows access to
several network APIs that are forbidden in capability mode by delegating them to
an unsandboxed process, the Casper daemon.![Build Status](https://api.cirrus-ci.com/github/asomers/capsicum-net.svg)](https://cirrus-ci.com/github/asomers/capsicum-net)
[![Crates.io](https://img.shields.io/crates/v/capsicum-net.svg)](https://crates.io/crates/capsicum-net)[Documentation](https://docs.rs/crate/capsicum-net)
[cap_net(3)]: https://man.freebsd.org/cgi/man.cgi?query=cap_net
# Usage
See the examples in the API docs. The general idea is to create the `Casper`
and `CapNetAgent` objects when your program first starts up. Then, use
functions like `CapNetAgent::bind` instead of `std::net::UdpSocket::bind`.
There are three APIs available:* Low-level methods which operate directly on the `CapNetAgent` object. These
work well with the [nix](https://docs.rs/nix/0.27.1/nix/) crate.
* Extension traits that work on the standard socket types.
* Extension traits that work with tokio types. These require the crate to be
built with the `tokio` feature.# Platforms
This crate only works on FreeBSD 13 and later. At least, until somebody ports
`cap_net` to a different operating system.# Minimum Supported Rust Version (MSRV)
`capsicum-net` does not guarantee any specific MSRV. Rather, it guarantees
compatibility with the oldest rustc shipped in the FreeBSD package collection.* https://www.freshports.org/lang/rust/
# License
`capsicum-net` is primarily distributed under the terms of both the MIT license
and the Apache License (Version 2.0).See LICENSE-APACHE, and LICENSE-MIT for details.
# Sponsorship
`capsicum-net` is sponsored by Axcient, inc.