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

Method ListGateHooks

core/bessctl.cc:1475–1509  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1473 }
1474
1475 Status ListGateHooks(ServerContext*, const EmptyRequest*,
1476 ListGateHooksResponse* response) override {
1477 std::lock_guard<std::recursive_mutex> lock(mutex_);
1478
1479 for (const auto& pair : ModuleGraph::GetAllModules()) {
1480 const Module* m = pair.second;
1481 for (auto& gate : m->igates()) {
1482 if (!gate) {
1483 continue;
1484 }
1485 for (auto& hook : gate->hooks()) {
1486 GateHookInfo* info = response->add_hooks();
1487 info->set_class_name(hook->class_name());
1488 info->set_hook_name(hook->name());
1489 info->set_module_name(m->name());
1490 info->set_igate(gate->gate_idx());
1491 *(info->mutable_arg()) = hook->arg();
1492 }
1493 }
1494 for (auto& gate : m->ogates()) {
1495 if (!gate) {
1496 continue;
1497 }
1498 for (auto& hook : gate->hooks()) {
1499 GateHookInfo* info = response->add_hooks();
1500 info->set_class_name(hook->class_name());
1501 info->set_hook_name(hook->name());
1502 info->set_module_name(m->name());
1503 info->set_ogate(gate->gate_idx());
1504 *(info->mutable_arg()) = hook->arg();
1505 }
1506 }
1507 }
1508 return Status::OK;
1509 }
1510
1511 Status ConfigureGateHook(ServerContext*,
1512 const ConfigureGateHookRequest* request,

Callers

nothing calls this directly

Calls 2

set_class_nameMethod · 0.80
gate_idxMethod · 0.80

Tested by

no test coverage detected