Snmp.Transport (elixir_snmp v0.2.1) View Source

Defines SNMP transport types.

Link to this section Summary

Functions

Cast transport options

Link to this section Types

Specs

addr() :: {ip_addr(), :inet.port_number()} | ip_addr()

Specs

agent_transport() :: int_agent_transport() | String.t()

Transport definition type accepted by agent configuration

Specs

e_addr() :: {:inet.ip_address(), port_info()}

Specs

int_agent_transport() ::
  {t_domain(), addr()}
  | {t_domain(), e_addr(), kind()}
  | {t_domain(), e_addr(), opts()}
  | {t_domain(), e_addr(), kind(), opts()}

Specs

ip_addr() :: :inet.ip_address() | snmp_ip_addr()

Specs

kind() :: :req_responder | :trap_sender

Specs

opts() :: list()

Specs

port_info() :: pos_integer() | :system | range() | ranges()

Specs

range() :: {min :: pos_integer(), max :: pos_integer()}

Specs

ranges() :: [pos_integer() | range()]

Specs

snmp_ip_addr() :: [non_neg_integer()]

Specs

t_domain() :: :transportDomainUdpIpv4 | :transportDomainUdpIpv6 | module()

Link to this section Functions

Specs

config(term()) :: int_agent_transport()

Cast transport options

Examples

iex> config("127.0.0.1") {:transportDomainUdpIpv4, {127,0,0,1}}

iex> config({"127.0.0.1", 4000}) {:transportDomainUdpIpv4, {{127,0,0,1}, 4000}}

iex> config("::1") {:transportDomainUdpIpv6, {0,0,0,0,0,0,0,1}}

iex> config({MyTransport, "::1"}) {MyTransport, {0,0,0,0,0,0,0,1}}

iex> config({MyTransport, {"::1", :system}, :req_responder}) {MyTransport, {{0,0,0,0,0,0,0,1}, :system}, :req_responder}

iex> config({MyTransport, {"::1", {4000, 4010}}, :trap_sender}) {MyTransport, {{0,0,0,0,0,0,0,1}, {4000, 4010}}, :trap_sender}

iex> config({MyTransport, {"::1", [{4000, 4010}, {8000, 8010}]}, :trap_sender}) {MyTransport, {{0,0,0,0,0,0,0,1}, [{4000, 4010}, {8000, 8010}]}, :trap_sender}

iex> config({A, {{0, 0, 0, 0, 0, 0, 0, 0}, 0}}) {A, {{0, 0, 0, 0, 0, 0, 0, 0}, 0}}