max_host (Cidr IPv4Address.None _) = IPv4Address.None
max_host (Cidr _ Maskbits.None) = IPv4Address.None
max_host (Cidr addr mask)
- | mask == ThirtyTwo = ipv4address_from_octets oct1 oct2 oct3 oct4
- | mask == ThirtyOne = ipv4address_from_octets oct1 oct2 oct3 (Octet a25 a26 a27 a28 a29 a30 a31 B.One)
- | mask == Thirty = ipv4address_from_octets oct1 oct2 oct3 (Octet a25 a26 a27 a28 a29 a30 B.One B.One)
- | mask == TwentyNine = ipv4address_from_octets oct1 oct2 oct3 (Octet a25 a26 a27 a28 a29 B.One B.One B.One)
- | mask == TwentyEight = ipv4address_from_octets oct1 oct2 oct3 (Octet a25 a26 a27 a28 B.One B.One B.One B.One)
- | mask == TwentySeven = ipv4address_from_octets oct1 oct2 oct3 (Octet a25 a26 a27 B.One B.One B.One B.One B.One)
- | mask == TwentySix = ipv4address_from_octets oct1 oct2 oct3 (Octet a25 a26 B.One B.One B.One B.One B.One B.One)
- | mask == TwentyFive = ipv4address_from_octets oct1 oct2 oct3 (Octet a25 B.One B.One B.One B.One B.One B.One B.One)
- | mask == TwentyFour = ipv4address_from_octets oct1 oct2 oct3 (max_octet)
+ | mask == ThirtyTwo = addr
+ | mask == ThirtyOne = addr { octet4 = oct4 { b8 = B.One } }
+ | mask == Thirty = addr { octet4 = oct4 { b7 = B.One, b8 = B.One } }
+ | mask == TwentyNine = addr { octet4 = oct4 { b6 = B.One,
+ b7 = B.One,
+ b8 = B.One } }
+ | mask == TwentyEight = addr { octet4 = oct4 { b5 = B.One,
+ b6 = B.One,
+ b7 = B.One,
+ b8 = B.One } }
+ | mask == TwentySeven = addr { octet4 = oct4 { b4 = B.One,
+ b5 = B.One,
+ b6 = B.One,
+ b7 = B.One,
+ b8 = B.One } }
+ | mask == TwentySix = addr { octet4 = oct4 { b3 = B.One,
+ b4 = B.One,
+ b5 = B.One,
+ b6 = B.One,
+ b7 = B.One,
+ b8 = B.One } }
+ | mask == TwentyFive = addr { octet4 = oct4 { b2 = B.One,
+ b3 = B.One,
+ b4 = B.One,
+ b5 = B.One,
+ b6 = B.One,
+ b7 = B.One,
+ b8 = B.One } }
+ | mask == TwentyFour = addr { octet4 = max_octet }
| mask == TwentyThree = ipv4address_from_octets oct1 oct2 (Octet a17 a18 a19 a20 a21 a22 a23 B.One) (max_octet)
| mask == TwentyTwo = ipv4address_from_octets oct1 oct2 (Octet a17 a18 a19 a20 a21 a22 B.One B.One) (max_octet)
| mask == TwentyOne = ipv4address_from_octets oct1 oct2 (Octet a17 a18 a19 a20 a21 B.One B.One B.One) (max_octet)
a21 = (b5 oct3)
a22 = (b6 oct3)
a23 = (b7 oct3)
- a25 = (b1 oct4)
- a26 = (b2 oct4)
- a27 = (b3 oct4)
- a28 = (b4 oct4)
- a29 = (b5 oct4)
- a30 = (b6 oct4)
- a31 = (b7 oct4)
oct1 = (octet1 addr)
oct2 = (octet2 addr)
oct3 = (octet3 addr)