# `MaeBPF.Supervisor`
[🔗](https://github.com/cocoa-xu/MaeBPF/blob/v0.1.0/maebpf/lib/maebpf/supervisor.ex#L1)

Standard OTP `Supervisor` managing one or more `MaeBPF` policy workers.

Stopping the supervisor via `MaeBPF.detach/1` or `MaeBPF.Supervisor.stop/1..2`
shuts down every child in reverse startup order so every unpinned kernel
`bpf_link` is automatically detached.

Accepted child entries:
  * Standard OTP child spec maps (`%{id: ..., start: ...}`)
  * `{PolicyMod, target: target, ...}` or `{PolicyMod, targets: [...]}`
  * Concise target shorthand: `{PolicyMod, {:xdp, "eth0"}}`,
    `{PolicyMod, {:cgroup, "/sys/fs/cgroup/app"}}`,
    `{PolicyMod, {:systemd, "app.service"}}`, `{PolicyMod, {:pid, os_pid}}`
  * `{PolicyMod, target, extra_opts}`
  * Any module implementing `child_spec/1`

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `normalize_child`

```elixir
@spec normalize_child(term()) ::
  Supervisor.child_spec() | {module(), term()} | module()
```

Normalizes shorthand policy child entries into standard OTP child specs.

# `start_link`

```elixir
@spec start_link([term()], keyword()) :: Supervisor.on_start()
```

Starts a linked `MaeBPF.Supervisor` supervising `children`.

Options:
  * `:name` - optional registered supervisor name
  * `:strategy` - OTP restart strategy (default `:one_for_one`)
  * `:max_restarts` - supervisor restart intensity
  * `:max_seconds` - supervisor restart period

# `stop`

```elixir
@spec stop(Supervisor.supervisor(), term(), timeout()) :: :ok
```

Stops a `MaeBPF.Supervisor` cleanly, tearing down every supervised policy
worker and detaching all unpinned kernel links.

# `supervisor_process?`

```elixir
@spec supervisor_process?(GenServer.server()) :: boolean()
```

Returns `true` if `pid_or_name` refers to a live OTP `Supervisor` process.

---

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