class Action
Defined at line 3173 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h
The action to take on a packet.
Public Members
static const fidl_type_t * FidlType
Public Methods
void Action ()
void Action (Action && )
::std::unique_ptr<Action> New ()
void Encode (::fidl::Encoder * encoder, size_t offset, std::optional< ::fidl::HandleInformation> maybe_handle_info)
void Decode (::fidl::Decoder * _decoder, Action * value, size_t offset)
zx_status_t Clone (Action * result)
Action & SetUnknownData (fidl_xunion_tag_t ordinal, std::vector<uint8_t> bytes)
bool has_invalid_tag ()
Defined at line 3215 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h
bool is_accept ()
Defined at line 3219 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h
::fuchsia::net::filter::Empty & accept ()
Accept the packet.
This is a terminal action for the current *installed* routine, i.e. no
further rules will be evaluated for this packet in the installed routine
(or any subroutines) in which this rule is installed. Subsequent
routines installed on the same hook will still be evaluated.
Defined at line 3227 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h
const ::fuchsia::net::filter::Empty & accept ()
Accept the packet.
This is a terminal action for the current *installed* routine, i.e. no
further rules will be evaluated for this packet in the installed routine
(or any subroutines) in which this rule is installed. Subsequent
routines installed on the same hook will still be evaluated.
Defined at line 3238 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h
bool is_drop ()
Defined at line 3244 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h
::fuchsia::net::filter::Empty & drop ()
Drop the packet.
This is a terminal action, i.e. no further rules will be evaluated for
this packet, even in other routines on the same hook.
Defined at line 3250 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h
const ::fuchsia::net::filter::Empty & drop ()
Drop the packet.
This is a terminal action, i.e. no further rules will be evaluated for
this packet, even in other routines on the same hook.
Defined at line 3259 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h
bool is_jump ()
Defined at line 3265 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h
::std::string & jump ()
Jump from the current routine to the routine identified by the provided
name.
The target routine must be in the same namespace as the calling routine,
and it cannot be installed on a hook; it must be an uninstalled routine.
Defined at line 3272 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h
const ::std::string & jump ()
Jump from the current routine to the routine identified by the provided
name.
The target routine must be in the same namespace as the calling routine,
and it cannot be installed on a hook; it must be an uninstalled routine.
Defined at line 3282 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h
bool is_return_ ()
Defined at line 3288 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h
::fuchsia::net::filter::Empty & return_ ()
Stop evaluation of the current routine and return to the calling routine
(the routine from which the current routine was jumped), continuing
evaluation at the next rule.
If invoked in an installed routine, equivalent to `accept`, given packets
are accepted by default in the absence of any matching rules.
Defined at line 3296 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h
const ::fuchsia::net::filter::Empty & return_ ()
Stop evaluation of the current routine and return to the calling routine
(the routine from which the current routine was jumped), continuing
evaluation at the next rule.
If invoked in an installed routine, equivalent to `accept`, given packets
are accepted by default in the absence of any matching rules.
Defined at line 3307 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h
bool is_transparent_proxy ()
Defined at line 3313 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h
::fuchsia::net::filter::TransparentProxy & transparent_proxy ()
Redirect the packet to a local socket without changing the packet header
in any way.
This is a terminal action for the current hook, i.e. no further rules
will be evaluated for this packet, even in other routines on the same
hook. However, note that this does not preclude actions on *other* hooks
from having an effect on this packet; for example, a packet that hits
TransparentProxy in INGRESS could still be dropped in LOCAL_INGRESS.
This action is only valid in the INGRESS hook. This action is also only
valid in a rule that ensures the presence of a TCP or UDP header by
matching on the transport protocol, so that the packet can be properly
dispatched.
Also note that transparently proxied packets will only be delivered to
sockets with the transparent socket option enabled. If no such socket
exists, the packet will be dropped.
This is analogous to the `tproxy` statement in Netfilter.
Defined at line 3334 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h
const ::fuchsia::net::filter::TransparentProxy & transparent_proxy ()
Redirect the packet to a local socket without changing the packet header
in any way.
This is a terminal action for the current hook, i.e. no further rules
will be evaluated for this packet, even in other routines on the same
hook. However, note that this does not preclude actions on *other* hooks
from having an effect on this packet; for example, a packet that hits
TransparentProxy in INGRESS could still be dropped in LOCAL_INGRESS.
This action is only valid in the INGRESS hook. This action is also only
valid in a rule that ensures the presence of a TCP or UDP header by
matching on the transport protocol, so that the packet can be properly
dispatched.
Also note that transparently proxied packets will only be delivered to
sockets with the transparent socket option enabled. If no such socket
exists, the packet will be dropped.
This is analogous to the `tproxy` statement in Netfilter.
Defined at line 3358 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h
bool is_redirect ()
Defined at line 3364 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h
::fuchsia::net::filter::Redirect & redirect ()
A special case of destination NAT (DNAT) that redirects the packet to
the local host.
This is a terminal action for all NAT routines on the current hook. The
packet is redirected by rewriting the destination IP address to one
owned by the ingress interface (if operating on incoming traffic in
INGRESS) or the loopback address (if operating on locally-generated
traffic in LOCAL_EGRESS). If this rule is installed on INGRESS and no IP
address is assigned to the incoming interface, the packet is dropped.
As with all DNAT actions, this action is only valid in the INGRESS and
LOCAL_EGRESS hooks. If a destination port is specified, this action is
only valid in a rule that ensures the presence of a TCP or UDP header by
matching on the transport protocol, so that the destination port can be
rewritten.
This is analogous to the `redirect` statement in Netfilter.
Defined at line 3383 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h
const ::fuchsia::net::filter::Redirect & redirect ()
A special case of destination NAT (DNAT) that redirects the packet to
the local host.
This is a terminal action for all NAT routines on the current hook. The
packet is redirected by rewriting the destination IP address to one
owned by the ingress interface (if operating on incoming traffic in
INGRESS) or the loopback address (if operating on locally-generated
traffic in LOCAL_EGRESS). If this rule is installed on INGRESS and no IP
address is assigned to the incoming interface, the packet is dropped.
As with all DNAT actions, this action is only valid in the INGRESS and
LOCAL_EGRESS hooks. If a destination port is specified, this action is
only valid in a rule that ensures the presence of a TCP or UDP header by
matching on the transport protocol, so that the destination port can be
rewritten.
This is analogous to the `redirect` statement in Netfilter.
Defined at line 3405 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h
bool is_masquerade ()
Defined at line 3411 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h
::fuchsia::net::filter::Masquerade & masquerade ()
A special case of source NAT (SNAT) that reassigns the source IP address
of the packet to an address that is assigned to the outgoing interface.
This is a terminal action for all NAT routines on the current hook. If
no address is assigned to the outgoing interface, the packet will be
dropped.
This action is only valid in the EGRESS hook. If a source port range is
specified, this action is only valid in a rule that ensures the presence
of a TCP or UDP header by matching on the transport protocol, so that
the source port can be rewritten.
This is analogous to the `masquerade` statement in Netfilter.
Defined at line 3426 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h
const ::fuchsia::net::filter::Masquerade & masquerade ()
A special case of source NAT (SNAT) that reassigns the source IP address
of the packet to an address that is assigned to the outgoing interface.
This is a terminal action for all NAT routines on the current hook. If
no address is assigned to the outgoing interface, the packet will be
dropped.
This action is only valid in the EGRESS hook. If a source port range is
specified, this action is only valid in a rule that ensures the presence
of a TCP or UDP header by matching on the transport protocol, so that
the source port can be rewritten.
This is analogous to the `masquerade` statement in Netfilter.
Defined at line 3444 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h
bool is_mark ()
Defined at line 3450 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h
::fuchsia::net::filter::Mark & mark ()
Applies the mark action to the given mark domain.
This is a non-terminal action for both routines and hooks. This is also
only available in [`IpRoutines`] because [`NatRoutines`] only runs on
the first packet in a connection and it is likely a misconfiguration
that packets after the first are marked differently or unmarked.
Note: If we find use cases that justify this being in [`NatRoutines`] we
should relax this limitation and support it.
This is analogous to the `mark` statement in Netfilter.
Defined at line 3463 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h
const ::fuchsia::net::filter::Mark & mark ()
Applies the mark action to the given mark domain.
This is a non-terminal action for both routines and hooks. This is also
only available in [`IpRoutines`] because [`NatRoutines`] only runs on
the first packet in a connection and it is likely a misconfiguration
that packets after the first are marked differently or unmarked.
Note: If we find use cases that justify this being in [`NatRoutines`] we
should relax this limitation and support it.
This is analogous to the `mark` statement in Netfilter.
Defined at line 3479 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h
bool is_none ()
Defined at line 3485 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h
::fuchsia::net::filter::Empty & none ()
A non-terminal action that does nothing. Useful to run matchers that may
have side-effects, particularly eBPF matchers.
Defined at line 3489 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h
const ::fuchsia::net::filter::Empty & none ()
A non-terminal action that does nothing. Useful to run matchers that may
have side-effects, particularly eBPF matchers.
Defined at line 3496 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h
::fuchsia::net::filter::Action::Tag Which ()
Defined at line 3503 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h
fidl_xunion_tag_t Ordinal ()
You probably want to use Which() method instead of Ordinal(). Use Ordinal() only when you need
access to the raw integral ordinal value.
Defined at line 3525 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h
const std::vector<uint8_t> * UnknownBytes ()
Defined at line 3528 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h
void ~Action ()
Action & operator= (Action && )
Action WithAccept (::fuchsia::net::filter::Empty && )
Action WithDrop (::fuchsia::net::filter::Empty && )
Action WithJump (::std::string && )
Action WithReturn_ (::fuchsia::net::filter::Empty && )
Action WithTransparentProxy (::fuchsia::net::filter::TransparentProxy && )
Action WithRedirect (::fuchsia::net::filter::Redirect && )
Action WithMasquerade (::fuchsia::net::filter::Masquerade && )
Action WithMark (::fuchsia::net::filter::Mark && )
Action WithNone (::fuchsia::net::filter::Empty && )
Action & set_accept (::fuchsia::net::filter::Empty value)
Action & set_drop (::fuchsia::net::filter::Empty value)
Action & set_jump (::std::string value)
Action & set_return_ (::fuchsia::net::filter::Empty value)
Action & set_transparent_proxy (::fuchsia::net::filter::TransparentProxy value)
Action & set_redirect (::fuchsia::net::filter::Redirect value)
Action & set_masquerade (::fuchsia::net::filter::Masquerade value)
Action & set_mark (::fuchsia::net::filter::Mark value)
Action & set_none (::fuchsia::net::filter::Empty value)
Enumerations
enum Tag
| Name | Value |
|---|---|
| kUnknown | 0 |
| kAccept | 1 |
| kDrop | 2 |
| kJump | 3 |
| kReturn | 4 |
| kTransparentProxy | 5 |
| kRedirect | 6 |
| kMasquerade | 7 |
| kMark | 8 |
| kNone | 9 |
| Invalid | ::std::numeric_limits<::fidl_union_tag_t>::max() |
Defined at line 3193 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h
Friends
class Equality