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

Method GetGateHookClassInfo

core/bessctl.cc:1445–1473  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1443 }
1444
1445 Status GetGateHookClassInfo(ServerContext*,
1446 const GetGateHookClassInfoRequest* request,
1447 GetGateHookClassInfoResponse* response) override {
1448 std::lock_guard<std::recursive_mutex> lock(mutex_);
1449
1450 VLOG(1) << "GetGateHookClassInfo from client:" << std::endl
1451 << request->DebugString();
1452 if (!request->name().length()) {
1453 return return_with_error(response, EINVAL,
1454 "Argument must be a name in str");
1455 }
1456
1457 const std::string& cls_name = request->name();
1458 const auto& it =
1459 bess::GateHookBuilder::all_gate_hook_builders().find(cls_name);
1460 if (it == bess::GateHookBuilder::all_gate_hook_builders().end()) {
1461 return return_with_error(response, ENOENT, "No gatehook class '%s' found",
1462 cls_name.c_str());
1463 }
1464 const bess::GateHookBuilder* cls = &it->second;
1465
1466 response->set_name(cls->class_name());
1467 response->set_help(cls->help_text());
1468 for (const auto& cmd : cls->cmds()) {
1469 response->add_cmds(cmd.first);
1470 response->add_cmd_args(cmd.second);
1471 }
1472 return Status::OK;
1473 }
1474
1475 Status ListGateHooks(ServerContext*, const EmptyRequest*,
1476 ListGateHooksResponse* response) override {

Callers

nothing calls this directly

Calls 4

return_with_errorFunction · 0.85
endMethod · 0.45
set_nameMethod · 0.45
cmdsMethod · 0.45

Tested by

no test coverage detected