# `Linx.Netlink.Rtnl.LinkInfo`
[🔗](https://github.com/oshlabs/linx/blob/v0.2.0/lib/linx/netlink/rtnl/linkinfo.ex#L1)

`IFLA_LINKINFO` — a link's kind and kind-specific data.

A bare attribute set carrying `IFLA_INFO_KIND` (the kind string —
`"macvlan"`, `"veth"`, `"bridge"`, …) and `IFLA_INFO_DATA` (the kind-
specific payload, decoded by the matching sub-module).

The `:info_data` field is **dispatched** on the `:kind` value — the codec
DSL chooses the right sub-codec module at encode and decode time, so
`%LinkInfo{kind: "macvlan", info_data: %LinkInfo.Macvlan{mode: 4}}` is the
natural shape on both sides of the wire.

Kinds without per-kind data (`"bridge"`, `"dummy"`) simply leave
`:info_data` `nil` — the DSL's `nil`-omission rule keeps the attribute off
the wire.

# `t`

```elixir
@type t() :: %Linx.Netlink.Rtnl.LinkInfo{info_data: term(), kind: term()}
```

# `decode`

```elixir
@spec decode(binary()) :: t()
```

Decodes a netlink message body into a `t:t/0`.

# `encode`

```elixir
@spec encode(t()) :: binary()
```

Encodes a `t:t/0` into its netlink message body.

---

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