# `ADS.NetId`
[🔗](https://github.com/tallakt/yaads/blob/v0.1.0/lib/ads/net_id.ex#L1)

AMS NetIds: six numbers from 0 to 255, written with dots like an IP address with two more parts,
and sent as six bytes in that order.

    iex> ADS.NetId.parse("172.16.17.10.1.1")
    {:ok, <<172, 16, 17, 10, 1, 1>>}
    iex> ADS.NetId.to_string(<<5, 36, 69, 176, 1, 1>>)
    "5.36.69.176.1.1"
    iex> ADS.NetId.parse("10.0.0.5")
    :error

A NetId is configured on each system, and is often its IP address with `.1.1` added, which
`from_ip/1` makes.

# `t`

```elixir
@type t() :: &lt;&lt;_::48&gt;&gt;
```

A NetId as sent: six bytes.

# `from_ip`

```elixir
@spec from_ip(:inet.ip4_address()) :: t()
```

The NetId made from an IPv4 address by adding `.1.1`.

    iex> ADS.NetId.from_ip({10, 0, 0, 5})
    <<10, 0, 0, 5, 1, 1>>

# `parse`

```elixir
@spec parse(String.t()) :: {:ok, t()} | :error
```

Parses a NetId written with dots.

# `parse!`

```elixir
@spec parse!(String.t()) :: t()
```

Parses a NetId, raising `ArgumentError` for one that isn't.

# `to_string`

```elixir
@spec to_string(t()) :: String.t()
```

A NetId written with dots.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
