MCPcopy Create free account
hub / github.com/NetSys/bess / ModuleCommand

Method ModuleCommand

core/bessctl.cc:1753–1773  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1751 }
1752
1753 Status ModuleCommand(ServerContext*, const CommandRequest* request,
1754 CommandResponse* response) override {
1755 std::lock_guard<std::recursive_mutex> lock(mutex_);
1756
1757 if (!request->name().length()) {
1758 return return_with_error(response, EINVAL,
1759 "Missing module name field 'name'");
1760 }
1761 const auto& it = ModuleGraph::GetAllModules().find(request->name());
1762 if (it == ModuleGraph::GetAllModules().end()) {
1763 return return_with_error(response, ENOENT, "No module '%s' found",
1764 request->name().c_str());
1765 }
1766
1767 // DPDK functions may be called, so be prepared
1768 current_worker.SetNonWorker();
1769
1770 Module* m = it->second;
1771 *response = m->RunCommand(request->cmd(), request->arg());
1772 return Status::OK;
1773 }
1774
1775 private:
1776 Status AttachTc(bess::TrafficClass* c_, const bess::pb::TrafficClass& class_,

Callers

nothing calls this directly

Calls 5

return_with_errorFunction · 0.85
SetNonWorkerMethod · 0.80
cmdMethod · 0.80
endMethod · 0.45
RunCommandMethod · 0.45

Tested by

no test coverage detected