Skip to content

Commit 02ae6bf

Browse files
rename ip_addr to ip
1 parent a4bf961 commit 02ae6bf

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

  • devolutions-gateway/src/api

devolutions-gateway/src/api/net.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,13 +226,13 @@ pub enum Status {
226226
#[serde(tag = "protocol", rename_all = "lowercase")]
227227
pub enum ScanEvent {
228228
Ping {
229-
ip_addr: IpAddr,
229+
ip: IpAddr,
230230
status: Status,
231231
#[serde(skip_serializing_if = "Option::is_none")]
232232
time: Option<u128>,
233233
},
234234
Dns {
235-
ip_addr: IpAddr,
235+
ip: IpAddr,
236236
hostname: String,
237237
},
238238
}
@@ -241,21 +241,21 @@ impl From<scanner::ScanEvent> for ScanEvent {
241241
fn from(event: scanner::ScanEvent) -> Self {
242242
match event {
243243
scanner::ScanEvent::PingStart { ip_addr } => Self::Ping {
244-
ip_addr,
244+
ip: ip_addr,
245245
status: Status::Start,
246246
time: None,
247247
},
248248
scanner::ScanEvent::PingSuccess { ip_addr, time } => Self::Ping {
249-
ip_addr,
249+
ip: ip_addr,
250250
status: Status::Success,
251251
time: Some(time),
252252
},
253253
scanner::ScanEvent::PingFailed { ip_addr, .. } => Self::Ping {
254-
ip_addr,
254+
ip: ip_addr,
255255
status: Status::Failed,
256256
time: None,
257257
},
258-
scanner::ScanEvent::Dns { ip_addr, hostname } => Self::Dns { ip_addr, hostname },
258+
scanner::ScanEvent::Dns { ip_addr, hostname } => Self::Dns { ip: ip_addr, hostname },
259259
}
260260
}
261261
}
@@ -265,6 +265,8 @@ impl From<scanner::ScanEvent> for ScanEvent {
265265
pub enum NetworkScanResponse {
266266
Event(ScanEvent),
267267
Entry {
268+
/// for backward compatibility
269+
#[serde(rename = "ip")]
268270
ip: IpAddr,
269271
hostname: Option<String>,
270272
protocol: ApplicationProtocol,

0 commit comments

Comments
 (0)