]> git.entuzijast.net Git - imunes.git/commitdiff
revert praznog pimplanja po ngnodemapu u instantiate
authorJosip Rodin <joy@numa-ubuntu-vm.(none)>
Sun, 13 Sep 2009 17:14:08 +0000 (19:14 +0200)
committerJosip Rodin <joy@numa-ubuntu-vm.(none)>
Sun, 13 Sep 2009 17:14:08 +0000 (19:14 +0200)
usput primijetio cudnovate ngnodemap entrye za hub, rj45, lanswitch...
zakomentirano nepotreban redak u jednom destroyu koji zapravo ne radimo

linux/exec.tcl
linux/hub.tcl
linux/rj45.tcl

index 01a8ab57e54dd9998cabbcde6f82185d880e2b38..762ee9d5a62f0f7518427e2f3dc0f476e03d5972 100755 (executable)
@@ -287,22 +287,6 @@ 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]
@@ -405,9 +389,9 @@ proc l3node.start { eid node } {
            eth {
 # FreeBSD-specific:
 #              puts "  nexec vimage $eid vimage -i $node $ifid $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)
+# na Linux/OpenVZ ne moramo napraviti nista slicno createIfc/vimage
+# nego sami postavljamo ifid
+               set ifid "e${node_id}_${ifc}"
 
                set peer [peerByIfc $node $ifc]
 
@@ -431,6 +415,7 @@ 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
@@ -441,6 +426,7 @@ 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
            }
        }
     }
@@ -750,12 +736,12 @@ proc deployCfg {} {
                    [lindex [[typemodel $lnode2].nghook $eid $lnode2 $ifname2] 0]
                set ngpeer1 $ngnodemap($peer1)
                set ngpeer2 $ngnodemap($peer2)
-               set nghook1 \
-                   [lindex [[typemodel $lnode1].nghook $eid $lnode1 $ifname1] 1]
-               set nghook2 \
-                   [lindex [[typemodel $lnode2].nghook $eid $lnode2 $ifname2] 1]
 
 # FreeBSD-specific:
+#              set nghook1 \
+#                  [lindex [[typemodel $lnode1].nghook $eid $lnode1 $ifname1] 1]
+#              set nghook2 \
+#                  [lindex [[typemodel $lnode2].nghook $eid $lnode2 $ifname2] 1]
 #              puts "  nexec vimage $eid ngctl mkpeer $ngpeer1: pipe $nghook1 upper            "
 #              puts "  nexec vimage $eid ngctl name $ngpeer1:$nghook1 $lname                   "
 #              puts "  nexec vimage $eid ngctl connect $lname: $ngpeer2: lower $nghook2        "
index 4f620f02f438be66e88ab1dad0c9e3d05f5019c9..0c9d5385484100f948688e179022e3d068b5c310 100755 (executable)
@@ -75,9 +75,9 @@ proc $MODULE.layer {} {
 proc $MODULE.instantiate { eid node } {
     upvar 0 ::cf::[set ::curcfg]::ngnodemap ngnodemap
 
-# TODO mozda mapformat treba biti standardni node_id?
+# TODO mozda mapformat treba biti standardni nghook format?
 #    upvar 0 ::cf::[set ::curcfg]::[set node]::node_id node_id
-#    set mapformat $node_id
+#    set mapformat $ifc@$node_id
     set mapformat "$eid\.$node"
     set ngnodemap($mapformat) $node
 
index 671de19954d607927099470bfad02118190b49c7..b009f9650eab5bcad18af53a97d1a70bf06af3df 100755 (executable)
@@ -75,6 +75,9 @@ proc $MODULE.instantiate { eid node } {
     upvar 0 ::cf::[set ::curcfg]::ngnodemap ngnodemap
 
     set ifname [getNodeName $node]
+# TODO mozda mapformat treba biti standardni nghook format?
+#    upvar 0 ::cf::[set ::curcfg]::[set node]::node_id node_id
+#    set $ifname [getNodeName $node]@$node_id
     set ngnodemap($ifname) $ifname
 
 # FreeBSD-specific:
@@ -128,7 +131,7 @@ proc $MODULE.shutdown { eid node } {
 #   * node_id - id of the node (type of the node is rj45)
 #****
 proc $MODULE.destroy { eid node } {
-    set ifname [getNodeName $node]
+    #set ifname [getNodeName $node]
     # nexec ifconfig $ifname up -promisc
 }