[−][src]Module neli::socket
Wrapper for libc sockets
This module provides code that glues all of the other modules together and allows message send
and receive operations. This module relies heavily on the buffering crate. See buffering
for more information on the serialization and deserialization implementations.
Important methods
sendandrecvmethods are meant to be the most low level calls. They essentially do what the C system callssendandrecvdo with very little abstraction.send_nlandrecv_nlmethods are meant to provide an interface that is more idiomatic for the library. The are able to operate on any structure wrapped in anNlmsghdrstruct that implements theNltrait.iterprovides a loop based iteration through messages that are received in a stream over the socket.recv_ackreceives an ACK message and verifies it matches the request.
Features
The stream feature exposed by cargo allows the socket to use Rust's tokio for async IO.
Additional methods
There are methods for blocking and non-blocking, resolving generic netlink multicast group IDs, and other convenience functions so see if your use case is supported. If it isn't, please open a Github issue and submit a feature request.
Structs
| NlMessageIter | Iterator over messages returned from a |
| NlSocket | Handle for the socket file descriptor |