Module Ip.Addr

module Addr: sig .. end

val print_as_names : bool Batteries.ref
If true, use the system's name resolver to find a name for each IP addresses that are printed. This can be very slow so is disabled by default, but you can change it to suit your taste:
# let ip = Ip.Addr.of_string "217.70.184.38";;
val ip : Ip.Addr.t = 217.70.184.38
# Ip.Addr.print_as_names := true;;
# ip;;
- : Ip.Addr.t = webredir.vip.gandi.net

This affects only printing of IP addresses, though, and thus is not expected to impact a simulation.

include struct ... end
val length : t -> int
val to_dotted_string : t -> string
Regardless of the above setting, return the dotted representation (a string) of a given address.
val of_dotted_string : string -> t option
Convert from dotted representation (useful to allow DNS-less hosts to 'resolve' some name)

Some predefined addresses
val zero : t
val broadcast : t
val to_bitstring : t -> Bitstring.bitstring
Convert an Ip.Addr.t to a bitstring.
val of_bitstring : Bitstring.bitstring -> t
Convert a bitstring into an Ip.Addr.t.
val list_of_string : string -> t list
val of_string : string -> t
val random : ?v4:bool -> unit -> t
Returns a random Ip.Addr.t (apart from broadcast and zero).
val print' : 'a BatInnerIO.output -> t -> unit
This printer can be composed with others (for instance to print a list of ips. FIXME: always use batteries IO to print instead of Format printer?
val of_inet_addr : outer_t -> t
val to_inet_addr : t -> Batteries.Unix.inet_addr
val o32 : int32 -> t
val to_int32 : t -> int32
val higher_bits : t -> int -> t