- /* This needs to be filled out correctly. Hopefully a dagapi call will
- provide all necessary information.
- */
- /*pd->stat.ps_recv = 0;*/
- /*pd->stat.ps_drop = 0;*/
+ /*
+ * Packet records received (ps_recv) are counted in dag_read().
+ * Packet records dropped (ps_drop) are read from Stream Drop attribute if present,
+ * otherwise integrate the ERF Header lctr counts (if available) in dag_read().
+ * We are reporting that no records are dropped by the card/driver (ps_ifdrop).
+ */
+
+ if(pd->drop_attr != kNullAttributeUuid) {
+ /* Note this counter is cleared at start of capture and will wrap at UINT_MAX.
+ * The application is responsible for polling ps_drop frequently enough
+ * to detect each wrap and integrate total drop with a wider counter */
+ if ((dag_error = dag_config_get_uint32_attribute_ex(pd->dag_ref, pd->drop_attr, &stream_drop)) == kDagErrNone) {
+ pd->stat.ps_drop = stream_drop;
+ } else {
+ snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "reading stream drop attribute: %s",
+ dag_config_strerror(dag_error));
+ return -1;
+ }
+ }