class Action

Defined at line 3325 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 && )
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 WithReject (::fuchsia::net::filter::Reject && )
::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 3369 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 3373 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 3381 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 3392 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 3398 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 3404 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 3413 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 3419 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 3426 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 3436 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 3442 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 3450 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 3461 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 3467 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 IP routines on 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 3488 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 IP routines on 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 3512 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 3518 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 3537 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 3559 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 3565 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 3580 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 3598 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 3604 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 [`IpRoutine`]s because [`NatRoutines`]s 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 [`NatRoutine`]s we

should relax this limitation and support it.

This is analogous to the `mark` statement in Netfilter.

Defined at line 3617 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 [`IpRoutine`]s because [`NatRoutines`]s 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 [`NatRoutine`]s we

should relax this limitation and support it.

This is analogous to the `mark` statement in Netfilter.

Defined at line 3633 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 3639 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 3643 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 3650 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h

bool is_reject ()

Defined at line 3656 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h

::fuchsia::net::filter::Reject & reject ()

Rejects the packet by dropping it and responding to the sender.

`reject_type` defines the message sent back to the source address.

Allowed only in [`IpRoutine`]'s installed at `LOCAL_INGRESS`,

`FORWARDING` and `LOCAL_EGRESS` hooks.

This is a terminal action.

Defined at line 3665 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h

const ::fuchsia::net::filter::Reject & reject ()

Rejects the packet by dropping it and responding to the sender.

`reject_type` defines the message sent back to the source address.

Allowed only in [`IpRoutine`]'s installed at `LOCAL_INGRESS`,

`FORWARDING` and `LOCAL_EGRESS` hooks.

This is a terminal action.

Defined at line 3677 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 3684 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 3707 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 3710 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 & 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)
Action & set_reject (::fuchsia::net::filter::Reject 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
kReject 10
Invalid ::std::numeric_limits<::fidl_union_tag_t>::max()

Defined at line 3346 of file fidling/gen/sdk/fidl/fuchsia.net.filter/fuchsia.net.filter/hlcpp/fuchsia/net/filter/cpp/fidl.h

Friends

class Equality