Not_found exception when parsing [: in IPv6 and instead raise Parse_error as other errors do (found by fuzz testing in #84 by @dinosaure)[@@ocaml.toplevel_printer]. This enables utop to automatically install the printers (@avsm)This release features several backwards incompatible changes, but ones that should increase the portability and robustness of the library.
Remove the sexp serialisers from the main interface in favour of pp functions. Use the Ipaddr_sexp module if you still need a sexp serialiser.
To use these with ppx-based derivers, simply replace the reference to the Ipaddr type definition with Ipaddr_sexp. That will import the sexp-conversion functions, and the actual type definitions are simply aliases to the corresponding type within Ipaddr. For example, you might do:
type t = {
ip: Ipaddr_sexp.t;
mac: Macaddr_sexp.t;
} [@@deriving sexp]The actual types of the records will be aliases to the main library types, and there will be two new functions available as converters. The signature after ppx has run will be:
type t = {
ip: Ipaddr.t;
mac: Macaddr.t;
}
val sexp_of_t : t -> Sexplib0.t
val t_of_sexp : Sexplib0.t -> tMacaddr module into a separate opam package so that the Ipaddr module can be wrapped. Use the macaddr opam library now if you need just the MAC address functionality.of_string/bytes functions that formerly returned option types with the Rresult result types instead. This stops the cause of the exception from being swallowed, and the error message in the new functions can be displayed usefully.Ipaddr.V6.to_string and to_buffer functions, remove the optional labelled argument v4 and always output v4-mapped strings as recommended by RFC5952. (#80 by @hannesm).pp_hum which was deprecated in 2.9.0.pp functions for prettyprinting and deprecate pp_hum variants. The two functions are currently the same, so porting is just a matter of replacing existing uses of pp_hum with pp (#71 @verbosemode)base-unix depopt to be a real dependency (#68 @rgrinberg).sexplib dependency (#66 #67 @bmillwood).ipaddr.top package by linking to compiler-libs instead of compiler-libs.toplevel (#76 @avsm based on fix in mirage/ocaml-uri#130 by @yallop)Ipaddr_unix is now in a separate subdirectory. This means that packages that implicitly depended on the module without including the ocamlfind ipaddr.unix package may now fail. Just adding the ocamlfind dependency will fix it, and is backwards compatible with older Ipaddr releases.ppx_sexp_conv with Jbuilder also having that as the minimum supported compiler version.sexplib.syntax, type_conv deps and camlp4 transitive dependencyppx_sexp_conv dependencyIpaddr.Prefix.subset, Ipaddr.V4.Prefix.subset and Ipaddr.V6.subset predicates to test containment of subnets (#52 from @seliopou)to_bytes_raw now uses Bytes.t rather than string (potentially breaking)to_domain_name conversions to DNS label lists (in-addr.arpa and ip6.arpa)V6.interface_routers, V6.site_routers, and V6.Prefix.solicited_nodeV6.link_address_of_mac to convert a MAC into a link local IP addresswith sexp (de)serializers to all of the Ipaddr and Macaddr types. (#31)Ipaddr.V6.Prefix.of_netmask for conversion from an IPv6 address/netmask to prefix (useful for some binary interfaces). See #27.Ipaddr.V6.Prefix.netmask to generate a netmask address from a prefix (useful for some binary interfaces). See #27.Ipaddr.Prefix.network for generic prefix -> address conversionIpaddr.Prefix.netmask for generic prefix -> netmask conversionIpaddr.V4.Prefix.of_netmask for conversion from an address/netmask to prefixIpaddr.V4.Prefix.netmask to generate a netmask address from a prefixipaddr.top package.of_string_raw to Ipaddr.V4.Prefix and Ipaddr.V6.Prefixof_addr to Ipaddr.V4.Prefix and Ipaddr.V6.Prefix('v4,'v6) v4v6 to Ipaddr to represent version disjunctsIpaddr.Prefix module for generic prefix manipulationIpaddr.V4.make to accept int rather than int32 (breaking)scope for classifying address scopesIpaddr.V4.of_string_raw for parsing inside of larger stringsIpaddr.V4.to_int16 and Ipaddr.V4.of_int16unspecified, nodes, and routers constants to Ipaddr.V4Ipaddr.V4.Prefix.network_address to put an address into a subnetof_address_string_exn, of_address_string, to_address_string, to_address_buffer to Ipaddr.V4.Prefix to parse/print combined addr/prefixmulticast_org, multicast_admin, multicast_link subnet constants to Ipaddr.V4.PrefixIpaddr.V4.scope to classify IPv4 addressesIpaddr.V4.is_global and Ipaddr.V4.is_multicast predicatessep:char argument to Macaddr.to_stringIpaddr.V4.Prefix.bits function to produce bits of prefix from prefix.Macaddr.make_local function to create local unicast MAC addresses from an octet generation function.Macaddr.get_oui accessor to extract the Organizationally Unique Identifier as an integer.Macaddr.is_local predicate to test for a locally administered address.Macaddr.is_unicast predicate to test for a unicast MAC address.Ipaddr.V4.any, Ipaddr.V4.broadcast, Ipaddr.V4.localhost special constant addresses.Ipaddr.V4.Prefix.global (0.0.0.0/0) subnet constant.Ipaddr.V4.Prefix.network function to produce subnet address from prefix.Macaddr module for handling MAC-48 (Ethernet) addresses.Ipaddr.Parse_error now contains both the error condition and the failing input.