| 40 | Command::THREAD_UNSAFE}}; |
| 41 | |
| 42 | CommandResponse ACL::Init(const bess::pb::ACLArg &arg) { |
| 43 | for (const auto &rule : arg.rules()) { |
| 44 | ACLRule new_rule = { |
| 45 | .src_ip = Ipv4Prefix(rule.src_ip()), |
| 46 | .dst_ip = Ipv4Prefix(rule.dst_ip()), |
| 47 | .src_port = be16_t(static_cast<uint16_t>(rule.src_port())), |
| 48 | .dst_port = be16_t(static_cast<uint16_t>(rule.dst_port())), |
| 49 | .drop = rule.drop()}; |
| 50 | rules_.push_back(new_rule); |
| 51 | } |
| 52 | return CommandSuccess(); |
| 53 | } |
| 54 | |
| 55 | CommandResponse ACL::CommandAdd(const bess::pb::ACLArg &arg) { |
| 56 | Init(arg); |
nothing calls this directly
no test coverage detected