Commit c39ed5ff authored by Yathindra Naik's avatar Yathindra Naik

Restored Custom agent for future use

parent 4dfd5ecd
...@@ -20,7 +20,7 @@ LIB_STUFF = lanlink.tcl node.tcl sim.tcl tb_compat.tcl null.tcl \ ...@@ -20,7 +20,7 @@ LIB_STUFF = lanlink.tcl node.tcl sim.tcl tb_compat.tcl null.tcl \
elabinelab.ns elabinelab-withfsnode.ns elabinelab-opsvm.ns \ elabinelab.ns elabinelab-withfsnode.ns elabinelab-opsvm.ns \
fw.ns timeline.tcl sequence.tcl \ fw.ns timeline.tcl sequence.tcl \
topography.tcl console.tcl path.tcl \ topography.tcl console.tcl path.tcl \
disk.tcl disk.tcl custom.tcl
BOSSLIBEXEC = parse-ns BOSSLIBEXEC = parse-ns
USERLIBEXEC = parse.proxy USERLIBEXEC = parse.proxy
......
...@@ -723,6 +723,18 @@ Node instproc disk-agent {args} { ...@@ -723,6 +723,18 @@ Node instproc disk-agent {args} {
return $curdisk return $curdisk
} }
Node instproc custom-agent {args} {
::GLOBALS::named-args $args {
-name {}
}
set customagent [new Custom [$self set sim]]
$customagent set node $self
$customagent set name $(-name)
return $customagent
}
Node instproc topography {topo} { Node instproc topography {topo} {
var_import ::TBCOMPAT::location_info var_import ::TBCOMPAT::location_info
$self instvar sim $self instvar sim
......
...@@ -377,6 +377,7 @@ source ${GLOBALS::libdir}/sequence.tcl ...@@ -377,6 +377,7 @@ source ${GLOBALS::libdir}/sequence.tcl
source ${GLOBALS::libdir}/console.tcl source ${GLOBALS::libdir}/console.tcl
source ${GLOBALS::libdir}/topography.tcl source ${GLOBALS::libdir}/topography.tcl
source ${GLOBALS::libdir}/disk.tcl source ${GLOBALS::libdir}/disk.tcl
source ${GLOBALS::libdir}/custom.tcl
################################################## ##################################################
# Redifing Assignment # Redifing Assignment
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
Class Simulator Class Simulator
Class Program -superclass NSObject Class Program -superclass NSObject
Class Disk -superclass NSObject Class Disk -superclass NSObject
Class Custom -superclass NSObject
Class EventGroup -superclass NSObject Class EventGroup -superclass NSObject
Class Firewall -superclass NSObject Class Firewall -superclass NSObject
...@@ -73,6 +74,10 @@ Simulator instproc init {args} { ...@@ -73,6 +74,10 @@ Simulator instproc init {args} {
$self instvar disk_list; $self instvar disk_list;
array set disk_list {} array set disk_list {}
# Custom list.
$self instvar custom_list;
array set custom_list {}
# EventGroup list. # EventGroup list.
$self instvar eventgroup_list; $self instvar eventgroup_list;
array set eventgroup_list {} array set eventgroup_list {}
...@@ -401,6 +406,7 @@ Simulator instproc run {} { ...@@ -401,6 +406,7 @@ Simulator instproc run {} {
$self instvar event_list $self instvar event_list
$self instvar prog_list $self instvar prog_list
$self instvar disk_list $self instvar disk_list
$self instvar custom_list
$self instvar eventgroup_list $self instvar eventgroup_list
$self instvar firewall_list $self instvar firewall_list
$self instvar timeline_list $self instvar timeline_list
...@@ -625,6 +631,9 @@ Simulator instproc run {} { ...@@ -625,6 +631,9 @@ Simulator instproc run {} {
foreach disk [array names disk_list] { foreach disk [array names disk_list] {
$disk updatedb "sql" $disk updatedb "sql"
} }
foreach custom [array names custom_list] {
$custom updatedb "sql"
}
foreach egroup [array names eventgroup_list] { foreach egroup [array names eventgroup_list] {
$egroup updatedb "sql" $egroup updatedb "sql"
} }
...@@ -1028,6 +1037,12 @@ Simulator instproc rename_disk {old new} { ...@@ -1028,6 +1037,12 @@ Simulator instproc rename_disk {old new} {
set disk_list($new) {} set disk_list($new) {}
} }
Simulator instproc rename_custom {old new} {
$self instvar custom_list
unset custom_list($old)
set custom_list($new) {}
}
Simulator instproc rename_eventgroup {old new} { Simulator instproc rename_eventgroup {old new} {
$self instvar eventgroup_list $self instvar eventgroup_list
unset eventgroup_list($old) unset eventgroup_list($old)
...@@ -1232,6 +1247,13 @@ Simulator instproc add_disk {disk} { ...@@ -1232,6 +1247,13 @@ Simulator instproc add_disk {disk} {
set disk_list($disk) {} set disk_list($disk) {}
} }
# add_custom
# Link to a new custom object.
Simulator instproc add_custom {custom} {
$self instvar custom_list
set custom_list($custom) {}
}
# add_eventgroup # add_eventgroup
# Link to a EventGroup object. # Link to a EventGroup object.
Simulator instproc add_eventgroup {group} { Simulator instproc add_eventgroup {group} {
...@@ -1800,6 +1822,39 @@ Simulator instproc make_event {outer event} { ...@@ -1800,6 +1822,39 @@ Simulator instproc make_event {outer event} {
} }
} }
} }
# Modify this as you need.
"Custom" {
set otype CUSTOM
set vname $obj
set vnode [$obj set node]
switch -- $cmd {
"start" {
set etype START
set default_cmd [$obj set name]
set args $default_cmd
#DEBUG
puts stdout "START: $args"
}
"create" {
set etype CREATE
set default_cmd [$obj set name]
set args $default_cmd
#DEBUG
puts stdout "CREATE: $args"
}
"modify" {
set etype MODIFY
set default_cmd [$obj set name]
set args $default_cmd
#DEBUG
puts stdout "MODIFY: $args"
}
unknown {
punsup "$obj $cmd $args"
return
}
}
}
"Console" { "Console" {
set otype CONSOLE set otype CONSOLE
set vname $obj set vname $obj
......
Markdown is supported
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