aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben De Smet <[email protected]>2023-06-07 12:04:15 +0200
committerRuben De Smet <[email protected]>2023-06-07 13:18:19 +0200
commit352f0b6c3823797576c36f417d6be40189bca5d5 (patch)
tree4dc2111b5c797883756fd55329b6af1f02c1d1d5
parentca47af6978e85012ff70a98726fcb63ed985109d (diff)
net: Support dual stackĀ IP
-rw-r--r--embassy-net/src/lib.rs75
-rw-r--r--examples/nrf52840/src/bin/usb_ethernet.rs6
-rw-r--r--examples/rp/src/bin/ethernet_w5500_multisocket.rs2
-rw-r--r--examples/rp/src/bin/ethernet_w5500_tcp_client.rs2
-rw-r--r--examples/rp/src/bin/ethernet_w5500_tcp_server.rs2
-rw-r--r--examples/rp/src/bin/ethernet_w5500_udp.rs2
-rw-r--r--examples/rp/src/bin/usb_ethernet.rs4
-rw-r--r--examples/rp/src/bin/wifi_ap_tcp_server.rs2
-rw-r--r--examples/rp/src/bin/wifi_tcp_server.rs4
-rw-r--r--examples/std/src/bin/net.rs4
-rw-r--r--examples/std/src/bin/net_dns.rs4
-rw-r--r--examples/std/src/bin/net_udp.rs4
-rw-r--r--examples/std/src/bin/tcp_accept.rs4
-rw-r--r--examples/stm32f4/src/bin/usb_ethernet.rs4
-rw-r--r--examples/stm32f7/src/bin/eth.rs4
-rw-r--r--examples/stm32h5/src/bin/eth.rs4
-rw-r--r--examples/stm32h7/src/bin/eth.rs4
-rw-r--r--examples/stm32h7/src/bin/eth_client.rs4
-rw-r--r--examples/stm32l5/src/bin/usb_ethernet.rs4
19 files changed, 94 insertions, 45 deletions
diff --git a/embassy-net/src/lib.rs b/embassy-net/src/lib.rs
index 4cc191d44..cf7ebad3f 100644
--- a/embassy-net/src/lib.rs
+++ b/embassy-net/src/lib.rs
@@ -127,16 +127,61 @@ impl Default for DhcpConfig {
127} 127}
128 128
129/// Network stack configuration. 129/// Network stack configuration.
130pub enum Config { 130pub struct Config {
131 /// Use a static IPv4 address configuration.
132 #[cfg(feature = "proto-ipv4")] 131 #[cfg(feature = "proto-ipv4")]
133 StaticV4(StaticConfigV4), 132 pub ipv4: ConfigV4,
134 /// Use a static IPv6 address configuration.
135 #[cfg(feature = "proto-ipv6")] 133 #[cfg(feature = "proto-ipv6")]
136 StaticV6(StaticConfigV6), 134 pub ipv6: ConfigV6,
135}
136
137impl Config {
138 #[cfg(feature = "proto-ipv4")]
139 pub fn ipv4_static(config: StaticConfigV4) -> Self {
140 Self {
141 ipv4: ConfigV4::Static(config),
142 #[cfg(feature = "proto-ipv6")]
143 ipv6: ConfigV6::None,
144 }
145 }
146
147 #[cfg(feature = "proto-ipv6")]
148 pub fn ipv6_static(config: StaticConfigV6) -> Self {
149 Self {
150 #[cfg(feature = "proto-ipv4")]
151 ipv4: ConfigV4::None,
152 ipv6: ConfigV6::Static(config),
153 }
154 }
155
156 #[cfg(feature = "dhcpv4")]
157 pub fn dhcpv4(config: DhcpConfig) -> Self {
158 Self {
159 ipv4: ConfigV4::Dhcp(config),
160 #[cfg(feature = "proto-ipv6")]
161 ipv6: ConfigV6::None,
162 }
163 }
164}
165
166/// Network stack IPv4 configuration.
167#[cfg(feature = "proto-ipv4")]
168pub enum ConfigV4 {
169 /// Use a static IPv4 address configuration.
170 Static(StaticConfigV4),
137 /// Use DHCP to obtain an IP address configuration. 171 /// Use DHCP to obtain an IP address configuration.
138 #[cfg(feature = "dhcpv4")] 172 #[cfg(feature = "dhcpv4")]
139 Dhcp(DhcpConfig), 173 Dhcp(DhcpConfig),
174 /// Do not configure IPv6.
175 None,
176}
177
178/// Network stack IPv6 configuration.
179#[cfg(feature = "proto-ipv6")]
180pub enum ConfigV6 {
181 /// Use a static IPv6 address configuration.
182 Static(StaticConfigV6),
183 /// Do not configure IPv6.
184 None,
140} 185}
141 186
142/// A network stack. 187/// A network stack.
@@ -224,22 +269,26 @@ impl<D: Driver + 'static> Stack<D> {
224 dns_waker: WakerRegistration::new(), 269 dns_waker: WakerRegistration::new(),
225 }; 270 };
226 271
227 match config { 272 #[cfg(feature = "proto-ipv4")]
228 #[cfg(feature = "proto-ipv4")] 273 match config.ipv4 {
229 Config::StaticV4(config) => { 274 ConfigV4::Static(config) => {
230 inner.apply_config_v4(&mut socket, config); 275 inner.apply_config_v4(&mut socket, config);
231 } 276 }
232 #[cfg(feature = "proto-ipv6")]
233 Config::StaticV6(config) => {
234 inner.apply_config_v6(&mut socket, config);
235 }
236 #[cfg(feature = "dhcpv4")] 277 #[cfg(feature = "dhcpv4")]
237 Config::Dhcp(config) => { 278 ConfigV4::Dhcp(config) => {
238 let mut dhcp_socket = smoltcp::socket::dhcpv4::Socket::new(); 279 let mut dhcp_socket = smoltcp::socket::dhcpv4::Socket::new();
239 inner.apply_dhcp_config(&mut dhcp_socket, config); 280 inner.apply_dhcp_config(&mut dhcp_socket, config);
240 let handle = socket.sockets.add(dhcp_socket); 281 let handle = socket.sockets.add(dhcp_socket);
241 inner.dhcp_socket = Some(handle); 282 inner.dhcp_socket = Some(handle);
242 } 283 }
284 ConfigV4::None => {}
285 }
286 #[cfg(feature = "proto-ipv6")]
287 match config.ipv6 {
288 ConfigV6::Static(config) => {
289 inner.apply_config_v6(&mut socket, config);
290 }
291 ConfigV6::None => {}
243 } 292 }
244 293
245 Self { 294 Self {
diff --git a/examples/nrf52840/src/bin/usb_ethernet.rs b/examples/nrf52840/src/bin/usb_ethernet.rs
index b4316f5a4..f527c0d7f 100644
--- a/examples/nrf52840/src/bin/usb_ethernet.rs
+++ b/examples/nrf52840/src/bin/usb_ethernet.rs
@@ -97,12 +97,12 @@ async fn main(spawner: Spawner) {
97 let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(make_static!(NetState::new()), our_mac_addr); 97 let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(make_static!(NetState::new()), our_mac_addr);
98 unwrap!(spawner.spawn(usb_ncm_task(runner))); 98 unwrap!(spawner.spawn(usb_ncm_task(runner)));
99 99
100 let config = embassy_net::Config::Dhcp(Default::default()); 100 let config = embassy_net::Config::dhcpv4(Default::default());
101 //let config = embassy_net::Config::StaticV4(embassy_net::StaticConfigV4 { 101 // let config = embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 {
102 // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), 102 // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24),
103 // dns_servers: Vec::new(), 103 // dns_servers: Vec::new(),
104 // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), 104 // gateway: Some(Ipv4Address::new(10, 42, 0, 1)),
105 //}); 105 // });
106 106
107 // Generate random seed 107 // Generate random seed
108 let mut rng = Rng::new(p.RNG, Irqs); 108 let mut rng = Rng::new(p.RNG, Irqs);
diff --git a/examples/rp/src/bin/ethernet_w5500_multisocket.rs b/examples/rp/src/bin/ethernet_w5500_multisocket.rs
index 066ecf2bc..82568254a 100644
--- a/examples/rp/src/bin/ethernet_w5500_multisocket.rs
+++ b/examples/rp/src/bin/ethernet_w5500_multisocket.rs
@@ -64,7 +64,7 @@ async fn main(spawner: Spawner) {
64 // Init network stack 64 // Init network stack
65 let stack = &*make_static!(Stack::new( 65 let stack = &*make_static!(Stack::new(
66 device, 66 device,
67 embassy_net::Config::Dhcp(Default::default()), 67 embassy_net::Config::dhcpv4(Default::default()),
68 make_static!(StackResources::<3>::new()), 68 make_static!(StackResources::<3>::new()),
69 seed 69 seed
70 )); 70 ));
diff --git a/examples/rp/src/bin/ethernet_w5500_tcp_client.rs b/examples/rp/src/bin/ethernet_w5500_tcp_client.rs
index 3e0f5d136..d562defad 100644
--- a/examples/rp/src/bin/ethernet_w5500_tcp_client.rs
+++ b/examples/rp/src/bin/ethernet_w5500_tcp_client.rs
@@ -67,7 +67,7 @@ async fn main(spawner: Spawner) {
67 // Init network stack 67 // Init network stack
68 let stack = &*make_static!(Stack::new( 68 let stack = &*make_static!(Stack::new(
69 device, 69 device,
70 embassy_net::Config::Dhcp(Default::default()), 70 embassy_net::Config::dhcpv4(Default::default()),
71 make_static!(StackResources::<2>::new()), 71 make_static!(StackResources::<2>::new()),
72 seed 72 seed
73 )); 73 ));
diff --git a/examples/rp/src/bin/ethernet_w5500_tcp_server.rs b/examples/rp/src/bin/ethernet_w5500_tcp_server.rs
index db178d49d..7f521cdb4 100644
--- a/examples/rp/src/bin/ethernet_w5500_tcp_server.rs
+++ b/examples/rp/src/bin/ethernet_w5500_tcp_server.rs
@@ -65,7 +65,7 @@ async fn main(spawner: Spawner) {
65 // Init network stack 65 // Init network stack
66 let stack = &*make_static!(Stack::new( 66 let stack = &*make_static!(Stack::new(
67 device, 67 device,
68 embassy_net::Config::Dhcp(Default::default()), 68 embassy_net::Config::dhcpv4(Default::default()),
69 make_static!(StackResources::<2>::new()), 69 make_static!(StackResources::<2>::new()),
70 seed 70 seed
71 )); 71 ));
diff --git a/examples/rp/src/bin/ethernet_w5500_udp.rs b/examples/rp/src/bin/ethernet_w5500_udp.rs
index 21943c3c6..ada86ae55 100644
--- a/examples/rp/src/bin/ethernet_w5500_udp.rs
+++ b/examples/rp/src/bin/ethernet_w5500_udp.rs
@@ -62,7 +62,7 @@ async fn main(spawner: Spawner) {
62 // Init network stack 62 // Init network stack
63 let stack = &*make_static!(Stack::new( 63 let stack = &*make_static!(Stack::new(
64 device, 64 device,
65 embassy_net::Config::Dhcp(Default::default()), 65 embassy_net::Config::dhcpv4(Default::default()),
66 make_static!(StackResources::<2>::new()), 66 make_static!(StackResources::<2>::new()),
67 seed 67 seed
68 )); 68 ));
diff --git a/examples/rp/src/bin/usb_ethernet.rs b/examples/rp/src/bin/usb_ethernet.rs
index d33d9c72e..91d1ec8e7 100644
--- a/examples/rp/src/bin/usb_ethernet.rs
+++ b/examples/rp/src/bin/usb_ethernet.rs
@@ -86,8 +86,8 @@ async fn main(spawner: Spawner) {
86 let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(make_static!(NetState::new()), our_mac_addr); 86 let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(make_static!(NetState::new()), our_mac_addr);
87 unwrap!(spawner.spawn(usb_ncm_task(runner))); 87 unwrap!(spawner.spawn(usb_ncm_task(runner)));
88 88
89 let config = embassy_net::Config::Dhcp(Default::default()); 89 let config = embassy_net::Config::dhcpv4(Default::default());
90 //let config = embassy_net::Config::StaticV4(embassy_net::StaticConfigV4 { 90 //let config = embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 {
91 // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), 91 // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24),
92 // dns_servers: Vec::new(), 92 // dns_servers: Vec::new(),
93 // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), 93 // gateway: Some(Ipv4Address::new(10, 42, 0, 1)),
diff --git a/examples/rp/src/bin/wifi_ap_tcp_server.rs b/examples/rp/src/bin/wifi_ap_tcp_server.rs
index 970cf4b32..e8197390c 100644
--- a/examples/rp/src/bin/wifi_ap_tcp_server.rs
+++ b/examples/rp/src/bin/wifi_ap_tcp_server.rs
@@ -62,7 +62,7 @@ async fn main(spawner: Spawner) {
62 .await; 62 .await;
63 63
64 // Use a link-local address for communication without DHCP server 64 // Use a link-local address for communication without DHCP server
65 let config = Config::StaticV4(embassy_net::StaticConfigV4 { 65 let config = Config::ipv4_static(embassy_net::StaticConfigV4 {
66 address: embassy_net::Ipv4Cidr::new(embassy_net::Ipv4Address::new(169, 254, 1, 1), 16), 66 address: embassy_net::Ipv4Cidr::new(embassy_net::Ipv4Address::new(169, 254, 1, 1), 16),
67 dns_servers: heapless::Vec::new(), 67 dns_servers: heapless::Vec::new(),
68 gateway: None, 68 gateway: None,
diff --git a/examples/rp/src/bin/wifi_tcp_server.rs b/examples/rp/src/bin/wifi_tcp_server.rs
index 9f95f8b03..026e056fa 100644
--- a/examples/rp/src/bin/wifi_tcp_server.rs
+++ b/examples/rp/src/bin/wifi_tcp_server.rs
@@ -61,8 +61,8 @@ async fn main(spawner: Spawner) {
61 .set_power_management(cyw43::PowerManagementMode::PowerSave) 61 .set_power_management(cyw43::PowerManagementMode::PowerSave)
62 .await; 62 .await;
63 63
64 let config = Config::Dhcp(Default::default()); 64 let config = Config::dhcpv4(Default::default());
65 //let config = embassy_net::Config::StaticV4(embassy_net::Config { 65 //let config = embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 {
66 // address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 2), 24), 66 // address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 2), 24),
67 // dns_servers: Vec::new(), 67 // dns_servers: Vec::new(),
68 // gateway: Some(Ipv4Address::new(192, 168, 69, 1)), 68 // gateway: Some(Ipv4Address::new(192, 168, 69, 1)),
diff --git a/examples/std/src/bin/net.rs b/examples/std/src/bin/net.rs
index 14cf3f25b..3aadb029d 100644
--- a/examples/std/src/bin/net.rs
+++ b/examples/std/src/bin/net.rs
@@ -42,13 +42,13 @@ async fn main_task(spawner: Spawner) {
42 42
43 // Choose between dhcp or static ip 43 // Choose between dhcp or static ip
44 let config = if opts.static_ip { 44 let config = if opts.static_ip {
45 Config::StaticV4(embassy_net::StaticConfigV4 { 45 Config::ipv4_static(embassy_net::StaticConfigV4 {
46 address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 2), 24), 46 address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 2), 24),
47 dns_servers: Vec::new(), 47 dns_servers: Vec::new(),
48 gateway: Some(Ipv4Address::new(192, 168, 69, 1)), 48 gateway: Some(Ipv4Address::new(192, 168, 69, 1)),
49 }) 49 })
50 } else { 50 } else {
51 Config::Dhcp(Default::default()) 51 Config::dhcpv4(Default::default())
52 }; 52 };
53 53
54 // Generate random seed 54 // Generate random seed
diff --git a/examples/std/src/bin/net_dns.rs b/examples/std/src/bin/net_dns.rs
index 0a479a744..65b5a2cd9 100644
--- a/examples/std/src/bin/net_dns.rs
+++ b/examples/std/src/bin/net_dns.rs
@@ -40,14 +40,14 @@ async fn main_task(spawner: Spawner) {
40 40
41 // Choose between dhcp or static ip 41 // Choose between dhcp or static ip
42 let config = if opts.static_ip { 42 let config = if opts.static_ip {
43 Config::StaticV4(embassy_net::StaticConfigV4 { 43 Config::ipv4_static(embassy_net::StaticConfigV4 {
44 address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 1), 24), 44 address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 1), 24),
45 dns_servers: Vec::from_slice(&[Ipv4Address::new(8, 8, 4, 4).into(), Ipv4Address::new(8, 8, 8, 8).into()]) 45 dns_servers: Vec::from_slice(&[Ipv4Address::new(8, 8, 4, 4).into(), Ipv4Address::new(8, 8, 8, 8).into()])
46 .unwrap(), 46 .unwrap(),
47 gateway: Some(Ipv4Address::new(192, 168, 69, 100)), 47 gateway: Some(Ipv4Address::new(192, 168, 69, 100)),
48 }) 48 })
49 } else { 49 } else {
50 Config::Dhcp(Default::default()) 50 Config::dhcpv4(Default::default())
51 }; 51 };
52 52
53 // Generate random seed 53 // Generate random seed
diff --git a/examples/std/src/bin/net_udp.rs b/examples/std/src/bin/net_udp.rs
index 0ede5d998..3fc46156c 100644
--- a/examples/std/src/bin/net_udp.rs
+++ b/examples/std/src/bin/net_udp.rs
@@ -38,13 +38,13 @@ async fn main_task(spawner: Spawner) {
38 38
39 // Choose between dhcp or static ip 39 // Choose between dhcp or static ip
40 let config = if opts.static_ip { 40 let config = if opts.static_ip {
41 Config::StaticV4(embassy_net::StaticConfigV4 { 41 Config::ipv4_static(embassy_net::StaticConfigV4 {
42 address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 2), 24), 42 address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 2), 24),
43 dns_servers: Vec::new(), 43 dns_servers: Vec::new(),
44 gateway: Some(Ipv4Address::new(192, 168, 69, 1)), 44 gateway: Some(Ipv4Address::new(192, 168, 69, 1)),
45 }) 45 })
46 } else { 46 } else {
47 Config::Dhcp(Default::default()) 47 Config::dhcpv4(Default::default())
48 }; 48 };
49 49
50 // Generate random seed 50 // Generate random seed
diff --git a/examples/std/src/bin/tcp_accept.rs b/examples/std/src/bin/tcp_accept.rs
index 4379d0439..df09986ac 100644
--- a/examples/std/src/bin/tcp_accept.rs
+++ b/examples/std/src/bin/tcp_accept.rs
@@ -53,13 +53,13 @@ async fn main_task(spawner: Spawner) {
53 53
54 // Choose between dhcp or static ip 54 // Choose between dhcp or static ip
55 let config = if opts.static_ip { 55 let config = if opts.static_ip {
56 Config::StaticV4(embassy_net::StaticConfigV4 { 56 Config::ipv4_static(embassy_net::StaticConfigV4 {
57 address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 2), 24), 57 address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 69, 2), 24),
58 dns_servers: Vec::new(), 58 dns_servers: Vec::new(),
59 gateway: Some(Ipv4Address::new(192, 168, 69, 1)), 59 gateway: Some(Ipv4Address::new(192, 168, 69, 1)),
60 }) 60 })
61 } else { 61 } else {
62 Config::Dhcp(Default::default()) 62 Config::dhcpv4(Default::default())
63 }; 63 };
64 64
65 // Generate random seed 65 // Generate random seed
diff --git a/examples/stm32f4/src/bin/usb_ethernet.rs b/examples/stm32f4/src/bin/usb_ethernet.rs
index 0856b4842..953d99a45 100644
--- a/examples/stm32f4/src/bin/usb_ethernet.rs
+++ b/examples/stm32f4/src/bin/usb_ethernet.rs
@@ -94,8 +94,8 @@ async fn main(spawner: Spawner) {
94 let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(make_static!(NetState::new()), our_mac_addr); 94 let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(make_static!(NetState::new()), our_mac_addr);
95 unwrap!(spawner.spawn(usb_ncm_task(runner))); 95 unwrap!(spawner.spawn(usb_ncm_task(runner)));
96 96
97 let config = embassy_net::Config::Dhcp(Default::default()); 97 let config = embassy_net::Config::dhcpv4(Default::default());
98 //let config = embassy_net::Config::StaticV4(embassy_net::StaticConfigV4 { 98 //let config = embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 {
99 // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), 99 // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24),
100 // dns_servers: Vec::new(), 100 // dns_servers: Vec::new(),
101 // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), 101 // gateway: Some(Ipv4Address::new(10, 42, 0, 1)),
diff --git a/examples/stm32f7/src/bin/eth.rs b/examples/stm32f7/src/bin/eth.rs
index ebdf0d8a0..fde6a7576 100644
--- a/examples/stm32f7/src/bin/eth.rs
+++ b/examples/stm32f7/src/bin/eth.rs
@@ -62,8 +62,8 @@ async fn main(spawner: Spawner) -> ! {
62 0, 62 0,
63 ); 63 );
64 64
65 let config = embassy_net::Config::Dhcp(Default::default()); 65 let config = embassy_net::Config::dhcpv4(Default::default());
66 //let config = embassy_net::Config::StaticV4(embassy_net::StaticConfigV4 { 66 //let config = embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 {
67 // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), 67 // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24),
68 // dns_servers: Vec::new(), 68 // dns_servers: Vec::new(),
69 // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), 69 // gateway: Some(Ipv4Address::new(10, 42, 0, 1)),
diff --git a/examples/stm32h5/src/bin/eth.rs b/examples/stm32h5/src/bin/eth.rs
index 811f74c88..78c8282a6 100644
--- a/examples/stm32h5/src/bin/eth.rs
+++ b/examples/stm32h5/src/bin/eth.rs
@@ -81,8 +81,8 @@ async fn main(spawner: Spawner) -> ! {
81 0, 81 0,
82 ); 82 );
83 83
84 let config = embassy_net::Config::Dhcp(Default::default()); 84 let config = embassy_net::Config::dhcpv4(Default::default());
85 //let config = embassy_net::Config::StaticV4(embassy_net::StaticConfigV4 { 85 //let config = embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 {
86 // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), 86 // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24),
87 // dns_servers: Vec::new(), 87 // dns_servers: Vec::new(),
88 // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), 88 // gateway: Some(Ipv4Address::new(10, 42, 0, 1)),
diff --git a/examples/stm32h7/src/bin/eth.rs b/examples/stm32h7/src/bin/eth.rs
index 5360a213a..12d37f7a4 100644
--- a/examples/stm32h7/src/bin/eth.rs
+++ b/examples/stm32h7/src/bin/eth.rs
@@ -63,8 +63,8 @@ async fn main(spawner: Spawner) -> ! {
63 0, 63 0,
64 ); 64 );
65 65
66 let config = embassy_net::Config::Dhcp(Default::default()); 66 let config = embassy_net::Config::dhcpv4(Default::default());
67 //let config = embassy_net::Config::StaticV4(embassy_net::StaticConfigV4 { 67 //let config = embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 {
68 // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), 68 // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24),
69 // dns_servers: Vec::new(), 69 // dns_servers: Vec::new(),
70 // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), 70 // gateway: Some(Ipv4Address::new(10, 42, 0, 1)),
diff --git a/examples/stm32h7/src/bin/eth_client.rs b/examples/stm32h7/src/bin/eth_client.rs
index 42781cfdc..6078fc3fe 100644
--- a/examples/stm32h7/src/bin/eth_client.rs
+++ b/examples/stm32h7/src/bin/eth_client.rs
@@ -64,8 +64,8 @@ async fn main(spawner: Spawner) -> ! {
64 0, 64 0,
65 ); 65 );
66 66
67 let config = embassy_net::Config::Dhcp(Default::default()); 67 let config = embassy_net::Config::dhcpv4(Default::default());
68 //let config = embassy_net::Config::StaticV4(embassy_net::StaticConfigV4 { 68 //let config = embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 {
69 // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), 69 // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24),
70 // dns_servers: Vec::new(), 70 // dns_servers: Vec::new(),
71 // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), 71 // gateway: Some(Ipv4Address::new(10, 42, 0, 1)),
diff --git a/examples/stm32l5/src/bin/usb_ethernet.rs b/examples/stm32l5/src/bin/usb_ethernet.rs
index d96d2f350..32eba4277 100644
--- a/examples/stm32l5/src/bin/usb_ethernet.rs
+++ b/examples/stm32l5/src/bin/usb_ethernet.rs
@@ -91,8 +91,8 @@ async fn main(spawner: Spawner) {
91 let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(make_static!(NetState::new()), our_mac_addr); 91 let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(make_static!(NetState::new()), our_mac_addr);
92 unwrap!(spawner.spawn(usb_ncm_task(runner))); 92 unwrap!(spawner.spawn(usb_ncm_task(runner)));
93 93
94 let config = embassy_net::Config::Dhcp(Default::default()); 94 let config = embassy_net::Config::dhcpv4(Default::default());
95 //let config = embassy_net::Config::StaticV4(embassy_net::StaticConfigV4 { 95 //let config = embassy_net::Config::ipv4_static(embassy_net::StaticConfigV4 {
96 // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), 96 // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24),
97 // dns_servers: Vec::new(), 97 // dns_servers: Vec::new(),
98 // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), 98 // gateway: Some(Ipv4Address::new(10, 42, 0, 1)),