Copyright © (C) 2016-2020, Jan Henry Nystrom <JanHenryNystrom@gmail.com> -------------------------------------------------------------------
Authors: Jan Henry Nystrom (JanHenryNystrom@gmail.com).
ipv4() = integer() | {integer(), integer(), integer(), integer()}
ipv6() = integer() | {integer(), integer(), integer(), integer(), integer(), integer(), integer(), integer()} | {integer(), integer(), integer(), integer(), integer(), integer(), {integer(), integer(), integer(), integer()}}
opt() = term()
range() = integer()
bounds/1 | Determines the IP bounds for a range Equivalent of bounds(IOData, []). |
bounds/2 | Determines the IP bounds for a range Bounds will give an exception if the binary is not well formed IP. |
decode/1 | Decodes the binary into an Integer. |
decode/2 | Decodes the binary into a structured Erlang. |
encode/1 | Encodes the structured Erlang term as an iolist. |
encode/2 | Encodes the structured Erlang term as an iolist or binary. |
Determines the IP bounds for a range Equivalent of bounds(IOData, []).
bounds(Binary::iodata() | {ip(), range()}, Opts::[opt()] | #opts{format = ipv4 | ipv6, ipv6ipv4 = boolean(), continue = boolean(), range = boolean(), compact = boolean(), return_type = iolist | list | binary}) -> {ip(), ip()}
Determines the IP bounds for a range Bounds will give an exception if the binary is not well formed IP. Options are: integer -> an integer is returned (Default) tuple -> a tuple of integers is returned ipv6ipv4 -> with tuple the two last parts are returned as an IPv4 tuple
Decodes the binary into an Integer. Equivalent of decode(IOData, []) -> Integer.
decode(Binary::iodata(), Opts::[opt()] | #opts{format = ipv4 | ipv6, ipv6ipv4 = boolean(), continue = boolean(), range = boolean(), compact = boolean(), return_type = iolist | list | binary}) -> ip() | {ip(), range()} | {ip(), iodata()} | {ip(), range(), iodata()}
Decodes the binary into a structured Erlang. Decode will give an exception if the binary is not well formed IP. Options are: integer -> an integer is returned (Default) tuple -> a tuple of integers is returned ipv6ipv4 -> with tuple the two last parts are returned as an IPv4 tuple range -> a IP range is being decoded continue -> all remaining indata is returned
Encodes the structured Erlang term as an iolist. Equivalent of encode(Term, []) -> IP.
encode(Term::ip() | {ip(), range()}, Opts::[opt()] | #opts{format = ipv4 | ipv6, ipv6ipv4 = boolean(), continue = boolean(), range = boolean(), compact = boolean(), return_type = iolist | list | binary}) -> iolist() | binary()
Encodes the structured Erlang term as an iolist or binary. Encode will give an exception if the erlang term is not well formed. Options are: binary -> a binary is returned list -> a flat list is returned iolist -> an iolist is returned (Default) ipv4 -> an ipv4 address is encoded when the Term is an integer ipv6 -> an ipv6 address is encoded when the Term is an integer ipv6ipv4 -> encoded IPv6 host address has the two least sigificant segments repesented in IPv4 address format compact -> the most compact encoding of IPv6 used (collapsed zeros)
Generated by EDoc