mirror of
https://github.com/achanda/ipnetwork.git
synced 2025-06-17 01:08:53 +00:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
fd452cd156 | |||
f0fd68e962 | |||
ae784fe161 | |||
ab7d5b32d0 |
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "ipnetwork"
|
name = "ipnetwork"
|
||||||
version = "0.12.3"
|
version = "0.12.4"
|
||||||
authors = ["Abhishek Chanda <abhishek.becs@gmail.com>", "Linus Färnstrand <faern@faern.net>"]
|
authors = ["Abhishek Chanda <abhishek.becs@gmail.com>", "Linus Färnstrand <faern@faern.net>"]
|
||||||
description = "A library to work with IP CIDRs in Rust, heavily WIP"
|
description = "A library to work with IP CIDRs in Rust, heavily WIP"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
@ -7,7 +7,7 @@ use common::{IpNetworkError, cidr_parts, parse_prefix, parse_addr};
|
|||||||
const IPV4_BITS: u8 = 32;
|
const IPV4_BITS: u8 = 32;
|
||||||
|
|
||||||
/// Represents a network range where the IP addresses are of v4
|
/// Represents a network range where the IP addresses are of v4
|
||||||
#[derive(Debug,Clone,Copy,Hash,PartialEq,Eq)]
|
#[derive(Debug,Clone,Copy,Hash,PartialEq,Eq,PartialOrd,Ord)]
|
||||||
pub struct Ipv4Network {
|
pub struct Ipv4Network {
|
||||||
addr: Ipv4Addr,
|
addr: Ipv4Addr,
|
||||||
prefix: u8,
|
prefix: u8,
|
||||||
|
@ -9,7 +9,7 @@ const IPV6_BITS: u8 = 128;
|
|||||||
const IPV6_SEGMENT_BITS: u8 = 16;
|
const IPV6_SEGMENT_BITS: u8 = 16;
|
||||||
|
|
||||||
/// Represents a network range where the IP addresses are of v6
|
/// Represents a network range where the IP addresses are of v6
|
||||||
#[derive(Debug,Clone,Copy,Hash,PartialEq,Eq)]
|
#[derive(Debug,Clone,Copy,Hash,PartialEq,Eq,PartialOrd,Ord)]
|
||||||
pub struct Ipv6Network {
|
pub struct Ipv6Network {
|
||||||
addr: Ipv6Addr,
|
addr: Ipv6Addr,
|
||||||
prefix: u8,
|
prefix: u8,
|
||||||
|
@ -20,7 +20,7 @@ pub use common::IpNetworkError;
|
|||||||
|
|
||||||
/// Represents a generic network range. This type can have two variants:
|
/// Represents a generic network range. This type can have two variants:
|
||||||
/// the v4 and the v6 case.
|
/// the v4 and the v6 case.
|
||||||
#[derive(Debug,Clone,Copy,Hash,PartialEq,Eq)]
|
#[derive(Debug,Clone,Copy,Hash,PartialEq,Eq,PartialOrd,Ord)]
|
||||||
pub enum IpNetwork {
|
pub enum IpNetwork {
|
||||||
V4(Ipv4Network),
|
V4(Ipv4Network),
|
||||||
V6(Ipv6Network),
|
V6(Ipv6Network),
|
||||||
|
Reference in New Issue
Block a user