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

Method RunCommand

core/module.cc:92–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92CommandResponse ModuleBuilder::RunCommand(
93 Module *m, const std::string &user_cmd,
94 const google::protobuf::Any &arg) const {
95 for (auto &cmd : cmds_) {
96 if (user_cmd == cmd.cmd) {
97 if (cmd.mt_safe != Command::THREAD_SAFE && m->HasRunningWorker()) {
98 return CommandFailure(EBUSY,
99 "There is a running worker and command "
100 "'%s' is not MT safe",
101 cmd.cmd.c_str());
102 }
103
104 return cmd.func(m, arg);
105 }
106 }
107
108 return CommandFailure(ENOTSUP, "'%s' does not support command '%s'",
109 class_name_.c_str(), user_cmd.c_str());
110}
111
112CommandResponse ModuleBuilder::RunInit(Module *m,
113 const google::protobuf::Any &arg) const {

Callers

nothing calls this directly

Calls 2

CommandFailureFunction · 0.85
HasRunningWorkerMethod · 0.80

Tested by

no test coverage detected