# `Kuroneko.Gadget.NCM`
[🔗](https://github.com/cocoa-xu/kuroneko_gadget/blob/v0.5.0/lib/kuroneko/gadget/ncm.ex#L1)

The kernel's NCM function: a USB network adapter the target computer
sees, with a network interface on the device.

An instance has two MAC addresses: the device's, of its interface, and
the target's, of the adapter the target sees. They are made from the
gadget's serial number and the instance's name, so they stay the same
across boots. The `:network` of `Kuroneko.Gadget` is an instance named
`"usb0"`, whose addresses `Kuroneko.Gadget.network/1` tells and
`Kuroneko.Gadget.set_network_addresses/2` changes.

It takes no options.

# `address`

```elixir
@type address() :: String.t()
```

A MAC address, such as `"02:12:34:56:78:9a"`.

# `addresses`

```elixir
@type addresses() :: %{device_address: address(), host_address: address()}
```

# `addresses`

```elixir
@spec addresses(keyword()) ::
  {:ok, addresses()} | {:error, Kuroneko.Gadget.configfs_error()}
```

The addresses of an instance: the one `:name` names, `"usb0"` by
default. Takes the `:gadget` option.

# `interface`

```elixir
@spec interface(keyword()) :: String.t() | nil
```

The device's network interface of an instance, such as `"usb0"`, `nil`
before the gadget first connects. Takes `:name` and `:gadget`.

---

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