OpenDTN TCL Interpreter Commands
Command dtn::inbound
Configure inbound interfaces by constructing a socket which listen for the reception of bundles on the local node.
This command may be issued interactively or via script.
Subcommands
dtn::inbound add <in_name> <clm> <ip> <port>
Adds an interface to the database. At this point, the interface is only added, no socket is created and placed in operation.
- in_name is a user defined string naming a new interface.
- clm is the convergence layer module in use for this interface.
- ip is the local nodes ip address.
- port is the local node port used by this CLM.
Returns a unique id if successfully added, otherwise returns -1.
dtn::inbound delete <in_name>
Deletes an interface from the database. disable
should be called if an interface is in operation before calling delete
. Either del
or delete
may be used.
- in_name is a user defined string naming an existing interface.
Returns 0 upon success, otherwise returns -1.
dtn::inbound enable <in_name>
Once enabled, a new socket is created for the interface and placed in operation, listening for the reception of bundles.
- in_name is a user defined string naming an existing interface.
Returns 0 upon success, otherwise -1.
dtn::inbound disable <in_name>
Disabling an interface shuts down a running interface, the socket, in opendtnd
.
- in_name is a user defined string naming an existing interface.
Returns 0 upon success, otherwise -1.
dtn::inbound fetch <in_name>
Retrievs all the details for an interface in a dictionary object.
- in_name is a user defined string naming an existing interface.
Retrieves a dictionary object for the given interface.
Examples
dtn::inbound add <in_name> <clm> <ip> <port>
set id [dtn::inbound add "in_udp0" udpclm "10.0.20.10" 4556]
if {$id < 0} {
puts "Error: add interface"
} else {
puts "Added interface with id: $id"
}
dtn::inbound del <in_name>
dtn::inbound delete <in_name>
set result [dtn::inbound del "in_udp0"]
if {$result < 0} {
puts "Error: del interface"
} else {
puts "Deleted interface "in_udp0"
}
dtn::inbound enable <in_name>
set in_name "in_udp0"
set result [dtn::inbound enable $in_name]
if {$result < 0} {
puts "Error: enable interface"
} else {
puts "Interface $in_name enabled"
}
dtn::inbound disable <in_name>
set in_name "in_udp0"
set result [dtn::inbound disable $in_name]
if {$result < 0} {
puts "Error: disable interface"
} else {
puts "Interface $in_name disabled"
}
dtn::inbound fetch <in_name>
set in_name "in_udp0"
set result [dtn::inbound fetch $in_name]
if {[dict size $result] == 0} {
puts "$in_name is not configured"
} else {
foreach k [dict keys $result] {
set v [dict get $result $k]
puts "\t$k = $v"
}
}