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

Method Init

core/modules/acl.cc:42–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40 Command::THREAD_UNSAFE}};
41
42CommandResponse 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
55CommandResponse ACL::CommandAdd(const bess::pb::ACLArg &arg) {
56 Init(arg);

Callers

nothing calls this directly

Calls 2

Ipv4PrefixClass · 0.85
CommandSuccessFunction · 0.85

Tested by

no test coverage detected