Commit 17a61ecf authored by Yathindra Naik's avatar Yathindra Naik
Browse files

Revert "Removed custom agent"

This reverts commit 79d43b7d0d119416ce6583eb5f69d22717865846.
parent 7236722e
# -*- tcl -*-
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2006 University of Utah and the Flux Group.
# All rights reserved.
#
######################################################################
# Custom.tcl
#
# This defines the local custom agent.
#
######################################################################
Class Custom -superclass NSObject
namespace eval GLOBALS {
set new_classes(Custom) {}
}
Custom instproc init {s} {
global ::GLOBALS::last_class
$self set sim $s
$self set node {}
$self set name {}
# Link simulator to this new object.
$s add_custom $self
set ::GLOBALS::last_class $self
}
Custom instproc rename {old new} {
$self instvar sim
$sim rename_custom $old $new
}
# updatedb DB
# This adds rows to the virt_trafgens table corresponding to this agent.
Custom instproc updatedb {DB} {
var_import ::GLOBALS::pid
var_import ::GLOBALS::eid
var_import ::TBCOMPAT::objtypes
$self instvar node
$self instvar name
$self instvar sim
if {$node == {}} {
perror "\[updatedb] $self has no node."
return
}
set progvnode $node
#
# if the attached node is a simulated one, we attach the
# program to the physical node on which the simulation runs
#
if {$progvnode != "ops"} {
if { [$node set simulated] == 1 } {
set progvnode [$node set nsenode]
}
}
# Update the DB
$sim spitxml_data "virt_agents" [list "vnode" "vname" "objecttype" ] [list $progvnode $self $objtypes(CUSTOM) ]
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment