MaeBPF.Plugs.CountPackets (maebpf v0.1.0)

Copy Markdown View Source

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)