1
2
3
4
5
6
7
8
9
10
11
12
13
mod control_message;
pub mod interface;
pub mod networkaddress;
mod raw_socket;
pub mod socket;

/// Turn a C failure (-1 is returned) into a rust Result
pub(crate) fn cerr(t: libc::c_int) -> std::io::Result<libc::c_int> {
    match t {
        -1 => Err(std::io::Error::last_os_error()),
        _ => Ok(t),
    }
}