#include <Cli.h>
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. | |
NetSniff * | netsnf |
Network sniffer instance. | |
Configuration * | conf |
Configuration class instance. | |
Debug * | dbg |
Debug class instance. |
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.
Definition at line 24 of file Cli.h.
Cli::Cli | ( | Configuration | cfg, | |
NetSniff * | netsnf | |||
) |
Cli default constructor.
cfg | Configuration for Cli settings | |
netsnf | Actual sniffer instance |
Cli::~Cli | ( | ) | [virtual] |
void Cli::DebugCmd | ( | string | args | ) | [private] |
Debug command.
args | for Debug command |
void Cli::DisplayHelp | ( | string | args | ) | [private] |
Display Help command.
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.
cmd | String contaning command to execute | |
args | Arguments for this command |
Referenced by MainLoop().
bool Cli::SetDebugger | ( | Debug * | debugger | ) |
void Cli::SnifferCmd | ( | string | args | ) | [private] |
Sniffer command.
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
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.
args | for Verbosity command |
Configuration* Cli::conf [private] |
Debug* Cli::dbg [private] |
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] |
string Cli::prompt [private] |