Cli Class Reference

Command Line Interface class. More...

#include <Cli.h>

Collaboration diagram for Cli:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Cli (Configuration cfg, NetSniff *netsnf)
 Cli default constructor.
virtual ~Cli ()
 Cli default destructor.
void MainLoop ()
 Command parsing and executing Main Loop.
bool SetDebugger (Debug *debugger)
 Set Debug for Cli.

Private Member Functions

void ProcessCommand (string cmd, string args)
 Process a command.
void DisplayHelp (string args)
 Display Help command.
void DebugCmd (string args)
 Debug command.
void VerbosityCmd (string args)
 Verbosity command.
void SnifferCmd (string args)
 Sniffer command.
void SplitStr (string str, string *keyword, string *args)
 Split a command string.

Private Attributes

string prompt
 String to display at prompt.
string hcmdpath
 String containing path to help files for commands.
NetSniffnetsnf
 Network sniffer instance.
Configurationconf
 Configuration class instance.
Debug * dbg
 Debug class instance.


Detailed Description

Command Line Interface class.

This id the CLI (Command Line Interface class) and is the last one loaded on voiphoney startup. This class provides a command line interface through readline library and parses user commands for adjusting voiphoney parameters in real time mode.

Warning:
Notice that this class is only loaded when not running on background

Definition at line 24 of file Cli.h.


Constructor & Destructor Documentation

Cli::Cli ( Configuration  cfg,
NetSniff netsnf 
)

Cli default constructor.

Parameters:
cfg Configuration for Cli settings
netsnf Actual sniffer instance

Cli::~Cli (  )  [virtual]

Cli default destructor.

Definition at line 256 of file Cli.cc.

References dbg.


Member Function Documentation

void Cli::DebugCmd ( string  args  )  [private]

Debug command.

Parameters:
args for Debug command

void Cli::DisplayHelp ( string  args  )  [private]

Display Help command.

Parameters:
args for Help command

void Cli::MainLoop (  ) 

Command parsing and executing Main Loop.

Definition at line 38 of file Cli.cc.

References hcmdpath, ProcessCommand(), prompt, and SplitStr().

Referenced by main().

void Cli::ProcessCommand ( string  cmd,
string  args 
) [private]

Process a command.

Parameters:
cmd String contaning command to execute
args Arguments for this command

Referenced by MainLoop().

bool Cli::SetDebugger ( Debug *  debugger  ) 

Set Debug for Cli.

Parameters:
debugger Debug instance

Definition at line 29 of file Cli.cc.

References dbg.

Referenced by main().

void Cli::SnifferCmd ( string  args  )  [private]

Sniffer command.

Parameters:
args for Sniffer command

void Cli::SplitStr ( string  str,
string *  keyword,
string *  args 
) [private]

Split a command string.

This method splits command string between keyword (the command itself) and args (arguments) for this command

Parameters:
str String contaning command content
keyword String to put the command itself
args String to put command arguments alone

Referenced by MainLoop().

void Cli::VerbosityCmd ( string  args  )  [private]

Verbosity command.

Parameters:
args for Verbosity command


Member Data Documentation

Configuration class instance.

Definition at line 77 of file Cli.h.

Debug* Cli::dbg [private]

Debug class instance.

Definition at line 79 of file Cli.h.

Referenced by SetDebugger(), and ~Cli().

string Cli::hcmdpath [private]

String containing path to help files for commands.

Definition at line 47 of file Cli.h.

Referenced by MainLoop().

NetSniff* Cli::netsnf [private]

Network sniffer instance.

Definition at line 75 of file Cli.h.

string Cli::prompt [private]

String to display at prompt.

Definition at line 45 of file Cli.h.

Referenced by MainLoop().


The documentation for this class was generated from the following files:

VoipHoney is proudly sponsored by OpenVoIP

This documentation has been generated using doxygen 1.5.8