Module Interface.AddressSource

Interface addresses.

Sourcetype t

The type for one address an interface carries.

Sourceval v : interface:string -> prefix:Ipaddr.Prefix.t -> loopback:bool -> t

v ~interface ~prefix ~loopback is the address prefix of the interface named interface, a loopback interface iff loopback is true.

Sourceval interface : t -> string

interface a is the name of a's interface, such as en0 or eth0.

Sourceval prefix : t -> Ipaddr.Prefix.t

prefix a is a with its on-link prefix length, such as 192.0.2.7/24: the interface's netmask, or the full length where it has none.

Sourceval is_loopback : t -> bool

is_loopback a is true iff a's interface is a loopback interface.

Sourceval equal : t -> t -> bool

equal a0 a1 is true iff a0 and a1 have equal interfaces, prefixes and loopback flags.

Sourceval pp : t Fmt.t

pp formats an address as its interface and prefix, as in lo0 127.0.0.1/8.