27 uint16_t srcport_or_icmptype_first,
28 uint16_t srcport_or_icmptype_last,
29 uint16_t dstport_or_icmpcode_first,
30 uint16_t dstport_or_icmpcode_last,
31 uint8_t tcp_flags_mask,
32 uint8_t tcp_flags_value)
33 : m_priority(priority)
38 , m_srcport_or_icmptype_first(srcport_or_icmptype_first)
39 , m_srcport_or_icmptype_last(srcport_or_icmptype_last)
40 , m_dstport_or_icmpcode_first(dstport_or_icmpcode_first)
41 , m_dstport_or_icmpcode_last(dstport_or_icmpcode_last)
42 , m_tcp_flags_mask(tcp_flags_mask)
43 , m_tcp_flags_value(tcp_flags_value)
50 return (other.m_priority < m_priority);
56 return ((m_action == rule.m_action) && (m_src == rule.m_src) &&
57 (m_dst == rule.m_dst) && (m_proto == rule.m_proto) &&
58 (m_srcport_or_icmptype_first == rule.m_srcport_or_icmptype_first) &&
59 (m_srcport_or_icmptype_last == rule.m_srcport_or_icmptype_last) &&
60 (m_dstport_or_icmpcode_first == rule.m_dstport_or_icmpcode_first) &&
61 (m_dstport_or_icmpcode_last == rule.m_dstport_or_icmpcode_last) &&
62 (m_tcp_flags_mask == rule.m_tcp_flags_mask) &&
63 (m_tcp_flags_value == rule.m_tcp_flags_value));
72 <<
"priority:" << m_priority <<
" action:" << m_action.
to_string()
74 <<
" proto:" << std::to_string(m_proto)
75 <<
" srcportfrom:" << m_srcport_or_icmptype_first
76 <<
" srcportto: " << m_srcport_or_icmptype_last
77 <<
" dstportfrom:" << m_dstport_or_icmpcode_first
78 <<
" dstportto:" << m_dstport_or_icmpcode_last
79 <<
" tcpflagmask:" << std::to_string(m_tcp_flags_mask)
80 <<
" tcpflagvalue:" << std::to_string(m_tcp_flags_value) <<
"]";
171 return m_srcport_or_icmptype_first;
177 return m_srcport_or_icmptype_last;
183 return m_dstport_or_icmpcode_first;
189 return m_dstport_or_icmpcode_last;
195 return m_tcp_flags_mask;
201 return m_tcp_flags_value;
const route::prefix_t & src() const
Getters.
void set_src_from_port(uint16_t srcport_or_icmptype_first)
Set Src port or ICMP Type first.
l3_rule(uint32_t priority, const action_t &action, const route::prefix_t &src, const route::prefix_t &dst, uint8_t proto=0, uint16_t srcport_or_icmptype_first=0, uint16_t srcport_or_icmptype_last=0, uint16_t dstport_or_icmpcode_first=0, uint16_t dstport_or_icmpcode_last=0, uint8_t tcp_flags_mask=0, uint8_t tcp_flags_value=0)
Construct a new object matching the desried state.
void set_dst_from_port(uint16_t dstport_or_icmpcode_first)
Set Dst port or ICMP code first.
void set_tcp_flags_value(uint8_t tcp_flags_value)
Set TCP flags value.
uint8_t tcp_flags_mask() const
uint32_t priority() const
uint8_t tcp_flags_value() const
void set_tcp_flags_mask(uint8_t tcp_flags_mask)
Set TCP flags mask.
uint16_t dstport_or_icmpcode_first() const
void set_src_to_port(uint16_t srcport_or_icmptype_last)
Set Src port or ICMP Type last.
void set_dst_ip(route::prefix_t dst)
Set Dst Ip Address.
std::string to_string() const
convert to string format for debug purposes
const action_t & action() const
bool operator==(const l3_rule &rule) const
comparison operator (for testing)
uint16_t srcport_or_icmptype_last() const
void set_dst_to_port(uint16_t dstport_or_icmpcode_last)
Set Dst port or ICMP code last.
void set_proto(uint8_t proto)
Set proto.
const route::prefix_t & dst() const
std::string to_string() const
convert to string format for debug purposes
uint16_t srcport_or_icmptype_first() const
The VPP Object Model (VOM) library.
An ACL rule is the building block of an ACL.
const std::string & to_string() const
convert to string format for debug purposes
uint16_t dstport_or_icmpcode_last() const
bool operator<(const l3_rule &rule) const
less-than operator
void set_src_ip(route::prefix_t src)
Set Src Ip Address.