1use argh::{ArgsInfo, FromArgs};
6
7use fidl_fuchsia_net_ext::MacAddress as MacAddr;
8use std::net::Ipv4Addr;
9
10#[derive(ArgsInfo, FromArgs, Clone, Debug, PartialEq)]
11#[argh(subcommand, name = "dhcpd")]
12pub struct Dhcpd {
14 #[argh(subcommand)]
15 pub dhcpd_cmd: DhcpdEnum,
16}
17
18#[derive(ArgsInfo, FromArgs, Clone, Debug, PartialEq)]
19#[argh(subcommand)]
20pub enum DhcpdEnum {
21 Start(Start),
23 Stop(Stop),
25 Get(Get),
27 Set(Set),
29 List(List),
31 Reset(Reset),
33 ClearLeases(ClearLeases),
36}
37
38#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
40#[argh(subcommand, name = "start")]
41pub struct Start {}
42
43#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
45#[argh(subcommand, name = "stop")]
46pub struct Stop {}
47
48#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
50#[argh(subcommand, name = "get")]
51pub struct Get {
52 #[argh(subcommand)]
53 pub arg: GetArg,
54}
55
56#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
58#[argh(subcommand, name = "set")]
59pub struct Set {
60 #[argh(subcommand)]
61 pub arg: SetArg,
62}
63
64#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
66#[argh(subcommand, name = "list")]
67pub struct List {
68 #[argh(subcommand)]
69 pub arg: ListArg,
70}
71
72#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
74#[argh(subcommand, name = "reset")]
75pub struct Reset {
76 #[argh(subcommand)]
77 pub arg: ResetArg,
78}
79
80#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
82#[argh(subcommand, name = "clear-leases")]
83pub struct ClearLeases {}
84
85#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
86#[argh(subcommand)]
87pub enum GetArg {
88 Option(OptionArg),
90 Parameter(ParameterArg),
92}
93#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
95#[argh(subcommand)]
96pub enum SetArg {
97 Option(OptionArg),
98 Parameter(ParameterArg),
99}
100
101#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
103#[argh(subcommand)]
104pub enum ListArg {
105 Option(OptionToken),
106 Parameter(ParameterToken),
107}
108
109#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
111#[argh(subcommand)]
112pub enum ResetArg {
113 Option(OptionToken),
114 Parameter(ParameterToken),
115}
116
117#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
119#[argh(subcommand, name = "option")]
120pub struct OptionArg {
121 #[argh(subcommand)]
123 pub name: Option_,
124}
125
126#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
128#[argh(subcommand, name = "parameter")]
129pub struct ParameterArg {
130 #[argh(subcommand)]
132 pub name: Parameter,
133}
134#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
136#[argh(subcommand, name = "option")]
137pub struct OptionToken {}
138
139#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
141#[argh(subcommand, name = "parameter")]
142pub struct ParameterToken {}
143
144#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
146#[argh(subcommand)]
147pub enum Option_ {
148 SubnetMask(SubnetMask),
149 TimeOffset(TimeOffset),
150 Router(Router),
151 TimeServer(TimeServer),
152 NameServer(NameServer),
153 DomainNameServer(DomainNameServer),
154 LogServer(LogServer),
155 CookieServer(CookieServer),
156 LprServer(LprServer),
157 ImpressServer(ImpressServer),
158 ResourceLocationServer(ResourceLocationServer),
159 HostName(HostName),
160 BootFileSize(BootFileSize),
161 MeritDumpFile(MeritDumpFile),
162 DomainName(DomainName),
163 SwapServer(SwapServer),
164 RootPath(RootPath),
165 ExtensionsPath(ExtensionsPath),
166 IpForwarding(IpForwarding),
167 NonLocalSourceRouting(NonLocalSourceRouting),
168 PolicyFilter(PolicyFilter),
169 MaxDatagramReassemblySize(MaxDatagramReassemblySize),
170 DefaultIpTtl(DefaultIpTtl),
171 PathMtuAgingTimeout(PathMtuAgingTimeout),
172 PathMtuPlateauTable(PathMtuPlateauTable),
173 InterfaceMtu(InterfaceMtu),
174 AllSubnetsLocal(AllSubnetsLocal),
175 BroadcastAddress(BroadcastAddress),
176 PerformMaskDiscovery(PerformMaskDiscovery),
177 MaskSupplier(MaskSupplier),
178 PerformRouterDiscovery(PerformRouterDiscovery),
179 RouterSolicitationAddress(RouterSolicitationAddress),
180 StaticRoute(StaticRoute),
181 TrailerEncapsulation(TrailerEncapsulation),
182 ArpCacheTimeout(ArpCacheTimeout),
183 EthernetEncapsulation(EthernetEncapsulation),
184 TcpDefaultTtl(TcpDefaultTtl),
185 TcpKeepaliveInterval(TcpKeepaliveInterval),
186 TcpKeepaliveGarbage(TcpKeepaliveGarbage),
187 NetworkInformationServiceDomain(NetworkInformationServiceDomain),
188 NetworkInformationServers(NetworkInformationServers),
189 NetworkTimeProtocolServers(NetworkTimeProtocolServers),
190 VendorSpecificInformation(VendorSpecificInformation),
191 NetBiosOverTcpipNameServer(NetBiosOverTcpipNameServer),
192 NetBiosOverTcpipDatagramDistributionServer(NetBiosOverTcpipDatagramDistributionServer),
193 NetBiosOverTcpipNodeType(NetBiosOverTcpipNodeType),
194 NetBiosOverTcpipScope(NetBiosOverTcpipScope),
195 XWindowSystemFontServer(XWindowSystemFontServer),
196 XWindowSystemDisplayManager(XWindowSystemDisplayManager),
197 NetworkInformationServicePlusDomain(NetworkInformationServicePlusDomain),
198 NetworkInformationServicePlusServers(NetworkInformationServicePlusServers),
199 MobileIpHomeAgent(MobileIpHomeAgent),
200 SmtpServer(SmtpServer),
201 Pop3Server(Pop3Server),
202 NntpServer(NntpServer),
203 DefaultWwwServer(DefaultWwwServer),
204 DefaultFingerServer(DefaultFingerServer),
205 DefaultIrcServer(DefaultIrcServer),
206 StreettalkServer(StreettalkServer),
207 StreettalkDirectoryAssistanceServer(StreettalkDirectoryAssistanceServer),
208 TftpServerName(TftpServerName),
209 BootfileName(BootfileName),
210 MaxDhcpMessageSize(MaxDhcpMessageSize),
211 RenewalTimeValue(RenewalTimeValue),
212 RebindingTimeValue(RebindingTimeValue),
213}
214
215impl Into<fidl_fuchsia_net_dhcp::OptionCode> for Option_ {
216 fn into(self) -> fidl_fuchsia_net_dhcp::OptionCode {
217 match self {
218 Option_::SubnetMask(_) => fidl_fuchsia_net_dhcp::OptionCode::SubnetMask,
219 Option_::TimeOffset(_) => fidl_fuchsia_net_dhcp::OptionCode::TimeOffset,
220 Option_::Router(_) => fidl_fuchsia_net_dhcp::OptionCode::Router,
221 Option_::TimeServer(_) => fidl_fuchsia_net_dhcp::OptionCode::TimeServer,
222 Option_::NameServer(_) => fidl_fuchsia_net_dhcp::OptionCode::NameServer,
223 Option_::DomainNameServer(_) => fidl_fuchsia_net_dhcp::OptionCode::DomainNameServer,
224 Option_::LogServer(_) => fidl_fuchsia_net_dhcp::OptionCode::LogServer,
225 Option_::CookieServer(_) => fidl_fuchsia_net_dhcp::OptionCode::CookieServer,
226 Option_::LprServer(_) => fidl_fuchsia_net_dhcp::OptionCode::LprServer,
227 Option_::ImpressServer(_) => fidl_fuchsia_net_dhcp::OptionCode::ImpressServer,
228 Option_::ResourceLocationServer(_) => {
229 fidl_fuchsia_net_dhcp::OptionCode::ResourceLocationServer
230 }
231 Option_::HostName(_) => fidl_fuchsia_net_dhcp::OptionCode::HostName,
232 Option_::BootFileSize(_) => fidl_fuchsia_net_dhcp::OptionCode::BootFileSize,
233 Option_::MeritDumpFile(_) => fidl_fuchsia_net_dhcp::OptionCode::MeritDumpFile,
234 Option_::DomainName(_) => fidl_fuchsia_net_dhcp::OptionCode::DomainName,
235 Option_::SwapServer(_) => fidl_fuchsia_net_dhcp::OptionCode::SwapServer,
236 Option_::RootPath(_) => fidl_fuchsia_net_dhcp::OptionCode::RootPath,
237 Option_::ExtensionsPath(_) => fidl_fuchsia_net_dhcp::OptionCode::ExtensionsPath,
238 Option_::IpForwarding(_) => fidl_fuchsia_net_dhcp::OptionCode::IpForwarding,
239 Option_::NonLocalSourceRouting(_) => {
240 fidl_fuchsia_net_dhcp::OptionCode::NonLocalSourceRouting
241 }
242 Option_::PolicyFilter(_) => fidl_fuchsia_net_dhcp::OptionCode::PolicyFilter,
243 Option_::MaxDatagramReassemblySize(_) => {
244 fidl_fuchsia_net_dhcp::OptionCode::MaxDatagramReassemblySize
245 }
246 Option_::DefaultIpTtl(_) => fidl_fuchsia_net_dhcp::OptionCode::DefaultIpTtl,
247 Option_::PathMtuAgingTimeout(_) => {
248 fidl_fuchsia_net_dhcp::OptionCode::PathMtuAgingTimeout
249 }
250 Option_::PathMtuPlateauTable(_) => {
251 fidl_fuchsia_net_dhcp::OptionCode::PathMtuPlateauTable
252 }
253 Option_::InterfaceMtu(_) => fidl_fuchsia_net_dhcp::OptionCode::InterfaceMtu,
254 Option_::AllSubnetsLocal(_) => fidl_fuchsia_net_dhcp::OptionCode::AllSubnetsLocal,
255 Option_::BroadcastAddress(_) => fidl_fuchsia_net_dhcp::OptionCode::BroadcastAddress,
256 Option_::PerformMaskDiscovery(_) => {
257 fidl_fuchsia_net_dhcp::OptionCode::PerformMaskDiscovery
258 }
259 Option_::MaskSupplier(_) => fidl_fuchsia_net_dhcp::OptionCode::MaskSupplier,
260 Option_::PerformRouterDiscovery(_) => {
261 fidl_fuchsia_net_dhcp::OptionCode::PerformRouterDiscovery
262 }
263 Option_::RouterSolicitationAddress(_) => {
264 fidl_fuchsia_net_dhcp::OptionCode::RouterSolicitationAddress
265 }
266 Option_::StaticRoute(_) => fidl_fuchsia_net_dhcp::OptionCode::StaticRoute,
267 Option_::TrailerEncapsulation(_) => {
268 fidl_fuchsia_net_dhcp::OptionCode::TrailerEncapsulation
269 }
270 Option_::ArpCacheTimeout(_) => fidl_fuchsia_net_dhcp::OptionCode::ArpCacheTimeout,
271 Option_::EthernetEncapsulation(_) => {
272 fidl_fuchsia_net_dhcp::OptionCode::EthernetEncapsulation
273 }
274 Option_::TcpDefaultTtl(_) => fidl_fuchsia_net_dhcp::OptionCode::TcpDefaultTtl,
275 Option_::TcpKeepaliveInterval(_) => {
276 fidl_fuchsia_net_dhcp::OptionCode::TcpKeepaliveInterval
277 }
278 Option_::TcpKeepaliveGarbage(_) => {
279 fidl_fuchsia_net_dhcp::OptionCode::TcpKeepaliveGarbage
280 }
281 Option_::NetworkInformationServiceDomain(_) => {
282 fidl_fuchsia_net_dhcp::OptionCode::NetworkInformationServiceDomain
283 }
284 Option_::NetworkInformationServers(_) => {
285 fidl_fuchsia_net_dhcp::OptionCode::NetworkInformationServers
286 }
287 Option_::NetworkTimeProtocolServers(_) => {
288 fidl_fuchsia_net_dhcp::OptionCode::NetworkTimeProtocolServers
289 }
290 Option_::VendorSpecificInformation(_) => {
291 fidl_fuchsia_net_dhcp::OptionCode::VendorSpecificInformation
292 }
293 Option_::NetBiosOverTcpipNameServer(_) => {
294 fidl_fuchsia_net_dhcp::OptionCode::NetbiosOverTcpipNameServer
295 }
296 Option_::NetBiosOverTcpipDatagramDistributionServer(_) => {
297 fidl_fuchsia_net_dhcp::OptionCode::NetbiosOverTcpipDatagramDistributionServer
298 }
299 Option_::NetBiosOverTcpipNodeType(_) => {
300 fidl_fuchsia_net_dhcp::OptionCode::NetbiosOverTcpipNodeType
301 }
302 Option_::NetBiosOverTcpipScope(_) => {
303 fidl_fuchsia_net_dhcp::OptionCode::NetbiosOverTcpipScope
304 }
305 Option_::XWindowSystemFontServer(_) => {
306 fidl_fuchsia_net_dhcp::OptionCode::XWindowSystemFontServer
307 }
308 Option_::XWindowSystemDisplayManager(_) => {
309 fidl_fuchsia_net_dhcp::OptionCode::XWindowSystemDisplayManager
310 }
311 Option_::NetworkInformationServicePlusDomain(_) => {
312 fidl_fuchsia_net_dhcp::OptionCode::NetworkInformationServicePlusDomain
313 }
314 Option_::NetworkInformationServicePlusServers(_) => {
315 fidl_fuchsia_net_dhcp::OptionCode::NetworkInformationServicePlusServers
316 }
317 Option_::MobileIpHomeAgent(_) => fidl_fuchsia_net_dhcp::OptionCode::MobileIpHomeAgent,
318 Option_::SmtpServer(_) => fidl_fuchsia_net_dhcp::OptionCode::SmtpServer,
319 Option_::Pop3Server(_) => fidl_fuchsia_net_dhcp::OptionCode::Pop3Server,
320 Option_::NntpServer(_) => fidl_fuchsia_net_dhcp::OptionCode::NntpServer,
321 Option_::DefaultWwwServer(_) => fidl_fuchsia_net_dhcp::OptionCode::DefaultWwwServer,
322 Option_::DefaultFingerServer(_) => {
323 fidl_fuchsia_net_dhcp::OptionCode::DefaultFingerServer
324 }
325 Option_::DefaultIrcServer(_) => fidl_fuchsia_net_dhcp::OptionCode::DefaultIrcServer,
326 Option_::StreettalkServer(_) => fidl_fuchsia_net_dhcp::OptionCode::StreettalkServer,
327 Option_::StreettalkDirectoryAssistanceServer(_) => {
328 fidl_fuchsia_net_dhcp::OptionCode::StreettalkDirectoryAssistanceServer
329 }
330 Option_::TftpServerName(_) => fidl_fuchsia_net_dhcp::OptionCode::TftpServerName,
331 Option_::BootfileName(_) => fidl_fuchsia_net_dhcp::OptionCode::BootfileName,
332 Option_::MaxDhcpMessageSize(_) => fidl_fuchsia_net_dhcp::OptionCode::MaxDhcpMessageSize,
333 Option_::RenewalTimeValue(_) => fidl_fuchsia_net_dhcp::OptionCode::RenewalTimeValue,
334 Option_::RebindingTimeValue(_) => fidl_fuchsia_net_dhcp::OptionCode::RebindingTimeValue,
335 }
336 }
337}
338
339impl Into<fidl_fuchsia_net_dhcp::Option_> for Option_ {
340 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
341 match self {
342 Option_::SubnetMask(v) => v.into(),
343 Option_::TimeOffset(v) => v.into(),
344 Option_::Router(v) => v.into(),
345 Option_::TimeServer(v) => v.into(),
346 Option_::NameServer(v) => v.into(),
347 Option_::DomainNameServer(v) => v.into(),
348 Option_::LogServer(v) => v.into(),
349 Option_::CookieServer(v) => v.into(),
350 Option_::LprServer(v) => v.into(),
351 Option_::ImpressServer(v) => v.into(),
352 Option_::ResourceLocationServer(v) => v.into(),
353 Option_::HostName(v) => v.into(),
354 Option_::BootFileSize(v) => v.into(),
355 Option_::MeritDumpFile(v) => v.into(),
356 Option_::DomainName(v) => v.into(),
357 Option_::SwapServer(v) => v.into(),
358 Option_::RootPath(v) => v.into(),
359 Option_::ExtensionsPath(v) => v.into(),
360 Option_::IpForwarding(v) => v.into(),
361 Option_::NonLocalSourceRouting(v) => v.into(),
362 Option_::PolicyFilter(v) => v.into(),
363 Option_::MaxDatagramReassemblySize(v) => v.into(),
364 Option_::DefaultIpTtl(v) => v.into(),
365 Option_::PathMtuAgingTimeout(v) => v.into(),
366 Option_::PathMtuPlateauTable(v) => v.into(),
367 Option_::InterfaceMtu(v) => v.into(),
368 Option_::AllSubnetsLocal(v) => v.into(),
369 Option_::BroadcastAddress(v) => v.into(),
370 Option_::PerformMaskDiscovery(v) => v.into(),
371 Option_::MaskSupplier(v) => v.into(),
372 Option_::PerformRouterDiscovery(v) => v.into(),
373 Option_::RouterSolicitationAddress(v) => v.into(),
374 Option_::StaticRoute(v) => v.into(),
375 Option_::TrailerEncapsulation(v) => v.into(),
376 Option_::ArpCacheTimeout(v) => v.into(),
377 Option_::EthernetEncapsulation(v) => v.into(),
378 Option_::TcpDefaultTtl(v) => v.into(),
379 Option_::TcpKeepaliveInterval(v) => v.into(),
380 Option_::TcpKeepaliveGarbage(v) => v.into(),
381 Option_::NetworkInformationServiceDomain(v) => v.into(),
382 Option_::NetworkInformationServers(v) => v.into(),
383 Option_::NetworkTimeProtocolServers(v) => v.into(),
384 Option_::VendorSpecificInformation(v) => v.into(),
385 Option_::NetBiosOverTcpipNameServer(v) => v.into(),
386 Option_::NetBiosOverTcpipDatagramDistributionServer(v) => v.into(),
387 Option_::NetBiosOverTcpipNodeType(v) => v.into(),
388 Option_::NetBiosOverTcpipScope(v) => v.into(),
389 Option_::XWindowSystemFontServer(v) => v.into(),
390 Option_::XWindowSystemDisplayManager(v) => v.into(),
391 Option_::NetworkInformationServicePlusDomain(v) => v.into(),
392 Option_::NetworkInformationServicePlusServers(v) => v.into(),
393 Option_::MobileIpHomeAgent(v) => v.into(),
394 Option_::SmtpServer(v) => v.into(),
395 Option_::Pop3Server(v) => v.into(),
396 Option_::NntpServer(v) => v.into(),
397 Option_::DefaultWwwServer(v) => v.into(),
398 Option_::DefaultFingerServer(v) => v.into(),
399 Option_::DefaultIrcServer(v) => v.into(),
400 Option_::StreettalkServer(v) => v.into(),
401 Option_::StreettalkDirectoryAssistanceServer(v) => v.into(),
402 Option_::TftpServerName(v) => v.into(),
403 Option_::BootfileName(v) => v.into(),
404 Option_::MaxDhcpMessageSize(v) => v.into(),
405 Option_::RenewalTimeValue(v) => v.into(),
406 Option_::RebindingTimeValue(v) => v.into(),
407 }
408 }
409}
410
411#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
413#[argh(subcommand, name = "subnet-mask")]
414pub struct SubnetMask {
415 #[argh(option)]
418 pub(crate) mask: Option<Ipv4Addr>,
419}
420
421impl Into<fidl_fuchsia_net_dhcp::Option_> for SubnetMask {
422 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
423 let mask = self.mask.unwrap_or(Ipv4Addr::new(0, 0, 0, 0));
424 fidl_fuchsia_net_dhcp::Option_::SubnetMask(fidl_fuchsia_net::Ipv4Address {
425 addr: mask.octets(),
426 })
427 }
428}
429
430#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
432#[argh(subcommand, name = "time-offset")]
433pub struct TimeOffset {
434 #[argh(option)]
437 offset: Option<i32>,
438}
439
440impl Into<fidl_fuchsia_net_dhcp::Option_> for TimeOffset {
441 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
442 let offset = self.offset.unwrap_or(0);
443 fidl_fuchsia_net_dhcp::Option_::TimeOffset(offset)
444 }
445}
446
447#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
449#[argh(subcommand, name = "router")]
450pub struct Router {
451 #[argh(option)]
453 routers: Vec<Ipv4Addr>,
454}
455
456impl Into<fidl_fuchsia_net_dhcp::Option_> for Router {
457 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
458 let routers: Vec<fidl_fuchsia_net::Ipv4Address> = self
459 .routers
460 .iter()
461 .map(|addr| fidl_fuchsia_net::Ipv4Address { addr: addr.octets() })
462 .collect();
463 fidl_fuchsia_net_dhcp::Option_::Router(routers)
464 }
465}
466
467#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
469#[argh(subcommand, name = "time-server")]
470pub struct TimeServer {
471 #[argh(option)]
473 time_servers: Vec<Ipv4Addr>,
474}
475
476impl Into<fidl_fuchsia_net_dhcp::Option_> for TimeServer {
477 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
478 let time_servers: Vec<fidl_fuchsia_net::Ipv4Address> = self
479 .time_servers
480 .iter()
481 .map(|addr| fidl_fuchsia_net::Ipv4Address { addr: addr.octets() })
482 .collect();
483 fidl_fuchsia_net_dhcp::Option_::TimeServer(time_servers)
484 }
485}
486
487#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
489#[argh(subcommand, name = "name-server")]
490pub struct NameServer {
491 #[argh(option)]
493 name_servers: Vec<Ipv4Addr>,
494}
495
496impl Into<fidl_fuchsia_net_dhcp::Option_> for NameServer {
497 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
498 let name_servers: Vec<fidl_fuchsia_net::Ipv4Address> = self
499 .name_servers
500 .iter()
501 .map(|addr| fidl_fuchsia_net::Ipv4Address { addr: addr.octets() })
502 .collect();
503 fidl_fuchsia_net_dhcp::Option_::NameServer(name_servers)
504 }
505}
506
507#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
509#[argh(subcommand, name = "domain-name-server")]
510pub struct DomainNameServer {
511 #[argh(option)]
513 domain_name_servers: Vec<Ipv4Addr>,
514}
515
516impl Into<fidl_fuchsia_net_dhcp::Option_> for DomainNameServer {
517 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
518 let domain_name_servers: Vec<fidl_fuchsia_net::Ipv4Address> = self
519 .domain_name_servers
520 .iter()
521 .map(|addr| fidl_fuchsia_net::Ipv4Address { addr: addr.octets() })
522 .collect();
523 fidl_fuchsia_net_dhcp::Option_::DomainNameServer(domain_name_servers)
524 }
525}
526
527#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
529#[argh(subcommand, name = "log-server")]
530pub struct LogServer {
531 #[argh(option)]
533 log_servers: Vec<Ipv4Addr>,
534}
535
536impl Into<fidl_fuchsia_net_dhcp::Option_> for LogServer {
537 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
538 let log_servers: Vec<fidl_fuchsia_net::Ipv4Address> = self
539 .log_servers
540 .iter()
541 .map(|addr| fidl_fuchsia_net::Ipv4Address { addr: addr.octets() })
542 .collect();
543 fidl_fuchsia_net_dhcp::Option_::LogServer(log_servers)
544 }
545}
546
547#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
549#[argh(subcommand, name = "cookie-server")]
550pub struct CookieServer {
551 #[argh(option)]
553 cookie_servers: Vec<Ipv4Addr>,
554}
555
556impl Into<fidl_fuchsia_net_dhcp::Option_> for CookieServer {
557 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
558 let cookie_servers: Vec<fidl_fuchsia_net::Ipv4Address> = self
559 .cookie_servers
560 .iter()
561 .map(|addr| fidl_fuchsia_net::Ipv4Address { addr: addr.octets() })
562 .collect();
563 fidl_fuchsia_net_dhcp::Option_::CookieServer(cookie_servers)
564 }
565}
566
567#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
569#[argh(subcommand, name = "lpr-server")]
570pub struct LprServer {
571 #[argh(option)]
573 lpr_servers: Vec<Ipv4Addr>,
574}
575
576impl Into<fidl_fuchsia_net_dhcp::Option_> for LprServer {
577 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
578 let lpr_servers: Vec<fidl_fuchsia_net::Ipv4Address> = self
579 .lpr_servers
580 .iter()
581 .map(|addr| fidl_fuchsia_net::Ipv4Address { addr: addr.octets() })
582 .collect();
583 fidl_fuchsia_net_dhcp::Option_::LprServer(lpr_servers)
584 }
585}
586
587#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
589#[argh(subcommand, name = "impress-server")]
590pub struct ImpressServer {
591 #[argh(option)]
593 impress_servers: Vec<Ipv4Addr>,
594}
595
596impl Into<fidl_fuchsia_net_dhcp::Option_> for ImpressServer {
597 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
598 let impress_servers: Vec<fidl_fuchsia_net::Ipv4Address> = self
599 .impress_servers
600 .iter()
601 .map(|addr| fidl_fuchsia_net::Ipv4Address { addr: addr.octets() })
602 .collect();
603 fidl_fuchsia_net_dhcp::Option_::ImpressServer(impress_servers)
604 }
605}
606
607#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
609#[argh(subcommand, name = "resource-location-server")]
610pub struct ResourceLocationServer {
611 #[argh(option)]
613 resource_location_servers: Vec<Ipv4Addr>,
614}
615
616impl Into<fidl_fuchsia_net_dhcp::Option_> for ResourceLocationServer {
617 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
618 let resource_location_server: Vec<fidl_fuchsia_net::Ipv4Address> = self
619 .resource_location_servers
620 .iter()
621 .map(|addr| fidl_fuchsia_net::Ipv4Address { addr: addr.octets() })
622 .collect();
623 fidl_fuchsia_net_dhcp::Option_::ResourceLocationServer(resource_location_server)
624 }
625}
626
627#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
629#[argh(subcommand, name = "host-name")]
630pub struct HostName {
631 #[argh(option)]
633 name: Option<String>,
634}
635
636impl Into<fidl_fuchsia_net_dhcp::Option_> for HostName {
637 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
638 let name = self.name.unwrap_or_else(|| "".to_string());
639 fidl_fuchsia_net_dhcp::Option_::HostName(name)
640 }
641}
642
643#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
645#[argh(subcommand, name = "boot-file-size")]
646pub struct BootFileSize {
647 #[argh(option)]
649 size: Option<u16>,
650}
651
652impl Into<fidl_fuchsia_net_dhcp::Option_> for BootFileSize {
653 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
654 let size = self.size.unwrap_or(0);
655 fidl_fuchsia_net_dhcp::Option_::BootFileSize(size)
656 }
657}
658
659#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
661#[argh(subcommand, name = "merit-dump-file")]
662pub struct MeritDumpFile {
663 #[argh(option)]
665 path: Option<String>,
666}
667
668impl Into<fidl_fuchsia_net_dhcp::Option_> for MeritDumpFile {
669 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
670 let path: String = self.path.unwrap_or(String::new());
671 fidl_fuchsia_net_dhcp::Option_::MeritDumpFile(path)
672 }
673}
674
675#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
677#[argh(subcommand, name = "domain-name")]
678pub struct DomainName {
679 #[argh(option)]
681 name: Option<String>,
682}
683
684impl Into<fidl_fuchsia_net_dhcp::Option_> for DomainName {
685 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
686 let name = self.name.unwrap_or(String::new());
687 fidl_fuchsia_net_dhcp::Option_::DomainName(name)
688 }
689}
690
691#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
693#[argh(subcommand, name = "swap-server")]
694pub struct SwapServer {
695 #[argh(option)]
697 address: Option<Ipv4Addr>,
698}
699
700impl Into<fidl_fuchsia_net_dhcp::Option_> for SwapServer {
701 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
702 let address = fidl_fuchsia_net::Ipv4Address {
703 addr: self.address.unwrap_or(Ipv4Addr::new(0, 0, 0, 0)).octets(),
704 };
705 fidl_fuchsia_net_dhcp::Option_::SwapServer(address)
706 }
707}
708
709#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
711#[argh(subcommand, name = "root-path")]
712pub struct RootPath {
713 #[argh(option)]
717 path: Option<String>,
718}
719
720impl Into<fidl_fuchsia_net_dhcp::Option_> for RootPath {
721 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
722 let path = self.path.unwrap_or(String::new());
723 fidl_fuchsia_net_dhcp::Option_::RootPath(path)
724 }
725}
726
727#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
729#[argh(subcommand, name = "extensions-path")]
730pub struct ExtensionsPath {
731 #[argh(option)]
735 path: Option<String>,
736}
737
738impl Into<fidl_fuchsia_net_dhcp::Option_> for ExtensionsPath {
739 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
740 let path = self.path.unwrap_or(String::new());
741 fidl_fuchsia_net_dhcp::Option_::ExtensionsPath(path)
742 }
743}
744
745#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
747#[argh(subcommand, name = "ip-forwarding")]
748pub struct IpForwarding {
749 #[argh(switch)]
751 enabled: bool,
752}
753
754impl Into<fidl_fuchsia_net_dhcp::Option_> for IpForwarding {
755 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
756 fidl_fuchsia_net_dhcp::Option_::IpForwarding(self.enabled)
757 }
758}
759
760#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
762#[argh(subcommand, name = "non-local-source-routing")]
763pub struct NonLocalSourceRouting {
764 #[argh(switch)]
766 enabled: bool,
767}
768
769impl Into<fidl_fuchsia_net_dhcp::Option_> for NonLocalSourceRouting {
770 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
771 fidl_fuchsia_net_dhcp::Option_::NonLocalSourceRouting(self.enabled)
772 }
773}
774
775#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
777#[argh(subcommand, name = "policy-filter")]
778pub struct PolicyFilter {
779 #[argh(option)]
782 addresses: Vec<Ipv4Addr>,
783}
784
785impl Into<fidl_fuchsia_net_dhcp::Option_> for PolicyFilter {
786 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
787 let addresses: Vec<fidl_fuchsia_net::Ipv4Address> = self
788 .addresses
789 .iter()
790 .map(|addr| fidl_fuchsia_net::Ipv4Address { addr: addr.octets() })
791 .collect();
792 fidl_fuchsia_net_dhcp::Option_::PolicyFilter(addresses)
793 }
794}
795
796#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
798#[argh(subcommand, name = "max-datagram-reassembly-size")]
799pub struct MaxDatagramReassemblySize {
800 #[argh(option)]
803 size: Option<u16>,
804}
805
806impl Into<fidl_fuchsia_net_dhcp::Option_> for MaxDatagramReassemblySize {
807 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
808 let size = self.size.unwrap_or(0);
809 fidl_fuchsia_net_dhcp::Option_::MaxDatagramReassemblySize(size)
810 }
811}
812
813#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
815#[argh(subcommand, name = "default-ip-ttl")]
816pub struct DefaultIpTtl {
817 #[argh(option)]
820 ttl: Option<u8>,
821}
822
823impl Into<fidl_fuchsia_net_dhcp::Option_> for DefaultIpTtl {
824 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
825 let ttl = self.ttl.unwrap_or(0);
826 fidl_fuchsia_net_dhcp::Option_::DefaultIpTtl(ttl)
827 }
828}
829
830#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
832#[argh(subcommand, name = "path-mtu-aging-timeout")]
833pub struct PathMtuAgingTimeout {
834 #[argh(option)]
836 timeout: Option<u32>,
837}
838
839impl Into<fidl_fuchsia_net_dhcp::Option_> for PathMtuAgingTimeout {
840 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
841 let timeout = self.timeout.unwrap_or(0);
842 fidl_fuchsia_net_dhcp::Option_::PathMtuAgingTimeout(timeout)
843 }
844}
845
846#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
848#[argh(subcommand, name = "path-mtu-plateau-table")]
849pub struct PathMtuPlateauTable {
850 #[argh(option)]
853 mtu_sizes: Vec<u16>,
854}
855
856impl Into<fidl_fuchsia_net_dhcp::Option_> for PathMtuPlateauTable {
857 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
858 fidl_fuchsia_net_dhcp::Option_::PathMtuPlateauTable(self.mtu_sizes)
859 }
860}
861
862#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
864#[argh(subcommand, name = "interface-mtu")]
865pub struct InterfaceMtu {
866 #[argh(option)]
868 mtu: Option<u16>,
869}
870
871impl Into<fidl_fuchsia_net_dhcp::Option_> for InterfaceMtu {
872 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
873 let mtu = self.mtu.unwrap_or(0);
874 fidl_fuchsia_net_dhcp::Option_::InterfaceMtu(mtu)
875 }
876}
877
878#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
880#[argh(subcommand, name = "all-subnets-local")]
881pub struct AllSubnetsLocal {
882 #[argh(switch)]
885 local: bool,
886}
887
888impl Into<fidl_fuchsia_net_dhcp::Option_> for AllSubnetsLocal {
889 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
890 fidl_fuchsia_net_dhcp::Option_::AllSubnetsLocal(self.local)
891 }
892}
893
894#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
896#[argh(subcommand, name = "broadcast-address")]
897pub struct BroadcastAddress {
898 #[argh(option)]
900 addr: Option<Ipv4Addr>,
901}
902
903impl Into<fidl_fuchsia_net_dhcp::Option_> for BroadcastAddress {
904 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
905 let addr = fidl_fuchsia_net::Ipv4Address {
906 addr: self.addr.unwrap_or(Ipv4Addr::new(0, 0, 0, 0)).octets(),
907 };
908 fidl_fuchsia_net_dhcp::Option_::BroadcastAddress(addr)
909 }
910}
911
912#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
914#[argh(subcommand, name = "perform-mask-discovery")]
915pub struct PerformMaskDiscovery {
916 #[argh(switch)]
918 do_discovery: bool,
919}
920
921impl Into<fidl_fuchsia_net_dhcp::Option_> for PerformMaskDiscovery {
922 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
923 fidl_fuchsia_net_dhcp::Option_::PerformMaskDiscovery(self.do_discovery)
924 }
925}
926
927#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
929#[argh(subcommand, name = "mask-supplier")]
930pub struct MaskSupplier {
931 #[argh(switch)]
934 supplier: bool,
935}
936
937impl Into<fidl_fuchsia_net_dhcp::Option_> for MaskSupplier {
938 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
939 fidl_fuchsia_net_dhcp::Option_::MaskSupplier(self.supplier)
940 }
941}
942
943#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
945#[argh(subcommand, name = "perform-router-discovery")]
946pub struct PerformRouterDiscovery {
947 #[argh(switch)]
950 do_discovery: bool,
951}
952
953impl Into<fidl_fuchsia_net_dhcp::Option_> for PerformRouterDiscovery {
954 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
955 fidl_fuchsia_net_dhcp::Option_::PerformRouterDiscovery(self.do_discovery)
956 }
957}
958
959#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
961#[argh(subcommand, name = "router-solicitation-address")]
962pub struct RouterSolicitationAddress {
963 #[argh(option)]
965 addr: Option<Ipv4Addr>,
966}
967
968impl Into<fidl_fuchsia_net_dhcp::Option_> for RouterSolicitationAddress {
969 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
970 let addr = fidl_fuchsia_net::Ipv4Address {
971 addr: self.addr.unwrap_or(Ipv4Addr::new(0, 0, 0, 0)).octets(),
972 };
973 fidl_fuchsia_net_dhcp::Option_::RouterSolicitationAddress(addr)
974 }
975}
976
977#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
979#[argh(subcommand, name = "static-route")]
980pub struct StaticRoute {
981 #[argh(option)]
985 routes: Vec<Ipv4Addr>,
986}
987
988impl Into<fidl_fuchsia_net_dhcp::Option_> for StaticRoute {
989 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
990 let routes: Vec<fidl_fuchsia_net::Ipv4Address> = self
991 .routes
992 .iter()
993 .map(|addr| fidl_fuchsia_net::Ipv4Address { addr: addr.octets() })
994 .collect();
995 fidl_fuchsia_net_dhcp::Option_::StaticRoute(routes)
996 }
997}
998
999#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1001#[argh(subcommand, name = "trailer-encapsulation")]
1002pub struct TrailerEncapsulation {
1003 #[argh(switch)]
1006 trailers: bool,
1007}
1008
1009impl Into<fidl_fuchsia_net_dhcp::Option_> for TrailerEncapsulation {
1010 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
1011 fidl_fuchsia_net_dhcp::Option_::TrailerEncapsulation(self.trailers)
1012 }
1013}
1014
1015#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1017#[argh(subcommand, name = "arp-cache-timeout")]
1018pub struct ArpCacheTimeout {
1019 #[argh(option)]
1021 timeout: Option<u32>,
1022}
1023
1024impl Into<fidl_fuchsia_net_dhcp::Option_> for ArpCacheTimeout {
1025 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
1026 let timeout = self.timeout.unwrap_or(0);
1027 fidl_fuchsia_net_dhcp::Option_::ArpCacheTimeout(timeout)
1028 }
1029}
1030
1031#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1033#[argh(subcommand, name = "ethernet-encapsulation")]
1034pub struct EthernetEncapsulation {
1035 #[argh(switch)]
1038 encapsulate: bool,
1039}
1040
1041impl Into<fidl_fuchsia_net_dhcp::Option_> for EthernetEncapsulation {
1042 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
1043 fidl_fuchsia_net_dhcp::Option_::EthernetEncapsulation(self.encapsulate)
1044 }
1045}
1046
1047#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1049#[argh(subcommand, name = "tcp-default-ttl")]
1050pub struct TcpDefaultTtl {
1051 #[argh(option)]
1054 ttl: Option<u8>,
1055}
1056
1057impl Into<fidl_fuchsia_net_dhcp::Option_> for TcpDefaultTtl {
1058 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
1059 let ttl = self.ttl.unwrap_or(0);
1060 fidl_fuchsia_net_dhcp::Option_::TcpDefaultTtl(ttl)
1061 }
1062}
1063
1064#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1066#[argh(subcommand, name = "tcp-keepalive-interval")]
1067pub struct TcpKeepaliveInterval {
1068 #[argh(option)]
1072 interval: Option<u32>,
1073}
1074
1075impl Into<fidl_fuchsia_net_dhcp::Option_> for TcpKeepaliveInterval {
1076 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
1077 let interval = self.interval.unwrap_or(0);
1078 fidl_fuchsia_net_dhcp::Option_::TcpKeepaliveInterval(interval)
1079 }
1080}
1081
1082#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1084#[argh(subcommand, name = "tcp-keepalive-garbage")]
1085pub struct TcpKeepaliveGarbage {
1086 #[argh(switch)]
1089 send_garbage: bool,
1090}
1091
1092impl Into<fidl_fuchsia_net_dhcp::Option_> for TcpKeepaliveGarbage {
1093 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
1094 fidl_fuchsia_net_dhcp::Option_::TcpKeepaliveGarbage(self.send_garbage)
1095 }
1096}
1097
1098#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1100#[argh(subcommand, name = "network-information-service-domain")]
1101pub struct NetworkInformationServiceDomain {
1102 #[argh(option)]
1104 domain_name: Option<String>,
1105}
1106
1107impl Into<fidl_fuchsia_net_dhcp::Option_> for NetworkInformationServiceDomain {
1108 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
1109 let domain_name = self.domain_name.unwrap_or(String::new());
1110 fidl_fuchsia_net_dhcp::Option_::NetworkInformationServiceDomain(domain_name)
1111 }
1112}
1113
1114#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1116#[argh(subcommand, name = "network-information-servers")]
1117pub struct NetworkInformationServers {
1118 #[argh(option)]
1121 servers: Vec<Ipv4Addr>,
1122}
1123
1124impl Into<fidl_fuchsia_net_dhcp::Option_> for NetworkInformationServers {
1125 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
1126 let servers: Vec<fidl_fuchsia_net::Ipv4Address> = self
1127 .servers
1128 .iter()
1129 .map(|addr| fidl_fuchsia_net::Ipv4Address { addr: addr.octets() })
1130 .collect();
1131 fidl_fuchsia_net_dhcp::Option_::NetworkInformationServers(servers)
1132 }
1133}
1134
1135#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1137#[argh(subcommand, name = "network-time-protocol-servers")]
1138pub struct NetworkTimeProtocolServers {
1139 #[argh(option)]
1142 servers: Vec<Ipv4Addr>,
1143}
1144
1145impl Into<fidl_fuchsia_net_dhcp::Option_> for NetworkTimeProtocolServers {
1146 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
1147 let servers: Vec<fidl_fuchsia_net::Ipv4Address> = self
1148 .servers
1149 .iter()
1150 .map(|addr| fidl_fuchsia_net::Ipv4Address { addr: addr.octets() })
1151 .collect();
1152 fidl_fuchsia_net_dhcp::Option_::NetworkTimeProtocolServers(servers)
1153 }
1154}
1155
1156#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1158#[argh(subcommand, name = "vendor-specific-information")]
1159pub struct VendorSpecificInformation {
1160 #[argh(option)]
1162 data: Vec<u8>,
1163}
1164
1165impl Into<fidl_fuchsia_net_dhcp::Option_> for VendorSpecificInformation {
1166 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
1167 fidl_fuchsia_net_dhcp::Option_::VendorSpecificInformation(self.data)
1168 }
1169}
1170
1171#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1173#[argh(subcommand, name = "net-bios-over-tcpip-name-server")]
1174pub struct NetBiosOverTcpipNameServer {
1175 #[argh(option)]
1178 servers: Vec<Ipv4Addr>,
1179}
1180
1181impl Into<fidl_fuchsia_net_dhcp::Option_> for NetBiosOverTcpipNameServer {
1182 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
1183 let servers: Vec<fidl_fuchsia_net::Ipv4Address> = self
1184 .servers
1185 .iter()
1186 .map(|addr| fidl_fuchsia_net::Ipv4Address { addr: addr.octets() })
1187 .collect();
1188 fidl_fuchsia_net_dhcp::Option_::NetbiosOverTcpipNameServer(servers)
1189 }
1190}
1191
1192#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1194#[argh(subcommand, name = "net-bios-over-tcpip-distribution-server")]
1195pub struct NetBiosOverTcpipDatagramDistributionServer {
1196 #[argh(option)]
1199 servers: Vec<Ipv4Addr>,
1200}
1201
1202impl Into<fidl_fuchsia_net_dhcp::Option_> for NetBiosOverTcpipDatagramDistributionServer {
1203 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
1204 let servers: Vec<fidl_fuchsia_net::Ipv4Address> = self
1205 .servers
1206 .iter()
1207 .map(|addr| fidl_fuchsia_net::Ipv4Address { addr: addr.octets() })
1208 .collect();
1209 fidl_fuchsia_net_dhcp::Option_::NetbiosOverTcpipDatagramDistributionServer(servers)
1210 }
1211}
1212
1213#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1215#[argh(subcommand, name = "net-bios-over-tcpip-node-type")]
1216pub struct NetBiosOverTcpipNodeType {
1217 #[argh(subcommand)]
1219 node_type: Option<NodeType>,
1220}
1221
1222impl Into<fidl_fuchsia_net_dhcp::Option_> for NetBiosOverTcpipNodeType {
1223 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
1224 let node_type = self.node_type.unwrap_or(NodeType::BNode(BNode {}));
1225 let fidl_node_type = match node_type {
1226 NodeType::BNode(_) => fidl_fuchsia_net_dhcp::NodeTypes::B_NODE,
1227 NodeType::HNode(_) => fidl_fuchsia_net_dhcp::NodeTypes::H_NODE,
1228 NodeType::MNode(_) => fidl_fuchsia_net_dhcp::NodeTypes::M_NODE,
1229 NodeType::PNode(_) => fidl_fuchsia_net_dhcp::NodeTypes::P_NODE,
1230 };
1231 fidl_fuchsia_net_dhcp::Option_::NetbiosOverTcpipNodeType(fidl_node_type)
1232 }
1233}
1234
1235#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1237#[argh(subcommand, name = "net-bios-over-tcpip-scope")]
1238pub struct NetBiosOverTcpipScope {
1239 #[argh(option)]
1241 scope: Option<String>,
1242}
1243
1244impl Into<fidl_fuchsia_net_dhcp::Option_> for NetBiosOverTcpipScope {
1245 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
1246 let scope = self.scope.unwrap_or(String::new());
1247 fidl_fuchsia_net_dhcp::Option_::NetbiosOverTcpipScope(scope)
1248 }
1249}
1250
1251#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1253#[argh(subcommand, name = "x-window-system-font-server")]
1254pub struct XWindowSystemFontServer {
1255 #[argh(option)]
1258 servers: Vec<Ipv4Addr>,
1259}
1260
1261impl Into<fidl_fuchsia_net_dhcp::Option_> for XWindowSystemFontServer {
1262 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
1263 let servers: Vec<fidl_fuchsia_net::Ipv4Address> = self
1264 .servers
1265 .iter()
1266 .map(|addr| fidl_fuchsia_net::Ipv4Address { addr: addr.octets() })
1267 .collect();
1268 fidl_fuchsia_net_dhcp::Option_::XWindowSystemFontServer(servers)
1269 }
1270}
1271
1272#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1274#[argh(subcommand, name = "x-window-system-display-manager")]
1275pub struct XWindowSystemDisplayManager {
1276 #[argh(option)]
1279 display_servers: Vec<Ipv4Addr>,
1280}
1281
1282impl Into<fidl_fuchsia_net_dhcp::Option_> for XWindowSystemDisplayManager {
1283 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
1284 let display_servers: Vec<fidl_fuchsia_net::Ipv4Address> = self
1285 .display_servers
1286 .iter()
1287 .map(|addr| fidl_fuchsia_net::Ipv4Address { addr: addr.octets() })
1288 .collect();
1289 fidl_fuchsia_net_dhcp::Option_::XWindowSystemDisplayManager(display_servers)
1290 }
1291}
1292
1293#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1295#[argh(subcommand, name = "network-information-service-plus-domain")]
1296pub struct NetworkInformationServicePlusDomain {
1297 #[argh(option)]
1299 domain_name: Option<String>,
1300}
1301
1302impl Into<fidl_fuchsia_net_dhcp::Option_> for NetworkInformationServicePlusDomain {
1303 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
1304 let domain_name = self.domain_name.unwrap_or(String::new());
1305 fidl_fuchsia_net_dhcp::Option_::NetworkInformationServicePlusDomain(domain_name)
1306 }
1307}
1308
1309#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1311#[argh(subcommand, name = "network-information-service-plus-servers")]
1312pub struct NetworkInformationServicePlusServers {
1313 #[argh(option)]
1316 servers: Vec<Ipv4Addr>,
1317}
1318
1319impl Into<fidl_fuchsia_net_dhcp::Option_> for NetworkInformationServicePlusServers {
1320 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
1321 let servers: Vec<fidl_fuchsia_net::Ipv4Address> = self
1322 .servers
1323 .iter()
1324 .map(|addr| fidl_fuchsia_net::Ipv4Address { addr: addr.octets() })
1325 .collect();
1326 fidl_fuchsia_net_dhcp::Option_::NetworkInformationServicePlusServers(servers)
1327 }
1328}
1329
1330#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1332#[argh(subcommand, name = "mobile-ip-home-agent")]
1333pub struct MobileIpHomeAgent {
1334 #[argh(option)]
1337 home_agents: Vec<Ipv4Addr>,
1338}
1339
1340impl Into<fidl_fuchsia_net_dhcp::Option_> for MobileIpHomeAgent {
1341 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
1342 let home_agents: Vec<fidl_fuchsia_net::Ipv4Address> = self
1343 .home_agents
1344 .iter()
1345 .map(|addr| fidl_fuchsia_net::Ipv4Address { addr: addr.octets() })
1346 .collect();
1347 fidl_fuchsia_net_dhcp::Option_::MobileIpHomeAgent(home_agents)
1348 }
1349}
1350
1351#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1353#[argh(subcommand, name = "smtp-server")]
1354pub struct SmtpServer {
1355 #[argh(option)]
1358 smtp_servers: Vec<Ipv4Addr>,
1359}
1360
1361impl Into<fidl_fuchsia_net_dhcp::Option_> for SmtpServer {
1362 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
1363 let smtp_servers: Vec<fidl_fuchsia_net::Ipv4Address> = self
1364 .smtp_servers
1365 .iter()
1366 .map(|addr| fidl_fuchsia_net::Ipv4Address { addr: addr.octets() })
1367 .collect();
1368 fidl_fuchsia_net_dhcp::Option_::SmtpServer(smtp_servers)
1369 }
1370}
1371
1372#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1374#[argh(subcommand, name = "pop3-server")]
1375pub struct Pop3Server {
1376 #[argh(option)]
1379 pop3_servers: Vec<Ipv4Addr>,
1380}
1381
1382impl Into<fidl_fuchsia_net_dhcp::Option_> for Pop3Server {
1383 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
1384 let pop3_servers: Vec<fidl_fuchsia_net::Ipv4Address> = self
1385 .pop3_servers
1386 .iter()
1387 .map(|addr| fidl_fuchsia_net::Ipv4Address { addr: addr.octets() })
1388 .collect();
1389 fidl_fuchsia_net_dhcp::Option_::Pop3Server(pop3_servers)
1390 }
1391}
1392
1393#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1395#[argh(subcommand, name = "nntp-server")]
1396pub struct NntpServer {
1397 #[argh(option)]
1400 nntp_servers: Vec<Ipv4Addr>,
1401}
1402
1403impl Into<fidl_fuchsia_net_dhcp::Option_> for NntpServer {
1404 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
1405 let nntp_servers: Vec<fidl_fuchsia_net::Ipv4Address> = self
1406 .nntp_servers
1407 .iter()
1408 .map(|addr| fidl_fuchsia_net::Ipv4Address { addr: addr.octets() })
1409 .collect();
1410 fidl_fuchsia_net_dhcp::Option_::NntpServer(nntp_servers)
1411 }
1412}
1413
1414#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1416#[argh(subcommand, name = "default-www-server")]
1417pub struct DefaultWwwServer {
1418 #[argh(option)]
1421 www_servers: Vec<Ipv4Addr>,
1422}
1423
1424impl Into<fidl_fuchsia_net_dhcp::Option_> for DefaultWwwServer {
1425 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
1426 let www_servers: Vec<fidl_fuchsia_net::Ipv4Address> = self
1427 .www_servers
1428 .iter()
1429 .map(|addr| fidl_fuchsia_net::Ipv4Address { addr: addr.octets() })
1430 .collect();
1431 fidl_fuchsia_net_dhcp::Option_::DefaultWwwServer(www_servers)
1432 }
1433}
1434
1435#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1437#[argh(subcommand, name = "default-finger-server")]
1438pub struct DefaultFingerServer {
1439 #[argh(option)]
1442 finger_servers: Vec<Ipv4Addr>,
1443}
1444
1445impl Into<fidl_fuchsia_net_dhcp::Option_> for DefaultFingerServer {
1446 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
1447 let finger_servers: Vec<fidl_fuchsia_net::Ipv4Address> = self
1448 .finger_servers
1449 .iter()
1450 .map(|addr| fidl_fuchsia_net::Ipv4Address { addr: addr.octets() })
1451 .collect();
1452 fidl_fuchsia_net_dhcp::Option_::DefaultFingerServer(finger_servers)
1453 }
1454}
1455
1456#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1458#[argh(subcommand, name = "default-irc-server")]
1459pub struct DefaultIrcServer {
1460 #[argh(option)]
1463 irc_servers: Vec<Ipv4Addr>,
1464}
1465
1466impl Into<fidl_fuchsia_net_dhcp::Option_> for DefaultIrcServer {
1467 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
1468 let irc_servers: Vec<fidl_fuchsia_net::Ipv4Address> = self
1469 .irc_servers
1470 .iter()
1471 .map(|addr| fidl_fuchsia_net::Ipv4Address { addr: addr.octets() })
1472 .collect();
1473 fidl_fuchsia_net_dhcp::Option_::DefaultIrcServer(irc_servers)
1474 }
1475}
1476
1477#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1479#[argh(subcommand, name = "street-talk-server")]
1480pub struct StreettalkServer {
1481 #[argh(option)]
1484 streettalk_servers: Vec<Ipv4Addr>,
1485}
1486
1487impl Into<fidl_fuchsia_net_dhcp::Option_> for StreettalkServer {
1488 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
1489 let streettalk_servers: Vec<fidl_fuchsia_net::Ipv4Address> = self
1490 .streettalk_servers
1491 .iter()
1492 .map(|addr| fidl_fuchsia_net::Ipv4Address { addr: addr.octets() })
1493 .collect();
1494 fidl_fuchsia_net_dhcp::Option_::StreettalkServer(streettalk_servers)
1495 }
1496}
1497
1498#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1500#[argh(subcommand, name = "stda-server")]
1501pub struct StreettalkDirectoryAssistanceServer {
1502 #[argh(option)]
1505 stda_servers: Vec<Ipv4Addr>,
1506}
1507
1508impl Into<fidl_fuchsia_net_dhcp::Option_> for StreettalkDirectoryAssistanceServer {
1509 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
1510 let stda_servers: Vec<fidl_fuchsia_net::Ipv4Address> = self
1511 .stda_servers
1512 .iter()
1513 .map(|addr| fidl_fuchsia_net::Ipv4Address { addr: addr.octets() })
1514 .collect();
1515 fidl_fuchsia_net_dhcp::Option_::StreettalkDirectoryAssistanceServer(stda_servers)
1516 }
1517}
1518
1519#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1521#[argh(subcommand, name = "tftp-server-name")]
1522pub struct TftpServerName {
1523 #[argh(option)]
1526 name: Option<String>,
1527}
1528
1529impl Into<fidl_fuchsia_net_dhcp::Option_> for TftpServerName {
1530 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
1531 let name = self.name.unwrap_or(String::new());
1532 fidl_fuchsia_net_dhcp::Option_::TftpServerName(name)
1533 }
1534}
1535
1536#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1538#[argh(subcommand, name = "bootfile-name")]
1539pub struct BootfileName {
1540 #[argh(option)]
1543 name: Option<String>,
1544}
1545
1546impl Into<fidl_fuchsia_net_dhcp::Option_> for BootfileName {
1547 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
1548 let name = self.name.unwrap_or(String::new());
1549 fidl_fuchsia_net_dhcp::Option_::BootfileName(name)
1550 }
1551}
1552
1553#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1555#[argh(subcommand, name = "max-message-size")]
1556pub struct MaxDhcpMessageSize {
1557 #[argh(option)]
1560 length: Option<u16>,
1561}
1562
1563impl Into<fidl_fuchsia_net_dhcp::Option_> for MaxDhcpMessageSize {
1564 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
1565 let length = self.length.unwrap_or(0);
1566 fidl_fuchsia_net_dhcp::Option_::MaxDhcpMessageSize(length)
1567 }
1568}
1569
1570#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1572#[argh(subcommand, name = "renewal-time-value")]
1573pub struct RenewalTimeValue {
1574 #[argh(option)]
1577 interval: Option<u32>,
1578}
1579
1580impl Into<fidl_fuchsia_net_dhcp::Option_> for RenewalTimeValue {
1581 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
1582 let interval = self.interval.unwrap_or(0);
1583 fidl_fuchsia_net_dhcp::Option_::RenewalTimeValue(interval)
1584 }
1585}
1586
1587#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1589#[argh(subcommand, name = "rebinding-time-value")]
1590pub struct RebindingTimeValue {
1591 #[argh(option)]
1594 interval: Option<u32>,
1595}
1596
1597impl Into<fidl_fuchsia_net_dhcp::Option_> for RebindingTimeValue {
1598 fn into(self) -> fidl_fuchsia_net_dhcp::Option_ {
1599 let interval = self.interval.unwrap_or(0);
1600 fidl_fuchsia_net_dhcp::Option_::RebindingTimeValue(interval)
1601 }
1602}
1603
1604#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1606#[argh(subcommand)]
1607pub enum Parameter {
1608 IpAddrs(IpAddrs),
1609 AddressPool(AddressPool),
1610 LeaseLength(LeaseLength),
1611 PermittedMacs(PermittedMacs),
1612 StaticallyAssignedAddrs(StaticallyAssignedAddrs),
1613 ArpProbe(ArpProbe),
1614 BoundDevices(BoundDevices),
1615}
1616
1617impl Into<fidl_fuchsia_net_dhcp::ParameterName> for Parameter {
1618 fn into(self) -> fidl_fuchsia_net_dhcp::ParameterName {
1619 match self {
1620 Parameter::IpAddrs(_) => fidl_fuchsia_net_dhcp::ParameterName::IpAddrs,
1621 Parameter::AddressPool(_) => fidl_fuchsia_net_dhcp::ParameterName::AddressPool,
1622 Parameter::LeaseLength(_) => fidl_fuchsia_net_dhcp::ParameterName::LeaseLength,
1623 Parameter::PermittedMacs(_) => fidl_fuchsia_net_dhcp::ParameterName::PermittedMacs,
1624 Parameter::StaticallyAssignedAddrs(_) => {
1625 fidl_fuchsia_net_dhcp::ParameterName::StaticallyAssignedAddrs
1626 }
1627 Parameter::ArpProbe(_) => fidl_fuchsia_net_dhcp::ParameterName::ArpProbe,
1628 Parameter::BoundDevices(_) => fidl_fuchsia_net_dhcp::ParameterName::BoundDeviceNames,
1629 }
1630 }
1631}
1632
1633impl Into<fidl_fuchsia_net_dhcp::Parameter> for Parameter {
1634 fn into(self) -> fidl_fuchsia_net_dhcp::Parameter {
1635 match self {
1636 Parameter::IpAddrs(v) => v.into(),
1637 Parameter::AddressPool(v) => v.into(),
1638 Parameter::LeaseLength(v) => v.into(),
1639 Parameter::PermittedMacs(v) => v.into(),
1640 Parameter::StaticallyAssignedAddrs(v) => v.into(),
1641 Parameter::ArpProbe(v) => v.into(),
1642 Parameter::BoundDevices(v) => v.into(),
1643 }
1644 }
1645}
1646
1647#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1649#[argh(subcommand, name = "ip-addrs")]
1650pub struct IpAddrs {
1651 #[argh(option)]
1653 addrs: Vec<Ipv4Addr>,
1654}
1655
1656impl Into<fidl_fuchsia_net_dhcp::Parameter> for IpAddrs {
1657 fn into(self) -> fidl_fuchsia_net_dhcp::Parameter {
1658 let addrs: Vec<fidl_fuchsia_net::Ipv4Address> = self
1659 .addrs
1660 .iter()
1661 .map(|addr| fidl_fuchsia_net::Ipv4Address { addr: addr.octets() })
1662 .collect();
1663 fidl_fuchsia_net_dhcp::Parameter::IpAddrs(addrs)
1664 }
1665}
1666
1667use crate::opts::parse_netmask_or_prefix_length;
1668
1669#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1671#[argh(subcommand, name = "address-pool")]
1672pub struct AddressPool {
1673 #[argh(option, from_str_fn(parse_netmask_or_prefix_length))]
1675 prefix_length: Option<u8>,
1676 #[argh(option)]
1679 range_start: Option<Ipv4Addr>,
1680 #[argh(option)]
1683 range_stop: Option<Ipv4Addr>,
1684}
1685
1686impl Into<fidl_fuchsia_net_dhcp::Parameter> for AddressPool {
1687 fn into(self) -> fidl_fuchsia_net_dhcp::Parameter {
1688 let Self { prefix_length, range_start, range_stop } = self;
1689 let pool = fidl_fuchsia_net_dhcp::AddressPool {
1690 prefix_length,
1691 range_start: range_start.map(|v| fidl_fuchsia_net::Ipv4Address { addr: v.octets() }),
1692 range_stop: range_stop.map(|v| fidl_fuchsia_net::Ipv4Address { addr: v.octets() }),
1693 ..Default::default()
1694 };
1695 fidl_fuchsia_net_dhcp::Parameter::AddressPool(pool)
1696 }
1697}
1698
1699#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1701#[argh(subcommand, name = "permitted-macs")]
1702pub struct PermittedMacs {
1703 #[argh(option)]
1708 macs: Vec<MacAddr>,
1709}
1710
1711impl Into<fidl_fuchsia_net_dhcp::Parameter> for PermittedMacs {
1712 fn into(self) -> fidl_fuchsia_net_dhcp::Parameter {
1713 let addrs: Vec<fidl_fuchsia_net::MacAddress> =
1714 self.macs.into_iter().map(fidl_fuchsia_net_ext::MacAddress::into).collect();
1715 fidl_fuchsia_net_dhcp::Parameter::PermittedMacs(addrs)
1716 }
1717}
1718
1719#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1723#[argh(subcommand, name = "statically-assigned-addrs")]
1724pub struct StaticallyAssignedAddrs {
1725 #[argh(option)]
1727 hosts: Vec<MacAddr>,
1728 #[argh(option)]
1732 assigned_addrs: Vec<Ipv4Addr>,
1733}
1734
1735impl Into<fidl_fuchsia_net_dhcp::Parameter> for StaticallyAssignedAddrs {
1736 fn into(self) -> fidl_fuchsia_net_dhcp::Parameter {
1737 let assignments: Vec<fidl_fuchsia_net_dhcp::StaticAssignment> = self
1738 .hosts
1739 .into_iter()
1740 .zip(self.assigned_addrs)
1741 .map(|(host, addr)| {
1742 (host.into(), fidl_fuchsia_net::Ipv4Address { addr: addr.octets() })
1743 })
1744 .map(|(host, assigned_addr)| fidl_fuchsia_net_dhcp::StaticAssignment {
1745 host: Some(host),
1746 assigned_addr: Some(assigned_addr),
1747 ..Default::default()
1748 })
1749 .collect();
1750 fidl_fuchsia_net_dhcp::Parameter::StaticallyAssignedAddrs(assignments)
1751 }
1752}
1753
1754#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1757#[argh(subcommand, name = "arp-probe")]
1758pub struct ArpProbe {
1759 #[argh(switch)]
1764 enabled: bool,
1765}
1766
1767impl Into<fidl_fuchsia_net_dhcp::Parameter> for ArpProbe {
1768 fn into(self) -> fidl_fuchsia_net_dhcp::Parameter {
1769 fidl_fuchsia_net_dhcp::Parameter::ArpProbe(self.enabled)
1770 }
1771}
1772
1773#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1775#[argh(subcommand, name = "lease-length")]
1776pub struct LeaseLength {
1777 #[argh(option)]
1780 pub(crate) default: Option<u32>,
1781 #[argh(option)]
1786 pub(crate) max: Option<u32>,
1787}
1788
1789impl Into<fidl_fuchsia_net_dhcp::Parameter> for LeaseLength {
1790 fn into(self) -> fidl_fuchsia_net_dhcp::Parameter {
1791 fidl_fuchsia_net_dhcp::Parameter::Lease(fidl_fuchsia_net_dhcp::LeaseLength {
1792 default: self.default,
1793 max: self.max,
1794 ..Default::default()
1795 })
1796 }
1797}
1798
1799#[derive(Clone, Copy, Debug, ArgsInfo, FromArgs, PartialEq)]
1801#[argh(subcommand)]
1802pub enum NodeType {
1803 BNode(BNode),
1804 PNode(PNode),
1805 MNode(MNode),
1806 HNode(HNode),
1807}
1808
1809#[derive(Clone, Copy, Debug, ArgsInfo, FromArgs, PartialEq)]
1811#[argh(subcommand, name = "b-node")]
1812pub struct BNode {}
1813
1814#[derive(Clone, Copy, Debug, ArgsInfo, FromArgs, PartialEq)]
1816#[argh(subcommand, name = "p-node")]
1817pub struct PNode {}
1818
1819#[derive(Clone, Copy, Debug, ArgsInfo, FromArgs, PartialEq)]
1821#[argh(subcommand, name = "m-node")]
1822pub struct MNode {}
1823
1824#[derive(Clone, Copy, Debug, ArgsInfo, FromArgs, PartialEq)]
1826#[argh(subcommand, name = "h-node")]
1827pub struct HNode {}
1828
1829#[derive(Clone, Debug, ArgsInfo, FromArgs, PartialEq)]
1831#[argh(subcommand, name = "bound-device-names")]
1832pub struct BoundDevices {
1833 #[argh(positional)]
1840 pub names: Vec<String>,
1841}
1842
1843impl Into<fidl_fuchsia_net_dhcp::Parameter> for BoundDevices {
1844 fn into(self) -> fidl_fuchsia_net_dhcp::Parameter {
1845 fidl_fuchsia_net_dhcp::Parameter::BoundDeviceNames(self.names)
1846 }
1847}