Crates.io | rsnl |
lib.rs | rsnl |
version | 0.2.0 |
source | src |
created_at | 2015-06-09 21:55:47.34917 |
updated_at | 2015-12-11 23:55:55.315022 |
description | Interface for working with core libnl |
homepage | |
repository | http://www.github.com/carrotsrc/rsnl |
max_upload_size | |
id | 2346 |
size | 15,222 |
This is the beginning of a rust library for interacting with netlink via libnl and their protocol suite (huge respect for their library, it is really great).
The plan is to structure it out similar to the library (core, route, genl, nf), but appropiately abstracted in ways that make it geared more toward being a rust interface. The separation means, like libnl, you only link with what you use.
This library is an exercise in building a clean interface that still feels familiar. It is function orientated, like the C library, with minimal use of structs. The functions and structs are split into submodules, taking advantage of namespaces so nlmsg_alloc()
becomes rsnl::message::alloc()
. The convention being to make the namespace the relevent context so allocating a new socket becomes rsnl::socket::alloc()
. With that said, The design is still in flux with experiments in different ideas.
One thing that is experimented with is avoid handling any voids (a-void, if you will), so hiding 'em away behind the API with casting performed by generics.
Suggestions, changes and improvements are always welcome!
Open a socket
Create a basic message with some attributes
Send message
Started converting some of the macros
Cannot receive anything yet
MIT
(Originally it was LGPL out of respect to libnl but really it's just a small layer, so in retrospect LGPL seems a bit heavy weight.)