Start to build NAT configuration mode
This commit is contained in:
@ -61,6 +61,13 @@ pub struct IPV6Config {
|
||||
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone)]
|
||||
pub struct NetworkName(pub String);
|
||||
|
||||
impl NetworkName {
|
||||
/// Get the name of the file that will store the NAT configuration of this network
|
||||
pub fn nat_file_name(&self) -> String {
|
||||
format!("nat-{}.json", self.0)
|
||||
}
|
||||
}
|
||||
|
||||
impl NetworkName {
|
||||
pub fn is_valid(&self) -> bool {
|
||||
regex!("^[a-zA-Z0-9]+$").is_match(&self.0)
|
||||
|
Reference in New Issue
Block a user