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
idThe id of the network interface.
- error Reports
NOT_FOUNDifidis 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
idThe id of the network interface.
- error Reports
NOT_FOUNDifidis not a valid interface.
GetRules
GetRules gets the current rules. They do not include NAT or RDR rules. (use GetNatRules or GetRdrRules instead).
- response
rulesThe current filter rules. - response
generationThe generation number associated with the current rules.
Fields
responder: FilterGetRulesResponderUpdateRules
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
rulesThe new filter rules to install. - request
generationThe generation number previously returned from GetRules.
- error Reports
GENERATION_MISMATCHifgenerationis not the generation number for the current rules. - error Reports
BAD_RULEifrulesare not valid.
GetNatRules
GetNatRules gets the current NAT rules.
- response
rulesThe current NAT rules. - response
generationThe generation number associated with the current NAT rules.
Fields
responder: FilterGetNatRulesResponderUpdateNatRules
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
rulesThe new NAT rules to install. - request
generationThe generation number previously returned from GetNATRules.
- error Reports
GENERATION_MISMATCHifgenerationis not the generation number for the current rules. - error Reports
BAD_RULEifrulesare not valid.
GetRdrRules
GetRdrRules gets the current RDR rules.
- response
rulesThe current RDR rules. - response
generationThe generation number associated with the current RDR rules.
Fields
responder: FilterGetRdrRulesResponderUpdateRdrRules
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
rulesThe new RDR rules to install. - request
generationThe generation number previously returned from GetRDRRules.
- error Reports
NOT_SUPPORTEDif 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: FilterCheckPresenceResponderImplementations§
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
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FilterRequest
impl !RefUnwindSafe for FilterRequest
impl Send for FilterRequest
impl Sync for FilterRequest
impl Unpin for FilterRequest
impl UnsafeUnpin for FilterRequest
impl !UnwindSafe for FilterRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
T to [Self]