Ipaddr.V4A collection of functions for IPv4 addresses.
val make : int -> int -> int -> int -> tConverts the low bytes of four int values into an abstract V4.t.
These manipulate human-readable IPv4 addresses (for example 192.168.1.2).
val of_string : string -> (t, [> `Msg of string ]) Stdlib.resultof_string s is the address t represented by the human-readable IPv4 address s. Returns a human-readable error string if parsing failed.
val of_string_exn : string -> tof_string_exn s is the address t represented as a human-readable IPv4 address s. Raises Parse_error if s is invalid or truncated.
val of_string_raw : string -> int Stdlib.ref -> tof_string_raw s off acts as of_string_exn but takes as an extra argument the offset into the string for reading. off will be mutated to an unspecified value during the function call. s will a Parse_error exception if it is an invalid or truncated IP address.
val with_port_of_string : 
  default:int ->
  string ->
  (t * int, [> `Msg of string ]) Stdlib.resultwith_port_of_string ~default s is the address t represented by the human-readble IPv4 address s with a possibly port :<port> (otherwise, we take the default value).
val to_string : t -> stringto_string ipv4 is the dotted decimal string representation of ipv4, i.e. XXX.XX.X.XXX.
val to_buffer : Stdlib.Buffer.t -> t -> unitto_buffer buf ipv4 writes the string representation of ipv4 into the buffer buf.
val pp : Stdlib.Format.formatter -> t -> unitpp f ipv4 outputs a human-readable representation of ipv4 to the formatter f.
These manipulate IPv4 addresses represented as a sequence of four bytes. (e.g for example 0xc0a80102 will be the representation of the human-readable 192.168.1.2 address.
val of_octets : ?off:int -> string -> (t, [> `Msg of string ]) Stdlib.resultof_octets ?off s is the IPv4 address t represented by the octets in s starting from offset off within the string. Returns a human-readable error string if s is not at least off+4 bytes long. off defaults to 0.
val of_octets_exn : ?off:int -> string -> tof_octets_exn ipv4_octets is the IPv4 address represented by ipv4_octets starting from offset off. Raises Parse_error if ipv4_octets is not at least off+4 bytes long. off defaults to 0.
val write_octets : 
  ?off:int ->
  t ->
  bytes ->
  (unit, [> `Msg of string ]) Stdlib.resultwrite_octets ?off ipv4 b writes the ipv4 as octets to b starting from offset off. b must be at least off+4 long or an error is returned.
val write_octets_exn : ?off:int -> t -> bytes -> unitwrite_octets_exn ?off ipv4 b writes the ipv4 as octets to b starting from offset off. b must be at least off+4 long or a Parse_error is raised.
val to_octets : t -> stringto_octets ipv4 returns the 4 bytes representing the ipv4 octets.
val of_int32 : int32 -> tof_int32 ipv4_packed is the address represented by ipv4_packed.
val to_int32 : t -> int32to_int32 ipv4 is the 32-bit packed encoding of ipv4.
val of_int16 : (int * int) -> tof_int16 ipv4_packed is the address represented by ipv4_packed.
val to_int16 : t -> int * intto_int16 ipv4 is the 16-bit packed encoding of ipv4.
multicast_to_mac ipv4 is the MAC address corresponding to the multicast address ipv4. Described by RFC 1112.
val to_domain_name : t -> [ `host ] Domain_name.tto_domain_name ipv4 is the domain name label list for reverse lookups of ipv4. This includes the .in-addr.arpa suffix.
val of_domain_name : 'a Domain_name.t -> t optionof_domain_name name is Some t if the name has an .in-addr.arpa suffix, and an IPv4 address prefixed.
succ ipv4 is ip address next to ipv4. Returns a human-readable error string if it's already the highest address.
pred ipv4 is ip address before ipv4. Returns a human-readable error string if it's already the lowest address.
val any : tany is 0.0.0.0.
val unspecified : tunspecified is 0.0.0.0.
val broadcast : tbroadcast is 255.255.255.255.
val nodes : tnodes is 224.0.0.1.
val routers : trouters is 224.0.0.2.
val localhost : tlocalhost is 127.0.0.1.
module Prefix : sig ... endA module for manipulating IPv4 network prefixes (CIDR).
val is_global : t -> boolis_global ipv4 is a predicate indicating whether ipv4 globally addresses a node.
val is_multicast : t -> boolis_multicast ipv4 is a predicate indicating whether ipv4 is a multicast address.
val is_private : t -> boolis_private ipv4 is a predicate indicating whether ipv4 privately addresses a node.