aboutsummaryrefslogtreecommitdiff
path: root/embassy-net
diff options
context:
space:
mode:
authorRuben De Smet <[email protected]>2023-06-05 14:57:17 +0200
committerRuben De Smet <[email protected]>2023-06-06 17:04:21 +0200
commit54bab33c7342510be538bc6d8545fe50146557cf (patch)
treebafd49491fd9e40bc1a53b083c690406b1122899 /embassy-net
parent44624b2d7a15ccc94971fc8d2091800f67821c58 (diff)
Rename StaticConfig to StaticConfigV4
Diffstat (limited to 'embassy-net')
-rw-r--r--embassy-net/src/lib.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/embassy-net/src/lib.rs b/embassy-net/src/lib.rs
index bccbad521..ddb325c6c 100644
--- a/embassy-net/src/lib.rs
+++ b/embassy-net/src/lib.rs
@@ -68,7 +68,7 @@ impl<const SOCK: usize> StackResources<SOCK> {
68 68
69/// Static IP address configuration. 69/// Static IP address configuration.
70#[derive(Debug, Clone, PartialEq, Eq)] 70#[derive(Debug, Clone, PartialEq, Eq)]
71pub struct StaticConfig { 71pub struct StaticConfigV4 {
72 /// IP address and subnet mask. 72 /// IP address and subnet mask.
73 pub address: Ipv4Cidr, 73 pub address: Ipv4Cidr,
74 /// Default gateway. 74 /// Default gateway.
@@ -114,7 +114,7 @@ impl Default for DhcpConfig {
114/// Network stack configuration. 114/// Network stack configuration.
115pub enum Config { 115pub enum Config {
116 /// Use a static IP address configuration. 116 /// Use a static IP address configuration.
117 Static(StaticConfig), 117 Static(StaticConfigV4),
118 /// Use DHCP to obtain an IP address configuration. 118 /// Use DHCP to obtain an IP address configuration.
119 #[cfg(feature = "dhcpv4")] 119 #[cfg(feature = "dhcpv4")]
120 Dhcp(DhcpConfig), 120 Dhcp(DhcpConfig),
@@ -131,7 +131,7 @@ pub struct Stack<D: Driver> {
131struct Inner<D: Driver> { 131struct Inner<D: Driver> {
132 device: D, 132 device: D,
133 link_up: bool, 133 link_up: bool,
134 config: Option<StaticConfig>, 134 config: Option<StaticConfigV4>,
135 #[cfg(feature = "dhcpv4")] 135 #[cfg(feature = "dhcpv4")]
136 dhcp_socket: Option<SocketHandle>, 136 dhcp_socket: Option<SocketHandle>,
137 #[cfg(feature = "dns")] 137 #[cfg(feature = "dns")]
@@ -243,7 +243,7 @@ impl<D: Driver + 'static> Stack<D> {
243 } 243 }
244 244
245 /// Get the current IP configuration. 245 /// Get the current IP configuration.
246 pub fn config(&self) -> Option<StaticConfig> { 246 pub fn config(&self) -> Option<StaticConfigV4> {
247 self.with(|_s, i| i.config.clone()) 247 self.with(|_s, i| i.config.clone())
248 } 248 }
249 249
@@ -374,7 +374,7 @@ impl SocketStack {
374} 374}
375 375
376impl<D: Driver + 'static> Inner<D> { 376impl<D: Driver + 'static> Inner<D> {
377 fn apply_config(&mut self, s: &mut SocketStack, config: StaticConfig) { 377 fn apply_config(&mut self, s: &mut SocketStack, config: StaticConfigV4) {
378 #[cfg(feature = "medium-ethernet")] 378 #[cfg(feature = "medium-ethernet")]
379 let medium = self.device.capabilities().medium; 379 let medium = self.device.capabilities().medium;
380 380
@@ -470,7 +470,7 @@ impl<D: Driver + 'static> Inner<D> {
470 None => {} 470 None => {}
471 Some(dhcpv4::Event::Deconfigured) => self.unapply_config(s), 471 Some(dhcpv4::Event::Deconfigured) => self.unapply_config(s),
472 Some(dhcpv4::Event::Configured(config)) => { 472 Some(dhcpv4::Event::Configured(config)) => {
473 let config = StaticConfig { 473 let config = StaticConfigV4 {
474 address: config.address, 474 address: config.address,
475 gateway: config.router, 475 gateway: config.router,
476 dns_servers: config.dns_servers, 476 dns_servers: config.dns_servers,