+def create_loadgen(loadgen_type, loadgen_cfg):
+ """Return a new ILoadGenerator for the loadgen type.
+
+ The returned load generator has the given loadgen type and loadgen
+ generator class.
+
+ :param loadgen_type: Name of loadgen type
+ :param loadgen_class: Reference to load generator class to be used.
+ :return: A new ILoadGenerator class
+ """
+ # pylint: disable=too-many-function-args
+ loadgen_type = loadgen_type.lower()
+ if loadgen_type.find("dummy") >= 0:
+ return DummyLoadGen(loadgen_cfg)
+ elif loadgen_type.find("stress-ng") >= 0:
+ return StressNg(loadgen_cfg)
+ elif loadgen_type.find("stress") >= 0:
+ return Stress(loadgen_cfg)
+
+def create_pktfwd(deployment, pktfwd_class):
+ """Return a new packet forwarder controller
+
+ The returned controller is configured with the given
+ packet forwarder class.
+
+ :param pktfwd_class: Reference to packet forwarder class to be used.
+ :param deployment: The deployment scenario name
+ :return: packet forwarder controller
+ """
+ return PktFwdController(deployment, pktfwd_class)