25 singular_db<mark::key_t, mark> mark::m_db;
31 , m_itf(itf.singular())
38 : m_config(m.m_config)
48 m_db.release(
key(),
this);
54 return (std::make_pair(m_itf->key(), m_src));
60 return (
key() == m.
key() && m_map->id() == m.m_map->id());
85 s <<
"qos-mark:[" << m_itf->to_string() <<
", map:" << m_map->id()
92 mark::update(
const mark&
r)
100 std::shared_ptr<mark>
101 mark::find_or_add(
const mark& temp)
103 return (m_db.find_or_add(temp.
key(), temp));
106 std::shared_ptr<mark>
109 return (m_db.find(k));
112 std::shared_ptr<mark>
115 return find_or_add(*
this);
131 mark::event_handler::handle_replay()
139 std::shared_ptr<mark_cmds::dump_cmd>
cmd =
140 std::make_shared<mark_cmds::dump_cmd>();
145 for (
auto& rr : *cmd) {
146 auto& payload = rr.get_payload();
148 std::shared_ptr<interface> itf =
interface::find(payload.mark.sw_if_index);
149 std::shared_ptr<map>
map =
map::find(payload.mark.map_id);
154 mark qm(*itf, *map,
from_api(payload.mark.output_source));
160 <<
"no interface or map:" << payload.mark.sw_if_index <<
", " 161 << payload.mark.map_id;
167 mark::event_handler::order()
const static std::shared_ptr< map > find(const key_t &k)
Find the instnace of the bridge_domain domain in the OM.
vnet_hw_if_output_node_runtime_t * r
void db_dump(const DB &db, std::ostream &os)
Print each of the objects in the DB into the stream provided.
const std::string key_t
In the opflex world each entity is known by a URI which can be converted into a string.
static std::shared_ptr< interface > find(const handle_t &h)
The the singular instance of the interface in the DB by handle.
A command class that creates or updates the GBP endpoint.
static void register_handler(const std::vector< std::string > &cmds, const std::string &help, command_handler *ch)
Register a command handler for inspection.
static rc_t write()
Write/Execute all commands hitherto enqueued.
rc_t rc() const
Get the HW return code.
static const log_level_t DEBUG
bool operator==(const mark &bdae) const
comparison operator
mark(const interface &i, const map &m, const source_t &source)
A cmd class that deletes a GBP endpoint.
const key_t key() const
Return the object's key.
static void dump(std::ostream &os)
Dump all bridge_domain-doamin into the stream provided.
std::string to_string() const
Convert to string for debugging.
A representation of an interface in VPP.
The Source of the QoS classification (i.e.
const std::string & to_string() const
convert to string format for debug purposes
static rc_t commit(const client_db::key_t &key, const OBJ &obj)
Make the State in VPP reflect the expressed desired state.
void event_handler(void *tls_async)
dependency_t
There needs to be a strict order in which object types are read from VPP (at boot time) and replayed ...
static const rc_t OK
The HW write was successfull.
static void enqueue(cmd *f)
Enqueue A command for execution.
A QoS map determines how value from one source are translated to values of another source...
static const log_level_t ERROR
static const map::outputs_t from_api(vapi_type_qos_egress_map_row rows[4])
std::pair< interface::key_t, source_t > key_t
std::shared_ptr< mark > singular() const
Return the matching 'singular instance'.
The VPP Object Model (VOM) library.
A representation of a method call to VPP.
static std::shared_ptr< mark > find(const key_t &k)
Find the instnace of the bridge_domain domain in the OM.
The marking of packets with QoS bits as they egress an interface.
void replay(void)
replay the object to create it in hardware
static bool register_listener(listener *listener)
Register a listener of events.