package ipaddr

  1. Overview
  2. Docs
A library for manipulation of IP (and MAC) address representations

Install

Dune Dependency

Authors

Maintainers

Sources

ipaddr-v3.1.0.tbz
sha256=39bfbbe2d650c26be7b5581d288eaedd1b47b842cdebaa08d6afd968983fc3b4
md5=471a594563bb9c3dd91ae912b5ffd6ed

doc/ipaddr/Ipaddr/V6/Prefix/index.html

Module V6.PrefixSource

A module for manipulating IPv6 network prefixes.

Sourcetype addr = t
Sourcetype t

Type of a internet protocol subnet

Sourceval mask : int -> addr

mask n is the pseudo-address of an n bit subnet mask.

Sourceval make : int -> addr -> t

make n addr is the n bit subnet prefix to which addr belongs.

Sourceval network_address : t -> addr -> addr

network_address prefix addr is the address with prefix prefix and suffix from addr. See <http://tools.ietf.org/html/rfc4291#section-2.3>.

Sourceval of_string_exn : string -> t

of_string_exn cidr is the subnet prefix represented by the CIDR string, cidr. Raises Parse_error if cidr is not a valid representation of a CIDR notation routing prefix.

Sourceval of_string : string -> (t, [> `Msg of string ]) result

Same as of_string_exn but returns a result type instead of raising an exception.

Sourceval of_string_raw : string -> int ref -> t

Same as of_string_exn but takes as an extra argument the offset into the string for reading.

Sourceval to_string : t -> string

to_string prefix is the CIDR notation string representation of prefix, i.e. XXX:XX:X::XXX/XX.

Sourceval pp : Format.formatter -> t -> unit

pp f prefix outputs a human-readable representation of prefix to the formatter f.

Sourceval of_address_string_exn : string -> t * addr

of_address_string_exn cidr_addr is the address and prefix represented by cidr_addr. Raises Parse_error if cidr_addr is not a valid representation of a CIDR-scoped address.

Sourceval of_address_string : string -> (t * addr, [> `Msg of string ]) result

Same as of_address_string_exn but returns an option type instead of raising an exception.

Sourceval to_address_string : t -> addr -> string

to_address_string prefix addr is the network address constructed from prefix and addr.

Sourceval to_buffer : Buffer.t -> t -> unit

to_buffer buf prefix writes the string representation of prefix to the buffer buf.

Sourceval to_address_buffer : Buffer.t -> t -> addr -> unit

to_address_buffer buf prefix addr writes string representation of the network address representing addr in prefix to the buffer buf.

Sourceval of_netmask : addr -> addr -> t

of_netmask netmask addr is the subnet prefix of addr with netmask netmask.

Sourceval mem : addr -> t -> bool

mem ip subnet checks whether ip is found within subnet.

Sourceval subset : subnet:t -> network:t -> bool

subset ~subnet ~network checks whether subnet is contained within network.

Sourceval of_addr : addr -> t

of_addr ip create a subnet composed of only one address, ip. It is the same as make 128 ip.

Sourceval global_unicast_001 : t

Global Unicast 001, 2000::/3.

Sourceval unique_local : t

The Unique Local Unicast (ULA), fc00::/7.

Link-Local Unicast, fe80::/64.

Sourceval multicast : t

The multicast network, ff00::/8.

Sourceval ipv4_mapped : t

IPv4-mapped addresses, ::ffff:0:0/96.

Sourceval noneui64_interface : t

Global Unicast addresses that don't use Modified EUI64 interface identifiers, ::/3.

Sourceval solicited_node : t

Solicited-Node multicast addresses

Sourceval network : t -> addr

network subnet is the address for subnet.

Sourceval netmask : t -> addr

netmask subnet is the netmask for subnet.

Sourceval bits : t -> int

bits subnet is the bit size of the subnet prefix.

include Map.OrderedType with type t := t
Sourceval compare : t -> t -> int

A total ordering function over the keys. This is a two-argument function f such that f e1 e2 is zero if the keys e1 and e2 are equal, f e1 e2 is strictly negative if e1 is smaller than e2, and f e1 e2 is strictly positive if e1 is greater than e2. Example: a suitable ordering function is the generic structural comparison function Stdlib.compare.

OCaml

Innovation. Community. Security.