Link Search Menu Expand Document

OpenDTN TCL Interpreter Commands

Command dtn::interface

Use to configure interfaces on the local node for receiving bundles.

This command may be issued interactively or via script.

Subcommands

dtn::interface add <if_name> <clm> <ip> <port>

  • if_name is a user given string representation of an interface.
  • 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::interface del <if_name>

dtn::interface delete <if_name>

  • if_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::interface enable <if_name>

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

Enabling an interface causes opendtnd to create an interface with the configured parameters of the given interface.

dtn::interface disable <if_name>

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

Disabling an interface causes opendtnd to shutdown the named interface.

dtn::interface fetch <if_name>

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

Retrieves a dictionary object for the given interface.

Examples

dtn::interface add <if_name> <clm> <ip> <port>

set id [dtn::interface add "udp0" udpclm "10.0.20.10" 4556]

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

dtn::interface del <if_name>

dtn::interface delete <if_name>

set result [dtn::interface del "udp0"]

if {$result < 0} {
	puts "Error: del interface"
} else {
	puts "Deleted interface "udp0"
}

dtn::interface enable <if_name>

set if_name "udp0"

set result [dtn::interface enable $if_name]

if {$result < 0} {
	puts "Error: enable interface"
} else {
	puts "Interface $if_name enabled"
}

dtn::interface disable <if_name>

set if_name "udp0"

set result [dtn::interface disable $if_name]

if {$result < 0} {
	puts "Error: disable interface"
} else {
	puts "Interface $if_name disabled"
}

dtn::interface fetch <if_name>

set if_name "udp0"

set result [dtn::interface 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"
	}
}