All Classes Namespaces Files Functions Pages
Examples

This page contains a list of common tasks and the corresponding Tcl code snippets.

Note there are also a number of extended examples as well, which show how specific scenario configurations can be constructed using this API.

Port configuration: Setting the MAC address

To quickly set a MAC address, you can use the following one liner:

1 [ $port Layer2.EthII.Set ] Mac.Set "00:FF:22:AB:CD:EF"

The inner part of this statement sets the layer 2 protocol to EthII. It immediatly returns the created Layer2.EthernetII object. On this object the Mac is then set to the value of choice.

The MAC string can be entered in a variety of formats: uppercase or lowercase and seperated by dashed (-), colons (:) or nothing.

Extended Examples

In addition to the short examples listed on this page, this documentation provides some extended examples. These examples describe how specific test configurations (e.g. udp, tcp, multicast, ...) are structured.

They have a tutorial-like approach and provide a good introduction to how the Tcl API can (and should!) be used in some specific situation.

See Extended Examples for a list of such extended examples.