Interface to network animator. More...
#include <animation-interface.h>
Public Member Functions | |
AnimationInterface () | |
Construct the animator interface. No arguments needed. | |
bool | SetOutputFile (const std::string &fn) |
Specify that animation commands are to be written to the specified output file. | |
bool | SetServerPort (uint16_t port) |
Specify that animation commands are to be written to a socket. | |
bool | SetInternalAnimation () |
Specify that animation window is to be created as part of the ns3 process. | |
void | StartAnimation () |
Writes the topology information and sets up the appropriate animation packet tx callback. | |
void | StopAnimation () |
Closes the interface to the animator. |
Interface to network animator.
Provides functions that facilitate communications with an external or internal network animator.
bool ns3::AnimationInterface::SetInternalAnimation | ( | ) |
bool ns3::AnimationInterface::SetOutputFile | ( | const std::string & | fn | ) |
Specify that animation commands are to be written to the specified output file.
This call is used to write the animation information to a text file that can later be used as input to the network animator tool.
fn | The name of the output file. |
bool ns3::AnimationInterface::SetServerPort | ( | uint16_t | port | ) |
Specify that animation commands are to be written to a socket.
This call is used to set the ns3 process in server mode, waiting for a TCP connection from the animator. This call will not return until the animator connects in, or if the bind to the specified port fails.
port | Port number to bind to. |
void ns3::AnimationInterface::StartAnimation | ( | ) |
Writes the topology information and sets up the appropriate animation packet tx callback.
Writes the topology information to the appropriate output, depending on prior calls to SetOutputFile, SetServerPort, or SetInternalAnimation. Then creates the callbacks needed for the animator to start processing packets.