Link Search Menu Expand Document

OpenDTN TCL Interpreter Commands

Command dtn::node

Configure endpoints on the local node for use by application agents.

This command may be issued interactively or via script.

Subcommands

dtn::node add <uri>

  • uri URI of the form scheme :// node_name / path. Currently, dtn is the only supported scheme. Returns a unique node id, otherwise -1 upon fail.

dtn::node del <node_id>

A node_id is returned by the del subcommand. Returns 0 upon success, otherwise -1.

dtn::endpoint fetch <if_name>

  • if_name is a user defined string identifier for an existing node.

Retrieves and returns a dictionary object for the given node id.

Examples

dtn::node add

set uri "dtn://node-20/send"

set id [dtn::node add $uri]

if {$id < 0} {
	puts "Error: dtn::node add"
} else {
	puts "New node with id: $id"
}

dtn::node del

set result [dtn::node del $id]

if {$result < 0} {
	puts "Error: dtn::node del"
} else {
	puts "Endpoint deleted with id: $id"
}

dtn::node fetch

Capture dictionary object and display values from keys.

set if_name "udp0"

set result [dtn::node fetch $if_name]

if {[dict size $result] == 0} {
	puts "if_name is not configured"
} else {
	foreach k [dict keys $result] {
		set v [dict get $result $k]
		puts "\t$k = $v"
	}
}