]> git.entuzijast.net Git - imunes.git/commitdiff
hrm, ngnodemap je potreban za bridging code u deployCfg, pa ga moramo izbuildati...
authorJosip Rodin <joy@numa-ubuntu-vm.(none)>
Sun, 13 Sep 2009 16:24:08 +0000 (18:24 +0200)
committerJosip Rodin <joy@numa-ubuntu-vm.(none)>
Sun, 13 Sep 2009 16:24:08 +0000 (18:24 +0200)
linux/exec.tcl
linux/hub.tcl
linux/rj45.tcl

index 65d03bec9eae9236daded935316fc73ef1f4ad93..4a9152e08d4a75cede469eb4c7fa77bdd7c11211 100755 (executable)
@@ -287,6 +287,22 @@ proc l3node.instantiate { eid node } {
 # feature FreeBSD-a only (expandanje @ u symlinkovima kao node id)
 #    puts "    nexec vimage $node_id sysctl vfs.morphing_symlinks=1    "
 
+# ngnodemap moramo buildati u instantiate jer ga bridging code koristi
+    upvar 0 ::cf::[set ::curcfg]::ngnodemap ngnodemap
+    foreach ifc [ifcList $node] {
+               switch -exact [string range $ifc 0 2] {
+                   eth {
+                       set ifid "e${node_id}_${ifc}"
+                       set ngnodemap($ifc@$node_id) $ifid
+                   }
+                   ser {
+# TODO: serial interfaceove zasad ne podrzavamo
+#                      set ifnum [string range $ifc 3 end]
+#                      set ngnodemap(hdlc$ifnum@$node_id) hdlc$ifnum\@$node
+                   }
+               }
+       }
+
 # TODO: OpenVZ CPU tuning
 #    set cpuconf [getNodeCPUConf $node]
 #    set cpumin [lindex [lsearch -inline $cpuconf {min *}] 1]
@@ -388,12 +404,10 @@ proc l3node.start { eid node } {
        switch -exact [string range $ifc 0 2] {
            eth {
 # FreeBSD-specific:
-#              set ifid [createIfc $eid eiface ether]
 #              puts "  nexec vimage $eid vimage -i $node $ifid $ifc    "
-
-# na Linuxu ne moramo pokrenuti createIfc, samo postaviti ovaj standardni format
-# koji ide u vzctl --netif_add
-               set ifid "e${node_id}_${ifc}"
+# na Linux/OpenVZ ne moramo pokrenuti createIfc/vimage, samo izvaditi
+# ime interfacea iz ngnodemapa za vzctl --netif_add
+               set ifid ngnodemap($ifc@$node_id)
 
                set peer [peerByIfc $node $ifc]
 
@@ -417,7 +431,6 @@ proc l3node.start { eid node } {
                }
 #              puts "  nexec vimage $node_id ifconfig $ifc link $ether "
                nexec vzctl {set} $node_id --netif_add $ifc,$ether,$ifid,$host_ether
-               set ngnodemap($ifc@$node_id) $ifid
            }
            ser {
 # TODO: serial interfaceove zasad ne podrzavamo
@@ -428,7 +441,6 @@ proc l3node.start { eid node } {
 #              nexec vimage $eid ngctl msg $ifid: broadcast
 #              nexec vimage $eid ngctl name $ifid:inet hdlc$ifnum\@$node
 #              nexec vimage $eid vimage -i $node $ifid $ifc
-#              set ngnodemap(hdlc$ifnum@$node_id) hdlc$ifnum\@$node
            }
        }
     }
index b04b7eed47baecc63f7370ad9b11e213f990672b..4f620f02f438be66e88ab1dad0c9e3d05f5019c9 100755 (executable)
@@ -75,6 +75,12 @@ proc $MODULE.layer {} {
 proc $MODULE.instantiate { eid node } {
     upvar 0 ::cf::[set ::curcfg]::ngnodemap ngnodemap
 
+# TODO mozda mapformat treba biti standardni node_id?
+#    upvar 0 ::cf::[set ::curcfg]::[set node]::node_id node_id
+#    set mapformat $node_id
+    set mapformat "$eid\.$node"
+    set ngnodemap($mapformat) $node
+
 #    puts "\nhub.INSTANTIATE"
 #    puts "  Ne radi nista. Sve se rjesava prilikom dodavanja pojedinih linkova.
 
@@ -100,7 +106,6 @@ proc $MODULE.instantiate { eid node } {
 #   * node_id - id of the node (type of the node is hub)
 #****
 proc $MODULE.start { eid node } {
-    set ngnodemap($eid\.$node) $node
 }
 
 #****f* hub.tcl/hub.shutdown
index c9b528fb1048f3dbb43e1a5e026ced3ee7c642b2..671de19954d607927099470bfad02118190b49c7 100755 (executable)
@@ -74,6 +74,13 @@ proc $MODULE.layer {} {
 proc $MODULE.instantiate { eid node } {
     upvar 0 ::cf::[set ::curcfg]::ngnodemap ngnodemap
 
+    set ifname [getNodeName $node]
+    set ngnodemap($ifname) $ifname
+
+# FreeBSD-specific:
+    # nexec vimage -i $eid $ifname $ifname
+# TODO je li promisc potreban? ako da, pod OpenVZ mora biti u .start
+    # nexec vimage $eid ifconfig $ifname up promisc
 }
 
 
@@ -90,10 +97,6 @@ proc $MODULE.instantiate { eid node } {
 #   * node_id - id of the node (type of the node is rj45)
 #****
 proc $MODULE.start { eid node } {
-    set ifname [getNodeName $node]
-    set ngnodemap($ifname) $ifname
-    # nexec vimage -i $eid $ifname $ifname
-    # nexec vimage $eid ifconfig $ifname up promisc
 }