bmv2
Designing your own switch target with bmv2
|
Classes | |
struct | McIn |
Input to replicate() method. More... | |
struct | McOut |
Output of replicate() method. More... | |
Public Types | |
using | mgrp_t = unsigned int |
NC. More... | |
using | rid_t = unsigned int |
NC. More... | |
using | egress_port_t = unsigned int |
NC. More... | |
Public Member Functions | |
std::vector< McOut > | replicate (const McIn) const |
McSimplePre (const McSimplePre &other)=delete | |
Deleted copy constructor. More... | |
McSimplePre & | operator= (const McSimplePre &other)=delete |
Deleted move assignment operator. More... | |
McSimplePre (McSimplePre &&other)=delete | |
Deleted move constructor. More... | |
McSimplePre & | operator= (McSimplePre &&other)=delete |
Deleted move assignment operator. More... | |
A simple, 2-level, packet replication engine, configurable by the control plane. See replicate() for more information.
using bm::McSimplePre::egress_port_t = unsigned int |
NC.
using bm::McSimplePre::mgrp_t = unsigned int |
NC.
using bm::McSimplePre::rid_t = unsigned int |
NC.
|
delete |
Deleted copy constructor.
|
delete |
Deleted move constructor.
|
delete |
Deleted move assignment operator.
|
delete |
Deleted move assignment operator.
std::vector<McOut> bm::McSimplePre::replicate | ( | const | McIn | ) | const |
This is the only "dataplane" method for this class. It takes as input a multicast group id (set during pipeline processing) and returns a vector of McOut instances (rid + egress port).
The mgid (multicast group id) points to a L1 (level 1) node. Each L1 node has a unique rid and points to a L2 node. The L2 node includes a list of ports which we return in a vector (along with thr L1 node rid). It is the target responsibility to use this information to properly "clone" the packet. For example: