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

Method CommandSetGates

core/modules/hash_lb.cc:100–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100CommandResponse HashLB::CommandSetGates(
101 const bess::pb::HashLBCommandSetGatesArg &arg) {
102 if (static_cast<size_t>(arg.gates_size()) > kMaxGates) {
103 return CommandFailure(EINVAL, "HashLB can have at most %zu ogates",
104 kMaxGates);
105 }
106
107 for (int i = 0; i < arg.gates_size(); i++) {
108 gates_[i] = arg.gates(i);
109 if (!is_valid_gate(gates_[i])) {
110 return CommandFailure(EINVAL, "Invalid ogate %d", gates_[i]);
111 }
112 }
113
114 num_gates_ = arg.gates_size();
115 return CommandSuccess();
116}
117
118CommandResponse HashLB::Init(const bess::pb::HashLBArg &arg) {
119 bess::pb::HashLBCommandSetGatesArg gates_arg;

Callers

nothing calls this directly

Calls 3

CommandFailureFunction · 0.85
CommandSuccessFunction · 0.85
is_valid_gateFunction · 0.70

Tested by

no test coverage detected