mmds: added support for custom ipv4 address
Added a new API for configuring MMDS. At the moment, this configuration applies only for the MMDS IPv4 address. Besides the new API, this commits comprises changes to the NetBuilder implementation and usages. Signed-off-by: iulianbarbu <iul@amazon.com> Signed-off-by: YUAN LYU <lyuyuan92@gmail.com>
This commit is contained in:
committed by
Adrian Catangiu
parent
d288940391
commit
4a25226f2a
@@ -131,6 +131,7 @@ impl<T: Read + Write> HttpConnection<T> {
|
||||
Err(e) => return Err(ConnectionError::StreamError(e)),
|
||||
}
|
||||
}
|
||||
Ok(bytes_read + self.read_cursor)
|
||||
}
|
||||
|
||||
/// Parses bytes in `buffer` for a valid request line.
|
||||
|
||||
20
src/vmm/src/vmm_config/mmds.rs
Normal file
20
src/vmm/src/vmm_config/mmds.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
// Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
use std::net::Ipv4Addr;
|
||||
|
||||
/// Keeps the MMDS configuration.
|
||||
#[derive(Debug, Deserialize, PartialEq)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct MmdsConfig {
|
||||
/// MMDS IPv4 configured address.
|
||||
ipv4_address: Option<Ipv4Addr>,
|
||||
}
|
||||
|
||||
impl MmdsConfig {
|
||||
/// Returns the MMDS IPv4 address if one was configured.
|
||||
/// Otherwise returns None.
|
||||
pub fn ipv4_addr(&self) -> Option<Ipv4Addr> {
|
||||
self.ipv4_address
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user