pub enum FilterRequest {
EnableInterface {
id: u64,
responder: FilterEnableInterfaceResponder,
},
DisableInterface {
id: u64,
responder: FilterDisableInterfaceResponder,
},
GetRules {
responder: FilterGetRulesResponder,
},
UpdateRules {
rules: Vec<Rule>,
generation: u32,
responder: FilterUpdateRulesResponder,
},
GetNatRules {
responder: FilterGetNatRulesResponder,
},
UpdateNatRules {
rules: Vec<Nat>,
generation: u32,
responder: FilterUpdateNatRulesResponder,
},
GetRdrRules {
responder: FilterGetRdrRulesResponder,
},
UpdateRdrRules {
rules: Vec<Rdr>,
generation: u32,
responder: FilterUpdateRdrRulesResponder,
},
CheckPresence {
responder: FilterCheckPresenceResponder,
},
}
Expand description
A protocol for filtering TCP/IP traffic and Network Address Translation.
Variants§
EnableInterface
Enable the filter on a specific interface.
The filter is disabled by default. If the filter is already enabled, no error is returned.
- request
id
The id of the network interface.
- error Reports
NOT_FOUND
ifid
is not a valid interface.
DisableInterface
Disable the filter on a specific interface.
The filter is disabled by default. If the filter is already disabled, no error is returned.
- request
id
The id of the network interface.
- error Reports
NOT_FOUND
ifid
is not a valid interface.
GetRules
GetRules gets the current rules. They do not include NAT or RDR rules. (use GetNatRules or GetRdrRules instead).
- response
rules
The current filter rules. - response
generation
The generation number associated with the current rules.
Fields
responder: FilterGetRulesResponder
UpdateRules
UpdateRules updates the current rules. It does not update NAT or RDR rules (use UpdateNatRules or UpdateRdrRules instead).
UpdateRules takes a generation number that is previously returned from GetRules. The generation number has to be up-to-date, i.e. it has to match with the one associated with the current rules. The service will assign a new generation number to the new rules.
- request
rules
The new filter rules to install. - request
generation
The generation number previously returned from GetRules.
- error Reports
GENERATION_MISMATCH
ifgeneration
is not the generation number for the current rules. - error Reports
BAD_RULE
ifrules
are not valid.
GetNatRules
GetNatRules gets the current NAT rules.
- response
rules
The current NAT rules. - response
generation
The generation number associated with the current NAT rules.
Fields
responder: FilterGetNatRulesResponder
UpdateNatRules
UpdateNatRules updates the current NAT rules.
UpdateNatRules takes a generation number that is previously returned from GetRules. The generation number has to be up-to-date, i.e. it has to match with the one associated with the current NAT rules. The service will assign a new generation number to the new NAT rules.
- request
rules
The new NAT rules to install. - request
generation
The generation number previously returned from GetNATRules.
- error Reports
GENERATION_MISMATCH
ifgeneration
is not the generation number for the current rules. - error Reports
BAD_RULE
ifrules
are not valid.
GetRdrRules
GetRdrRules gets the current RDR rules.
- response
rules
The current RDR rules. - response
generation
The generation number associated with the current RDR rules.
Fields
responder: FilterGetRdrRulesResponder
UpdateRdrRules
UpdateRdrRules updates the previous RDR rules with new rules.
UpdateRdrRules takes a generation number that is previously returned from GetRules. The generation number has to be up-to-date, i.e. it has to match with the one associated with the current RDR rules. The service will assign a new generation number to the new RDR rules.
- request
rules
The new RDR rules to install. - request
generation
The generation number previously returned from GetRDRRules.
- error Reports
NOT_SUPPORTED
if the operation is not supported.
CheckPresence
No-op method that allows checking for presence.
It’s not currently possible for a client with an optionally-provided protocol to check whether there’s someone on the other end without making a FIDL call (https://fxbug.dev/296283299). This method provides a workaround by giving a client a two-way method that it can call to check for liveness.
Fields
responder: FilterCheckPresenceResponder
Implementations§
Source§impl FilterRequest
impl FilterRequest
pub fn into_enable_interface( self, ) -> Option<(u64, FilterEnableInterfaceResponder)>
pub fn into_disable_interface( self, ) -> Option<(u64, FilterDisableInterfaceResponder)>
pub fn into_get_rules(self) -> Option<FilterGetRulesResponder>
pub fn into_update_rules( self, ) -> Option<(Vec<Rule>, u32, FilterUpdateRulesResponder)>
pub fn into_get_nat_rules(self) -> Option<FilterGetNatRulesResponder>
pub fn into_update_nat_rules( self, ) -> Option<(Vec<Nat>, u32, FilterUpdateNatRulesResponder)>
pub fn into_get_rdr_rules(self) -> Option<FilterGetRdrRulesResponder>
pub fn into_update_rdr_rules( self, ) -> Option<(Vec<Rdr>, u32, FilterUpdateRdrRulesResponder)>
pub fn into_check_presence(self) -> Option<FilterCheckPresenceResponder>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL