Link Search Menu Expand Document

OpenDTN TCL Interpreter Commands

Command dtn::link

Use to configure links on the local node for sending bundles.

This command may be issued interactively or via script.

Subcommands

dtn::link add <lnk_name> <clm> <ip> <port>

  • lnk_name is a user given string representation of a link.
  • clm is the convergence layer module used to receive bundles.
  • 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::link del <lnk_name>

dtn::link delete <lnk_name>

  • lnk_name was given by the add subcommand. Either del or delete can be used. del returns 0 upon success, otherwise -1.

Returns 0 upon success, otherwise returns -1.

dtn::link enable <lnk_name>

  • lnk_name was given by the add subcommand. enable returns 0 upon success, otherwise -1.

Enabling a link causes opendtnd to create a link with the configured parameters of the given link.

dtn::link disable <lnk_name>

  • lnk_name was given by the add subcommand. disable returns 0 upon success, otherwise -1.

Disabling a link causes opendtnd to shutdown the named link.

dtn::link fetch <lnk_name>

  • lnk_name was to have been created via the add subcommand.

Retrieves a dictionary object for the given link.

Examples

dtn::link add <lnk_name> <clm> <ip> <port>

set id [dtn::link add "lnk_udp0" udpclm "10.0.20.10" 4556]

if {$id < 0} {
	puts "Error: add link"
} else {
	puts "Added link with id: $id"
}

dtn::link del <lnk_name>

dtn::link delete <lnk_name>

set result [dtn::link del "lnk_udp0"]

if {$result < 0} {
	puts "Error: del link"
} else {
	puts "Deleted link "lnk_udp0"
}

dtn::link enable <lnk_name>

set lnk_name "lnk_udp0"

set result [dtn::link enable $lnk_name]

if {$result < 0} {
	puts "Error: enable link"
} else {
	puts "Interface $lnk_name enabled"
}

dtn::link disable <lnk_name>

set lnk_name "lnk_udp0"

set result [dtn::link disable $lnk_name]

if {$result < 0} {
	puts "Error: disable link"
} else {
	puts "Interface $lnk_name disabled"
}

dtn::link fetch <lnk_name>

set lnk_name "lnk_udp0"

set result [dtn::link fetch $lnk_name]

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