50 std::optional<unsigned long>
id,
51 std::optional<MAVSubnet> source,
52 std::optional<MAVSubnet> dest)
53 : source_(
std::move(source)), dest_(
std::move(dest))
100 source_ = std::move(subnet);
129 dest_ = std::move(subnet);
167 result &= packet.
id() == id_;
173 result &= source_->contains(packet.
source());
179 result &= dest_->contains(address);
196 return (lhs.id_ == rhs.id_) && (lhs.source_ == rhs.source_) &&
197 (lhs.dest_ == rhs.dest_);
211 return (lhs.id_ != rhs.id_) || (lhs.source_ != rhs.source_) ||
212 (lhs.dest_ != rhs.dest_);
229 if (!if_.id_ && !if_.source_ && !if_.dest_)
244 os <<
" from " << if_.source_.value();
250 os <<
" to " << if_.dest_.value();
If & from(MAVSubnet subnet)
If & type(unsigned long id)
virtual unsigned long id() const =0
If(std::optional< unsigned long > id={}, std::optional< MAVSubnet > source={}, std::optional< MAVSubnet > dest={})
std::string name(unsigned long id)
unsigned long id(std::string name)
If & to(MAVSubnet subnet)
std::ostream & operator<<(std::ostream &os, const Action &action)
bool operator==(const Action &lhs, const Action &rhs)
bool operator!=(const Action &lhs, const Action &rhs)
virtual MAVAddress source() const =0
bool check(const Packet &packet, const MAVAddress &address) const