@@ -3,12 +3,12 @@ use core::task::Waker;
3
3
4
4
use crate :: iface:: Context ;
5
5
use crate :: time:: { Duration , Instant } ;
6
- use crate :: wire:: dhcpv4:: { field as dhcpv4_field, DhcpOptionsBuffer } ;
7
- use crate :: wire:: HardwareAddress ;
6
+ use crate :: wire:: dhcpv4:: field as dhcpv4_field;
8
7
use crate :: wire:: {
9
8
DhcpMessageType , DhcpPacket , DhcpRepr , IpAddress , IpProtocol , Ipv4Address , Ipv4Cidr , Ipv4Repr ,
10
9
UdpRepr , DHCP_CLIENT_PORT , DHCP_MAX_DNS_SERVER_COUNT , DHCP_SERVER_PORT , UDP_HEADER_LEN ,
11
10
} ;
11
+ use crate :: wire:: { DhcpOption , HardwareAddress } ;
12
12
13
13
#[ cfg( feature = "async" ) ]
14
14
use super :: WakerRegistration ;
@@ -150,7 +150,7 @@ pub struct Socket<'a> {
150
150
151
151
/// A buffer contains options additional to be added to outgoing DHCP
152
152
/// packets.
153
- outgoing_options : Option < DhcpOptionsBuffer < & ' a [ u8 ] > > ,
153
+ outgoing_options : & ' a [ DhcpOption < ' a > ] ,
154
154
/// A buffer containing all requested parameters.
155
155
parameter_request_list : Option < & ' a [ u8 ] > ,
156
156
@@ -180,7 +180,7 @@ impl<'a> Socket<'a> {
180
180
max_lease_duration : None ,
181
181
retry_config : RetryConfig :: default ( ) ,
182
182
ignore_naks : false ,
183
- outgoing_options : None ,
183
+ outgoing_options : & [ ] ,
184
184
parameter_request_list : None ,
185
185
receive_packet_buffer : None ,
186
186
#[ cfg( feature = "async" ) ]
@@ -193,9 +193,9 @@ impl<'a> Socket<'a> {
193
193
self . retry_config = config;
194
194
}
195
195
196
- /// Set the outgoing options buffer .
197
- pub fn set_outgoing_options_buffer ( & mut self , options_buffer : DhcpOptionsBuffer < & ' a [ u8 ] > ) {
198
- self . outgoing_options = Some ( options_buffer ) ;
196
+ /// Set the outgoing options.
197
+ pub fn set_outgoing_options ( & mut self , options : & ' a [ DhcpOption < ' a > ] ) {
198
+ self . outgoing_options = options ;
199
199
}
200
200
201
201
/// Set the buffer into which incoming DHCP packets are copied into.
@@ -841,7 +841,7 @@ mod test {
841
841
dns_servers : None ,
842
842
max_size : None ,
843
843
lease_duration : None ,
844
- additional_options : None ,
844
+ additional_options : & [ ] ,
845
845
} ;
846
846
847
847
const DHCP_DISCOVER : DhcpRepr = DhcpRepr {
0 commit comments