netlink-packet-route 0.30.0

netlink packet types
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// SPDX-License-Identifier: MIT

use std::net::IpAddr;

use crate::AddressFamily;

impl From<IpAddr> for AddressFamily {
    fn from(v: IpAddr) -> Self {
        match v {
            IpAddr::V4(_) => AddressFamily::Inet,
            IpAddr::V6(_) => AddressFamily::Inet6,
        }
    }
}