An IPv4 address stored as a 32-bit unsigned integer. $$\text{IPv4} = \{ \text{addr} : \text{UInt32} \}$$
- addr : UInt32
Instances For
@[implicit_reducible]
Equations
Equations
- Data.IP.instBEqIPv4.beq { addr := a } { addr := b } = (a == b)
- Data.IP.instBEqIPv4.beq x✝¹ x✝ = false
Instances For
Instances For
@[implicit_reducible]
Equations
Equations
- Data.IP.instReprIPv4.repr x✝ prec✝ = Std.Format.bracket "{ " (Std.Format.nil ++ Std.Format.text "addr" ++ Std.Format.text " := " ++ (Std.Format.nest 8 (repr x✝.addr)).group) " }"
Instances For
@[implicit_reducible]
Equations
- Data.IP.instReprIPv4 = { reprPrec := Data.IP.instReprIPv4.repr }
Equations
- Data.IP.instInhabitedIPv4.default = { addr := default }
Instances For
@[implicit_reducible]
Equations
@[inline]
Create an IPv4 from four octets: a.b.c.d
$$\text{ofOctets}(a, b, c, d) = (a \ll 24) \lor (b \ll 16) \lor (c \ll 8) \lor d$$
Equations
Instances For
@[implicit_reducible]
Equations
- One or more equations did not get rendered due to their size.
@[implicit_reducible]
Equations
- Data.IP.IPv4.instOrd = { compare := fun (a b : Data.IP.IPv4) => compare a.addr b.addr }
The loopback address 127.0.0.1.
Equations
- Data.IP.IPv4.loopback = Data.IP.IPv4.ofOctets 127 0 0 1
Instances For
The broadcast address 255.255.255.255.
Equations
- Data.IP.IPv4.broadcast = { addr := 4294967295 }
Instances For
An IPv6 address stored as two 64-bit unsigned integers (high, low). $$\text{IPv6} = \{ \text{hi} : \text{UInt64},\; \text{lo} : \text{UInt64} \}$$
Instances For
@[implicit_reducible]
Equations
@[implicit_reducible]
Equations
@[implicit_reducible]
Equations
- Data.IP.instReprIPv6 = { reprPrec := Data.IP.instReprIPv6.repr }
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instances For
@[implicit_reducible]
Equations
@[implicit_reducible]
Equations
- Data.IP.IPv6.instOrd = { compare := fun (a b : Data.IP.IPv6) => match compare a.hi b.hi with | Ordering.eq => compare a.lo b.lo | ord => ord }
Equations
- Data.IP.instBEqIP.beq (Data.IP.IP.v4 a) (Data.IP.IP.v4 b) = (a == b)
- Data.IP.instBEqIP.beq (Data.IP.IP.v6 a) (Data.IP.IP.v6 b) = (a == b)
- Data.IP.instBEqIP.beq x✝¹ x✝ = false
Instances For
@[implicit_reducible]
Equations
- Data.IP.instBEqIP = { beq := Data.IP.instBEqIP.beq }
@[implicit_reducible]
Equations
- Data.IP.instReprIP = { reprPrec := Data.IP.instReprIP.repr }
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[implicit_reducible]
Equations
- Data.IP.IP.instToString = { toString := fun (x : Data.IP.IP) => match x with | Data.IP.IP.v4 a => toString a | Data.IP.IP.v6 a => toString a }
@[inline]
Check if an address falls within this CIDR range. $$\text{isMatchedTo}(ip, r) \iff (ip \land \text{mask}) = (\text{base} \land \text{mask})$$
Instances For
@[implicit_reducible]
@[implicit_reducible]
@[implicit_reducible]
Equations
- Data.IP.AddrRange.instToString = { toString := fun (x : Data.IP.AddrRange) => match x with | Data.IP.AddrRange.v4 r => toString r | Data.IP.AddrRange.v6 r => toString r }
Parse an IPv4 address from dotted-decimal string.
Returns none on invalid input.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Parse a CIDR range like "192.168.1.0/24".
Equations
- One or more equations did not get rendered due to their size.