| 35 | }; |
| 36 | |
| 37 | CommandResponse Replicate::Init(const bess::pb::ReplicateArg &arg) { |
| 38 | CommandResponse err; |
| 39 | |
| 40 | if (arg.gates_size() > kMaxGates) { |
| 41 | return CommandFailure(EINVAL, "no more than %d gates", kMaxGates); |
| 42 | } |
| 43 | |
| 44 | for (int i = 0; i < arg.gates_size(); i++) { |
| 45 | int elem = arg.gates(i); |
| 46 | gates_[i] = elem; |
| 47 | } |
| 48 | ngates_ = arg.gates_size(); |
| 49 | |
| 50 | return CommandSuccess(); |
| 51 | } |
| 52 | |
| 53 | CommandResponse Replicate::CommandSetGates( |
| 54 | const bess::pb::ReplicateCommandSetGatesArg &arg) { |
nothing calls this directly
no test coverage detected