removed ovs node from gui

This commit is contained in:
Blake Harnden 2019-09-25 10:46:41 -07:00
parent 9c4459e7e7
commit b0c30056f9
5 changed files with 21 additions and 39 deletions

View file

@ -2706,7 +2706,7 @@ proc sendNodeTypeInfo { sock reset } {
set typesinuse "" set typesinuse ""
foreach node $node_list { foreach node $node_list {
set type [nodeType $node] set type [nodeType $node]
if { $type != "router" && $type != "OVS" } { continue } if { $type != "router" } { continue }
set model [getNodeModel $node] set model [getNodeModel $node]
if { [lsearch $typesinuse $model] < 0 } { lappend typesinuse $model } if { [lsearch $typesinuse $model] < 0 } { lappend typesinuse $model }
} }
@ -2910,7 +2910,6 @@ proc getNodeTypeAPI { node } {
router { return 0x0 } router { return 0x0 }
netns { return 0x0 } netns { return 0x0 }
jail { return 0x0 } jail { return 0x0 }
OVS { return 0x0 }
physical { return 0x1 } physical { return 0x1 }
tbd { return 0x3 } tbd { return 0x3 }
lanswitch { return 0x4 } lanswitch { return 0x4 }

View file

@ -333,7 +333,7 @@ proc redrawAll {} {
proc drawNode { c node } { proc drawNode { c node } {
global showNodeLabels global showNodeLabels
global router pc host lanswitch rj45 hub pseudo OVS global router pc host lanswitch rj45 hub pseudo
global curcanvas zoom global curcanvas zoom
global wlan global wlan
if { $c == "" } { set c .c } ;# default canvas if { $c == "" } { set c .c } ;# default canvas
@ -348,7 +348,7 @@ proc drawNode { c node } {
set cimg "" set cimg ""
set imgzoom $zoom set imgzoom $zoom
if { $zoom == 0.75 || $zoom == 1.5 } { set imgzoom 1.0 } if { $zoom == 0.75 || $zoom == 1.5 } { set imgzoom 1.0 }
if { $type == "router" || $type == "OVS" } { if { $type == "router" } {
set model [getNodeModel $node] set model [getNodeModel $node]
set cimg [getNodeTypeImage $model normal] set cimg [getNodeTypeImage $model normal]
} }
@ -1535,7 +1535,7 @@ proc raiseAll {c} {
proc button1 { c x y button } { proc button1 { c x y button } {
global node_list plot_list curcanvas zoom global node_list plot_list curcanvas zoom
global activetool activetoolp newlink curobj changed def_router_model global activetool activetoolp newlink curobj changed def_router_model
global router pc host lanswitch rj45 hub OVS global router pc host lanswitch rj45 hub
global oval rectangle text global oval rectangle text
global lastX lastY global lastX lastY
global background selectbox global background selectbox
@ -1607,10 +1607,7 @@ proc button1 { c x y button } {
rectangle text} $activetool] < 0 } { rectangle text} $activetool] < 0 } {
if { $g_view_locked == 1 } { return } if { $g_view_locked == 1 } { return }
if { $activetoolp == "routers" } { if { $activetoolp == "routers" } {
if {$activetool != "OVS"} {
set node [newNode router] set node [newNode router]
} else {
set node [newNode OVS]}
setNodeModel $node $activetool setNodeModel $node $activetool
} else { } else {
set node [newNode $activetool] set node [newNode $activetool]
@ -2550,7 +2547,7 @@ proc popupConfigDialog { c } {
-side right -padx 4 -pady 4 -side right -padx 4 -pady 4
# end Boeing # end Boeing
pack $wi.ftop -side top pack $wi.ftop -side top
if { $type == "router" || $type == "OVS"} { if { $type == "router" } {
ttk::frame $wi.model -borderwidth 4 ttk::frame $wi.model -borderwidth 4
ttk::label $wi.model.label -text "Type:" ttk::label $wi.model.label -text "Type:"

View file

@ -108,7 +108,7 @@ proc autoIPv4addr { node iface } {
set peer_node [logicalPeerByIfc $node $iface] set peer_node [logicalPeerByIfc $node $iface]
# find addresses of NETWORK layer peer nodes # find addresses of NETWORK layer peer nodes
if { [[typemodel $peer_node].layer] == "LINK" || [nodeType $peer_node] == "OVS" } { if { [[typemodel $peer_node].layer] == "LINK" } {
foreach l2node [listLANnodes $peer_node {}] { foreach l2node [listLANnodes $peer_node {}] {
foreach ifc [ifcList $l2node] { foreach ifc [ifcList $l2node] {
set peer [logicalPeerByIfc $l2node $ifc] set peer [logicalPeerByIfc $l2node $ifc]

View file

@ -747,15 +747,12 @@ proc newLink { lnode1 lnode2 } {
global defLinkColor defLinkWidth global defLinkColor defLinkWidth
global curcanvas global curcanvas
global systype global systype
if { ([nodeType $lnode1] == "lanswitch" ||[nodeType $lnode1] == "OVS") && \ if { [nodeType $lnode1] == "lanswitch" && \
[nodeType $lnode2] != "router" && \ [nodeType $lnode2] != "router" && \
([nodeType $lnode2] != "lanswitch" || [nodeType $lnode2] != "OVS") } { [nodeType $lnode2] != "lanswitch" } { set regular no }
set regular no } if { [nodeType $lnode2] == "lanswitch" && \
if { ([nodeType $lnode2] == "lanswitch" || [nodeType $lnode2] == "OVS") && \
[nodeType $lnode1] != "router" && \ [nodeType $lnode1] != "router" && \
([nodeType $lnode1] != "lanswitch" || [nodeType $lnode1] != "OVS" )} { [nodeType $lnode1] != "lanswitch" } { set regular no }
#Khaled: puts "connecting '$lnode1' (type: '[nodeType $lnode1]') to '$lnode2' (type: '[nodeType $lnode2]') "
set regular no }
if { [nodeType $lnode1] == "hub" && \ if { [nodeType $lnode1] == "hub" && \
[nodeType $lnode2] == "hub" } { set regular no } [nodeType $lnode2] == "hub" } { set regular no }
# Boeing: added tunnel, ktunnel types to behave as rj45 # Boeing: added tunnel, ktunnel types to behave as rj45
@ -771,7 +768,7 @@ proc newLink { lnode1 lnode2 } {
set othernode $lnode1 set othernode $lnode1
} }
# only allowed to link with certain types # only allowed to link with certain types
if { [lsearch {router lanswitch hub pc host wlan OVS} \ if { [lsearch {router lanswitch hub pc host wlan} \
[nodeType $othernode]] < 0} { [nodeType $othernode]] < 0} {
return return
} }
@ -836,18 +833,13 @@ proc newLink { lnode1 lnode2 } {
} elseif {$delay != ""} { } elseif {$delay != ""} {
lappend $link "delay $delay" lappend $link "delay $delay"
} }
# Exclude OVS from network layer nodes IP address asignments if { [[typemodel $lnode2].layer] == "NETWORK" } {
if { ([[typemodel $lnode2].layer] == "NETWORK") && ([nodeType $lnode2] != "OVS") } {
#Khaled: puts "Assigning '$lnode2' (type: '[nodeType $lnode2]') an automatic IP address"
if { $ipv4_addr2 == "" } { autoIPv4addr $lnode2 $ifname2 } if { $ipv4_addr2 == "" } { autoIPv4addr $lnode2 $ifname2 }
if { $ipv6_addr2 == "" } { autoIPv6addr $lnode2 $ifname2 } if { $ipv6_addr2 == "" } { autoIPv6addr $lnode2 $ifname2 }
} }
# tunnels also excluded from link settings # tunnels also excluded from link settings
# OVS and Lanswitch should go side by side } elseif { ([nodeType $lnode1] == "lanswitch" || \
} elseif { (([nodeType $lnode1] == "lanswitch" || [nodeType $lnode1] == "OVS" )|| \ [nodeType $lnode2] == "lanswitch" || \
([nodeType $lnode2] == "lanswitch"|| [nodeType $lnode2] == "OVS") || \
[string first eth "$ifname1 $ifname2"] != -1) && \ [string first eth "$ifname1 $ifname2"] != -1) && \
[nodeType $lnode1] != "rj45" && [nodeType $lnode2] != "rj45" && \ [nodeType $lnode1] != "rj45" && [nodeType $lnode2] != "rj45" && \
[nodeType $lnode1] != "tunnel" && [nodeType $lnode2] != "tunnel" && \ [nodeType $lnode1] != "tunnel" && [nodeType $lnode2] != "tunnel" && \
@ -859,11 +851,9 @@ proc newLink { lnode1 lnode2 } {
} }
lappend link_list $link lappend link_list $link
# Exclude OVS from Network layer node configs
if { [nodeType $lnode2] != "pseudo" && if { [nodeType $lnode2] != "pseudo" &&
[nodeType $lnode1] != "wlan" && [nodeType $lnode1] != "wlan" &&
([[typemodel $lnode1].layer] == "NETWORK" && [nodeType $lnode1] != "OVS") } { [[typemodel $lnode1].layer] == "NETWORK" } {
if { $ipv4_addr1 == "" && $do_auto_addressing } { if { $ipv4_addr1 == "" && $do_auto_addressing } {
autoIPv4addr $lnode1 $ifname1 autoIPv4addr $lnode1 $ifname1
} }
@ -874,8 +864,7 @@ proc newLink { lnode1 lnode2 } {
# assume wlan is always lnode1 # assume wlan is always lnode1
if { [nodeType $lnode1] != "pseudo" && if { [nodeType $lnode1] != "pseudo" &&
[nodeType $lnode1] != "wlan" && [nodeType $lnode1] != "wlan" &&
([[typemodel $lnode2].layer] == "NETWORK" && [nodeType $lnode2] != "OVS") } { [[typemodel $lnode2].layer] == "NETWORK" } {
if { $ipv4_addr2 == "" && $do_auto_addressing } { if { $ipv4_addr2 == "" && $do_auto_addressing } {
autoIPv4addr $lnode2 $ifname2 autoIPv4addr $lnode2 $ifname2
} }

View file

@ -21,12 +21,10 @@ array set g_node_types_default {
5 {prouter router_green.gif router_green.gif \ 5 {prouter router_green.gif router_green.gif \
{zebra OSPFv2 OSPFv3 IPForward} \ {zebra OSPFv2 OSPFv3 IPForward} \
physical {built-in type for physical nodes}} physical {built-in type for physical nodes}}
6 {OVS lanswitch.gif lanswitch.gif {DefaultRoute SSH OvsService} OVS {} }
} }
# possible machine types for nodes # possible machine types for nodes
set MACHINE_TYPES "netns physical OVS" set MACHINE_TYPES "netns physical"
# array populated from nodes.conf file # array populated from nodes.conf file
array set g_node_types { } array set g_node_types { }
@ -184,7 +182,7 @@ proc getNodeTypeServices { type } {
# node type from the toolbar # node type from the toolbar
proc getNodeTypeMachineType { type } { proc getNodeTypeMachineType { type } {
global MACHINE_TYPES g_node_types global MACHINE_TYPES g_node_types
set default_machine_type [lindex $MACHINE_TYPES 3] set default_machine_type [lindex $MACHINE_TYPES 0]
set i [getNodeTypeIndex $type] set i [getNodeTypeIndex $type]
if { $i < 0 } { return $default_machine_type }; # failsafe if { $i < 0 } { return $default_machine_type }; # failsafe
return [lindex $g_node_types($i) 4] return [lindex $g_node_types($i) 4]
@ -208,7 +206,7 @@ proc getNodeTypeProfile { type } {
# node type from the toolbar # node type from the toolbar
proc getNodeTypeMachineType { type } { proc getNodeTypeMachineType { type } {
global MACHINE_TYPES g_node_types global MACHINE_TYPES g_node_types
set default_machine_type [lindex $MACHINE_TYPES 3] set default_machine_type [lindex $MACHINE_TYPES 0]
set i [getNodeTypeIndex $type] set i [getNodeTypeIndex $type]
if { $i < 0 } { return $default_machine_type }; # failsafe if { $i < 0 } { return $default_machine_type }; # failsafe
return [lindex $g_node_types($i) 4] return [lindex $g_node_types($i) 4]
@ -714,7 +712,6 @@ proc lanswitch.layer {} { return LINK }
proc hub.layer {} { return LINK } proc hub.layer {} { return LINK }
proc tunnel.layer {} { return LINK } proc tunnel.layer {} { return LINK }
proc wlan.layer {} { return LINK } proc wlan.layer {} { return LINK }
proc OVS.layer {} { return NETWORK }
proc router.layer {} { return NETWORK } proc router.layer {} { return NETWORK }
proc router.shellcmd { n } { return "vtysh" } proc router.shellcmd { n } { return "vtysh" }