bmv2
Designing your own switch target with bmv2
Classes
meters.h File Reference

Go to the source code of this file.

Classes

class  bm::Meter
 
class  bm::MeterArray
 

Detailed Description

Includes both the Meter and MeterArray classes. MeterArray is exposed in P4 v1.0.2 as the meter object. Action primitives can take a MeterArray reference as a parameter (but not a Meter though). Here is a possible implementation of the execute_meter() P4 primitive:

class execute_meter
: public ActionPrimitive<MeterArray &, const Data &, Field &> {
void operator ()(MeterArray &meter_array, const Data &idx, Field &dst) {
dst.set(meter_array.execute_meter(get_packet(), idx.get_uint()));
}
};