-rc_t
-stats_enable_cmd::issue(connection& con)
-{
- /*
- * First set the call back to handle the interface stats
- */
- m_reg.reset(new reg_t(con.ctx(), std::ref(*(static_cast<event_cmd*>(this)))));
-
- /*
- * then send the request to enable them
- */
- msg_t req(con.ctx(), 1, std::ref(*(static_cast<rpc_cmd*>(this))));
-
- auto& payload = req.get_request().get_payload();
- payload.enable_disable = 1;
- payload.pid = getpid();
- payload.num = 1;
-
- payload.sw_ifs[0] = m_swifindex.value();
-
- VAPI_CALL(req.execute());
-
- wait();
-
- return (rc_t::OK);
-}
-
-void
-stats_enable_cmd::retire(connection& con)
-{
- /*
- * disable interface stats.
- */
- msg_t req(con.ctx(), 1, std::ref(*(static_cast<rpc_cmd*>(this))));
-
- auto& payload = req.get_request().get_payload();
- payload.enable_disable = 0;
- payload.pid = getpid();
- payload.num = 1;
- payload.sw_ifs[0] = m_swifindex.value();
-
- VAPI_CALL(req.execute());
-
- wait();
-}
-
-interface::stat_listener&
-stats_enable_cmd::listener() const
-{
- return m_listener;
-}
-
-void
-stats_enable_cmd::set(const rc_t& rc)
-{
- m_listener.status().set(rc);
-}