...
 
Commits (2)
......@@ -17,6 +17,7 @@ pub fn gen_for(dtype: &str) -> Option<Box<dyn Generator>> {
"CRS326" => Some(Box::new(gen_crs326::GenCrs326{})),
"RB962U" => Some(Box::new(gen_rb962u::GenRB962U{})),
"RB750G" => Some(Box::new(gen_rb962u::GenRB962U{})),
"CRS109" => Some(Box::new(gen_rb962u::GenRB962U{})),
_ => None
}
}
......@@ -129,7 +130,14 @@ mod gen_rb962u {
impl Generator for GenRB962U {
fn build_configuration(&self, device: &Device) -> String {
let mut src = " {\n /interface ethernet switch port\n# WARNING: this still needs some testing because of non-switch ports\n".to_owned();
let mut src = " {\n /interface bridge\n remove [find]\n add name=switch protocol-mode=none\n /interface bridge port\n remove [find]\n".to_owned();
for port in device.ports.iter() {
if port.org_name != "switch1-cpu" {
src += format!(" add bridge=switch interface=\"{}\"\n", port.new_name).as_str();
}
}
src += " }\n {\n /interface ethernet switch port\n";
for port in device.ports.iter() {
match (port.profile.untagged_vlans.len(), port.profile.tagged_vlans.len()) {
......