pub enum Server_Request {
StartServing {
responder: Server_StartServingResponder,
},
StopServing {
responder: Server_StopServingResponder,
},
IsServing {
responder: Server_IsServingResponder,
},
GetOption {
code: OptionCode,
responder: Server_GetOptionResponder,
},
GetParameter {
name: ParameterName,
responder: Server_GetParameterResponder,
},
SetOption {
value: Option_,
responder: Server_SetOptionResponder,
},
SetParameter {
value: Parameter,
responder: Server_SetParameterResponder,
},
ListOptions {
responder: Server_ListOptionsResponder,
},
ListParameters {
responder: Server_ListParametersResponder,
},
ResetOptions {
responder: Server_ResetOptionsResponder,
},
ResetParameters {
responder: Server_ResetParametersResponder,
},
ClearLeases {
responder: Server_ClearLeasesResponder,
},
}
Expand description
Provides methods for DHCP Server configuration.
Variants§
StartServing
Starts serving DHCP leases.
Starts the DHCP server with the current set of parameters.
On error the server remains in the stopped state. If the server is
already serving, StartServing
is a no-op.
*error a zx.Status indicating why the server could not be started.
Fields
responder: Server_StartServingResponder
StopServing
Stops serving DHCP leases.
Stopping causes all the listening ports to be closed.
Configuring parameters on the DHCP server is only allowed when the server is stopped.
If the server is not currently serving, StopServing
is a no-op.
Fields
responder: Server_StopServingResponder
IsServing
Returns whether or not the server is serving DHCP leases.
Fields
responder: Server_IsServingResponder
GetOption
Returns the requested Option if it is supported.
- request
code
the code of an Option whose value has been requested.
- response
value
the value of the requested Option.
- error a zx.Status indicating why the value could not be retrieved.
GetParameter
Returns the requested Parameter if it is supported.
- request
name
the name of a Parameter whose value has been requested.
- response
value
the value of the requested Parameter.
- error a zx.Status indicating why the value could not be retrieved.
SetOption
Sets the Option to the argument. On success, a SetOption will take effect immediately.
- request
value
an Option whose value will be set to the value of this argument.
- error a zx.Status indicating the cause of failure.
SetParameter
Sets the Parameter to the argument. On success, the new parameter value can be queried by GetParameter or ListParameter immediately. However, the server may require a restart in order for the new Parameter value to take effect.
Setting parameters is only allowed if the server is stopped.
ZX_ERR_BAD_STATE
is returned otherwise.
- request
value
a Parameter whose value will be set to the value of this argument.
- error a zx.Status indicating the cause of failure.
ListOptions
Lists all DHCP options for which the Server has a value. Any option which does not have a value will be omitted from the returned list. ListOptions provides administrators a means to print a server’s configuration as opposed to querying the value of a single Option.
- response
options
a vector containing all of the options for which the Server has a value. Bounded to 256 as options are identified by a 1 octet code and 256 is the maximum number of such codes.
- error a zx.Status indicating the cause of failure.
Fields
responder: Server_ListOptionsResponder
ListParameters
Lists all DHCP server parameters. ListParameters provides administrators a means to print a server’s configuration as opposed to querying the value of a single Parameter.
- response
parameter
a vector containing the values of all of the Server’s parameters. Bounded to 256 to provide a generous upper limit on the number of server parameters while being of the same size as ListOptions.
- error a zx.Status indicating the cause of failure.
Fields
responder: Server_ListParametersResponder
ResetOptions
Resets all DHCP options to have no value. On success, ResetOptions will take effect immediately.
- error a zx.Status indicating the cause of failure.
Fields
responder: Server_ResetOptionsResponder
ResetParameters
Resets all DHCP server parameters to their default value. On success, the reset parameter values can be queried immediately with GetParameter or ListParameters. However, the server must be restarted before all new parameter values take effect.
Setting parameters is only allowed if the server is stopped.
ZX_ERR_BAD_STATE
is returned otherwise.
- error a zx.Status indicating the cause of failure.
Fields
responder: Server_ResetParametersResponder
ClearLeases
Clears all leases maintained by the Server. On success, ClearLeases will take effect immediately. Server administrators should take care when calling this method as the DHCP protocol does not provide a mechanism by which a Server can notify a client that its lease has been cleared.
- error a zx.Status indicating the cause of failure.
Fields
responder: Server_ClearLeasesResponder
Implementations§
Source§impl Server_Request
impl Server_Request
pub fn into_start_serving(self) -> Option<Server_StartServingResponder>
pub fn into_stop_serving(self) -> Option<Server_StopServingResponder>
pub fn into_is_serving(self) -> Option<Server_IsServingResponder>
pub fn into_get_option(self) -> Option<(OptionCode, Server_GetOptionResponder)>
pub fn into_get_parameter( self, ) -> Option<(ParameterName, Server_GetParameterResponder)>
pub fn into_set_option(self) -> Option<(Option_, Server_SetOptionResponder)>
pub fn into_set_parameter( self, ) -> Option<(Parameter, Server_SetParameterResponder)>
pub fn into_list_options(self) -> Option<Server_ListOptionsResponder>
pub fn into_list_parameters(self) -> Option<Server_ListParametersResponder>
pub fn into_reset_options(self) -> Option<Server_ResetOptionsResponder>
pub fn into_reset_parameters(self) -> Option<Server_ResetParametersResponder>
pub fn into_clear_leases(self) -> Option<Server_ClearLeasesResponder>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL