|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
35 std::shared_ptr<VOM::tap_interface> intf = itf.
singular();
41 std::shared_ptr<VOM::tap_interface> intf1 = itf1.
singular();
46 std::shared_ptr<VOM::tap_interface> intf2 = itf2.
singular();
51 std::cout <<
"Interface index is INVALID" << std::endl;
58 std::cout <<
"Interface #1 index is " << intf->handle().value() << std::endl;
59 std::cout <<
"Interface #2 index is " << intf1->handle().value() << std::endl;
60 std::cout <<
"Interface #3 index is " << intf2->handle().value() << std::endl;
63 intf->enable_stats(listen);
64 intf1->enable_stats(listen);
65 intf2->enable_stats(listen);
70 std::cout <<
"stats # " << std::to_string(
i) << std::endl;
74 intf->disable_stats();
78 intf1->disable_stats();
79 intf2->disable_stats();
const stats_t & get_stats(void) const
Get the interface stats.
static rc_t write(const client_db::key_t &key, const OBJ &obj)
Make the State in VPP reflect the expressed desired state.
const static prefix_t ZERO
The all Zeros prefix.
const std::string & name() const
Return the interface type.
int main()
Run VPP on another terminal before running vom_stats_test.
static void init()
Initialise the HW.
The pipe to VPP into which we write the commands.
static void disconnect()
Disconnect to VPP.
A representation of an interface in VPP.
sll srl srl sll sra u16x4 i
static void remove(const client_db::key_t &key)
Remove all object in the OM referenced by the key.
A class that listens to interface Stats.
static void read_stats()
read stats from stat segment
void handle_interface_stat(const VOM::interface &itf)
Virtual function called on the listener when the command has data ready to process.
static bool connect()
Blocking Connect to VPP.
const static handle_t INVALID
A value of an interface handle_t that means the itf does not exist.
std::shared_ptr< tap_interface > singular() const
Return the matching 'singular instance' of the TAP interface.
const static admin_state_t UP
Admin UP state.