24 #ifndef BM_BM_SIM_SIMPLE_PRE_LAG_H_
25 #define BM_BM_SIM_SIMPLE_PRE_LAG_H_
28 #include <unordered_map>
39 static constexpr
int LAG_MAX_ENTRIES = 256;
40 using lag_id_t = uint16_t;
43 int mgid_table_size = McSimplePre::DEFAULT_MGID_TABLE_SIZE,
44 int l1_max_entries = McSimplePre::DEFAULT_L1_MAX_ENTRIES,
45 int l2_max_entries = McSimplePre::DEFAULT_L2_MAX_ENTRIES)
46 :
McSimplePre(mgid_table_size, l1_max_entries, l2_max_entries) {}
48 McReturnCode mc_node_create(
const rid_t rid,
49 const PortMap &port_map,
50 const LagMap &lag_map,
52 McReturnCode mc_node_update(
const l1_hdl_t l1_hdl,
53 const PortMap &port_map,
54 const LagMap &lag_map);
56 McReturnCode mc_set_lag_membership(
const lag_id_t lag_index,
57 const PortMap &port_map);
59 std::string mc_get_entries()
const;
63 std::vector<McOut> replicate(
const McIn)
const;
67 uint16_t member_count;
71 LagEntry(uint16_t member_count,
const PortMap &port_map)
72 : member_count(member_count), port_map(port_map) {}
75 std::unordered_map<lag_id_t, LagEntry> lag_entries{};
80 #endif // BM_BM_SIM_SIMPLE_PRE_LAG_H_