NetSim Source Code Help
Loading...
Searching...
No Matches
CLI.h File Reference
#include "CLIInterface.h"
Include dependency graph for CLI.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  stru_headingInfo
 
struct  stru_fileClientInfo
 
struct  stru_sockClientInfo
 
struct  stru_stringClientInfo
 
struct  stru_clientInfo
 
union  stru_clientInfo::client
 
struct  str_cli_handle
 

Macros

#define NETSIM_ID   UINT
 
#define DEFAULT_PROMPT   "NetSim"
 
#define CMD_CHANGEPROMPT   "CHANGEPROMPT"
 
#define CMD_STOP   "STOP"
 
#define CMD_CONTINUE   "CONTINUE"
 
#define CMD_PAUSE   "PAUSE"
 
#define CMD_PAUSEAT   "PAUSEAT"
 
#define CMD_EXIT   "EXIT"
 
#define CMD_ACLCONFIG   "ACLCONFIG"
 
#define CLIHANDLE   ptrCLIHANDLE
 

Typedefs

typedef enum enum_clientType CLIENTTYPE
 
typedef struct stru_headingInfo HEADINGINFO
 
typedef struct stru_headingInfoptrHEADINGINFO
 
typedef struct stru_fileClientInfo FILECLIENTINFO
 
typedef struct stru_fileClientInfoptrFILECLIENTINFO
 
typedef struct stru_sockClientInfo SOCKCLIENTINFO
 
typedef struct stru_sockClientInfoptrSOCKCLIENTINFO
 
typedef struct stru_stringClientInfo STRINGCLIENTINFO
 
typedef struct stru_stringClientInfoptrSTRINGCLIENTINFO
 
typedef struct stru_clientInfo CLIENTINFO
 
typedef struct stru_clientInfoptrCLIENTINFO
 
typedef struct str_cli_handleptrCLIHANDLE
 

Enumerations

enum  enum_clientType { CLIENTTYPE_NONE , CLIENTTYPE_FILE , CLIENTTYPE_SOCKET , CLIENTTYPE_STRING }
 
enum  HT { HT_NONE , HT_DEVICE , HT_CMD }
 

Functions

void free_commandArray (ptrCOMMANDARRAY c)
 
void * add_new_socket_client (SOCKET s, char *name)
 
void process_command (ptrCLIENTINFO clientInfo, char *command, int len)
 
void send_to_socket (ptrCLIENTINFO info, char *buf, int len)
 
void write_to_file (ptrCLIENTINFO info, char *msg, int len)
 
void send_message (ptrCLIENTINFO info, char *msg,...)
 
void cli_stop_simulation (ptrCLIENTINFO info)
 
void cli_pause_simulation (ptrCLIENTINFO info)
 
void cli_continue_simulation (ptrCLIENTINFO info)
 
void cli_pause_simulation_at (ptrCLIENTINFO info, double time)
 
bool validate_command (ptrCLIENTINFO info, ptrCOMMANDARRAY command)
 
void cli_clear_prompt (ptrCLIENTINFO info)
 
void execute_command (ptrCLIENTINFO info, ptrCOMMANDARRAY command, NETSIM_ID d)
 
void pass_to_SDNModule (ptrCLIENTINFO info, ptrCOMMANDARRAY command)
 
bool validate_route_command (ptrCLIENTINFO info, ptrCOMMANDARRAY command, int index)
 
void execute_route_command (ptrCLIENTINFO info, ptrCOMMANDARRAY command, int index, NETSIM_ID d)
 
bool validate_acl_command (ptrCLIENTINFO info, ptrCOMMANDARRAY command, int index)
 
void execute_acl_command (ptrCLIENTINFO info, ptrCOMMANDARRAY command, int index, NETSIM_ID d)
 
void execute_aclconfig_command (ptrCLIENTINFO info, ptrCOMMANDARRAY command, int index, NETSIM_ID d)
 
bool validate_aclconfig_command (ptrCLIENTINFO info, ptrCOMMANDARRAY command, int index)
 
void execute_prompt_aclconfig_command (ptrCLIENTINFO info, ptrCOMMANDARRAY command, int index, NETSIM_ID d)
 
bool validate_ping_command (ptrCLIENTINFO info, ptrCOMMANDARRAY command, int index)
 
void execute_ping_command (ptrCLIENTINFO info, ptrCOMMANDARRAY command, int index, NETSIM_ID d)
 
CLIHANDLE FORM_CLI_HANDLE (ptrCOMMANDARRAY cmd, ptrCLIENTINFO info)
 
int fn_NetSim_CLI_HandleTimerEvent ()
 
ptrCOMMANDARRAY get_commandArray (char *text)
 
bool isCommandAsDeviceName (char *name)
 
void set_fileClientInfo (ptrCLIENTINFO info)
 
ptrCLIENTINFO get_fileClientInfo ()
 
void read_file_and_execute (FILE *fp)
 
void add_to_string (ptrCLIENTINFO info, char *sendMsg, int len)
 

Macro Definition Documentation

◆ CLIHANDLE

#define CLIHANDLE   ptrCLIHANDLE

Definition at line 95 of file CLI.h.

◆ CMD_ACLCONFIG

#define CMD_ACLCONFIG   "ACLCONFIG"

Definition at line 18 of file CLI.h.

◆ CMD_CHANGEPROMPT

#define CMD_CHANGEPROMPT   "CHANGEPROMPT"

Definition at line 12 of file CLI.h.

◆ CMD_CONTINUE

#define CMD_CONTINUE   "CONTINUE"

Definition at line 14 of file CLI.h.

◆ CMD_EXIT

#define CMD_EXIT   "EXIT"

Definition at line 17 of file CLI.h.

◆ CMD_PAUSE

#define CMD_PAUSE   "PAUSE"

Definition at line 15 of file CLI.h.

◆ CMD_PAUSEAT

#define CMD_PAUSEAT   "PAUSEAT"

Definition at line 16 of file CLI.h.

◆ CMD_STOP

#define CMD_STOP   "STOP"

Definition at line 13 of file CLI.h.

◆ DEFAULT_PROMPT

#define DEFAULT_PROMPT   "NetSim"

Definition at line 10 of file CLI.h.

◆ NETSIM_ID

#define NETSIM_ID   UINT

Definition at line 7 of file CLI.h.

Typedef Documentation

◆ CLIENTINFO

typedef struct stru_clientInfo CLIENTINFO

◆ CLIENTTYPE

◆ FILECLIENTINFO

◆ HEADINGINFO

typedef struct stru_headingInfo HEADINGINFO

◆ ptrCLIENTINFO

typedef struct stru_clientInfo * ptrCLIENTINFO

◆ ptrCLIHANDLE

typedef struct str_cli_handle* ptrCLIHANDLE

◆ ptrFILECLIENTINFO

◆ ptrHEADINGINFO

◆ ptrSOCKCLIENTINFO

◆ ptrSTRINGCLIENTINFO

◆ SOCKCLIENTINFO

◆ STRINGCLIENTINFO

Enumeration Type Documentation

◆ enum_clientType

Enumerator
CLIENTTYPE_NONE 
CLIENTTYPE_FILE 
CLIENTTYPE_SOCKET 
CLIENTTYPE_STRING 

Definition at line 22 of file CLI.h.

◆ HT

enum HT
Enumerator
HT_NONE 
HT_DEVICE 
HT_CMD 

Definition at line 30 of file CLI.h.

Function Documentation

◆ add_new_socket_client()

void * add_new_socket_client ( SOCKET  s,
char *  name 
)

Definition at line 19 of file CLIInterpretor.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_to_string()

void add_to_string ( ptrCLIENTINFO  info,
char *  sendMsg,
int  len 
)

Definition at line 210 of file CLIInterpretor.c.

Here is the caller graph for this function:

◆ cli_clear_prompt()

void cli_clear_prompt ( ptrCLIENTINFO  info)

Definition at line 72 of file SimProcessInterpretor.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cli_continue_simulation()

void cli_continue_simulation ( ptrCLIENTINFO  info)

Definition at line 59 of file SimProcessInterpretor.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cli_pause_simulation()

void cli_pause_simulation ( ptrCLIENTINFO  info)

Definition at line 45 of file SimProcessInterpretor.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cli_pause_simulation_at()

void cli_pause_simulation_at ( ptrCLIENTINFO  info,
double  time 
)

Definition at line 29 of file SimProcessInterpretor.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cli_stop_simulation()

void cli_stop_simulation ( ptrCLIENTINFO  info)

Definition at line 18 of file SimProcessInterpretor.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ execute_acl_command()

void execute_acl_command ( ptrCLIENTINFO  info,
ptrCOMMANDARRAY  command,
int  index,
NETSIM_ID  d 
)

Definition at line 35 of file ACLCommand.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ execute_aclconfig_command()

void execute_aclconfig_command ( ptrCLIENTINFO  info,
ptrCOMMANDARRAY  command,
int  index,
NETSIM_ID  d 
)

Definition at line 59 of file ACLCommand.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ execute_command()

void execute_command ( ptrCLIENTINFO  info,
ptrCOMMANDARRAY  command,
NETSIM_ID  d 
)

Definition at line 60 of file SimulationCommand.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ execute_ping_command()

void execute_ping_command ( ptrCLIENTINFO  info,
ptrCOMMANDARRAY  command,
int  index,
NETSIM_ID  d 
)

Definition at line 64 of file Ping.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ execute_prompt_aclconfig_command()

void execute_prompt_aclconfig_command ( ptrCLIENTINFO  info,
ptrCOMMANDARRAY  command,
int  index,
NETSIM_ID  d 
)

Definition at line 139 of file ACLCommand.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ execute_route_command()

void execute_route_command ( ptrCLIENTINFO  info,
ptrCOMMANDARRAY  command,
int  index,
NETSIM_ID  d 
)

Definition at line 150 of file RouteCommand.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fn_NetSim_CLI_HandleTimerEvent()

int fn_NetSim_CLI_HandleTimerEvent ( )

Definition at line 203 of file CLIInterpretor.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FORM_CLI_HANDLE()

CLIHANDLE FORM_CLI_HANDLE ( ptrCOMMANDARRAY  cmd,
ptrCLIENTINFO  info 
)

Definition at line 123 of file CLIInterpretor.c.

Here is the caller graph for this function:

◆ free_commandArray()

void free_commandArray ( ptrCOMMANDARRAY  c)

Definition at line 61 of file Command.c.

Here is the caller graph for this function:

◆ get_commandArray()

ptrCOMMANDARRAY get_commandArray ( char *  text)

Definition at line 13 of file Command.c.

Here is the caller graph for this function:

◆ get_fileClientInfo()

ptrCLIENTINFO get_fileClientInfo ( )

Definition at line 26 of file FileInput.c.

Here is the caller graph for this function:

◆ isCommandAsDeviceName()

bool isCommandAsDeviceName ( char *  name)

Definition at line 18 of file SimulationCommand.c.

Here is the caller graph for this function:

◆ pass_to_SDNModule()

void pass_to_SDNModule ( ptrCLIENTINFO  info,
ptrCOMMANDARRAY  command 
)

Definition at line 88 of file SimulationCommand.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ process_command()

void process_command ( ptrCLIENTINFO  clientInfo,
char *  command,
int  len 
)

Definition at line 56 of file commandProcessor.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_file_and_execute()

void read_file_and_execute ( FILE *  fp)

Definition at line 31 of file FileInput.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_message()

void send_message ( ptrCLIENTINFO  info,
char *  msg,
  ... 
)

Definition at line 10 of file commandProcessor.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_to_socket()

void send_to_socket ( ptrCLIENTINFO  info,
char *  buf,
int  len 
)

Definition at line 22 of file Socket.c.

Here is the caller graph for this function:

◆ set_fileClientInfo()

void set_fileClientInfo ( ptrCLIENTINFO  info)

Definition at line 21 of file FileInput.c.

Here is the caller graph for this function:

◆ validate_acl_command()

bool validate_acl_command ( ptrCLIENTINFO  info,
ptrCOMMANDARRAY  command,
int  index 
)

Definition at line 49 of file ACLCommand.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ validate_aclconfig_command()

bool validate_aclconfig_command ( ptrCLIENTINFO  info,
ptrCOMMANDARRAY  command,
int  index 
)

Definition at line 95 of file ACLCommand.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ validate_command()

bool validate_command ( ptrCLIENTINFO  info,
ptrCOMMANDARRAY  command 
)

Definition at line 29 of file SimulationCommand.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ validate_ping_command()

bool validate_ping_command ( ptrCLIENTINFO  info,
ptrCOMMANDARRAY  command,
int  index 
)

Definition at line 21 of file Ping.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ validate_route_command()

bool validate_route_command ( ptrCLIENTINFO  info,
ptrCOMMANDARRAY  command,
int  index 
)

Definition at line 35 of file RouteCommand.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_to_file()

void write_to_file ( ptrCLIENTINFO  info,
char *  msg,
int  len 
)

Definition at line 93 of file FileInput.c.

Here is the caller graph for this function: