Crate neli [] [src]

Type safety for the weary netlink user

Rationale

The libc crate currently provides an interface for sockets but the constants to configure the socket to do anything useful in netlink are not included in the crate because they live in /usr/include/linux/netlink.h and friends. As a result, doing anything with netlink in Rust is currently a bit of a headache.

This crate aims to define the necessary constants and wrap them in types to both take advantage of the Rust type system and also avoid the need to pop open .h files to find the information necessary to construct netlink messages.

Notes

This crate is currently under heavy development.

The cc crate is a build dependency to provide as much of a natively cross distribution approach as possible regarding #defines in C. It is used to compile a C file that includes the appropriate headers and exports them to the corresponding stdint.h types in C.

Modules

err

Error module

ffi

C constants defined as types

genlhdr

Genetlink (generic netlink) header and attribute helpers

nlhdr

Top-level netlink header

socket

Wrapper for libc sockets

Structs

NlDeState

Struct representing the necessary state to deserialize an object

NlSerState

Struct representing the necessary state to serialize an object

Traits

Nl

Trait defining basic actions required for netlink communication