use std::net::Ipv4Addr;
use std::str::FromStr;
use ipnet::{Ipv4Net, Ipv6Net};

fn main() {
    let net4 = Ipv4Net::from_str("10.1.1.0/24").unwrap();
    let net6 = Ipv6Net::from_str("fd00::/24").unwrap();

    println!("{:?}", net4);
    println!("{:?}", net6);

    let ip: Ipv4Addr = "192.168.0.1".parse().unwrap();
    println!("{}", net4.contains(&ip));
    let ip: Ipv4Addr = "10.1.1.1".parse().unwrap();
    println!("{}", net4.contains(&ip));
}
