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

Increments a `:percpu_array` (lock-free) or `:array` (atomic) counter map at
slot `0` (configurable via `:slot`), and optionally accumulates packet byte
length (`data_end - data`) at slot `1` (configurable via `:byte_slot`).

Options:
  * `:map` / `:counter` - counter map name (default `:pkt_cnt`)
  * `:type` - `:percpu_array` (default) or `:array`
  * `:slot` - packet counter key index (default `0`)
  * `:bytes` - also count packet bytes when `true` (default `false`)
  * `:byte_slot` - byte counter key index (default `1`)

---

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