src/shepp/SheppCommandFunctions.H File Reference

EPP command-line shell client command functions include file. More...

#include <fstream>
#include <unistd.h>
#include <termios.h>
#include <iostream>
#include "SheppGlobal.H"
#include "SheppStrUtil.H"
#include "SheppObjSet.H"
#include "SheppPrint.H"
#include "IoException.H"
#include "TransportException.H"
#include "EppException.H"
#include "XmlException.H"
#include "Login.H"
#include "Logout.H"

Go to the source code of this file.

Functions

int cmd_source (vector< string > &)
int cmd_login (vector< string > &args)
 Send an EPP Login.
int cmd_logout (vector< string > &args)
 Send an EPP Logout.
int cmd_hello (vector< string > &args)
 Send an EPP HELLO.
int cmd_poll (vector< string > &)
 main poll command
int cmd_domain (vector< string > &)
 main domain command
int cmd_contact (vector< string > &)
 main contact command
int cmd_xmlcmd (vector< string > &args)
 Shows last XML command.
int cmd_xmlrsp (vector< string > &args)
 Shows last XML response.
int cmd_runxml (vector< string > &args)
 Run XML input command.
int cmd_server (vector< string > &args)
 Sets server address [and port] based on input command-line.
int cmd_port (vector< string > &args)
 Sets server port based on input command-line.
int cmd_client_pem (vector< string > &args)
 Sets client.pem certificate file location.
int cmd_root_pem (vector< string > &args)
 Sets root.pem certificate file location.
int cmd_pass (vector< string > &args)
 Sets SSL certificate passphrase based on input command-line.
int cmd_user (vector< string > &args)
 Sets login user based on input command-line.
int cmd_login_pw (vector< string > &args)
 Sets EPP login password based on input command-line.
int cmd_login_new_pw (vector< string > &args)
 Sets new EPP login password based on input command-line.
int cmd_lang (vector< string > &args)
 Sets text language based on input command-line.
int cmd_connect (vector< string > &args)
 Connects to previously specified server and port.
int cmd_disconnect (vector< string > &args)
 Closes connection.
int cmd_help (vector< string > &args)
 Prints help.
int cmd_about (vector< string > &args)
 Prints version information.
int cmd_quit (vector< string > &args)
 Leaves shepp.
int cmd_beauty (vector< string > &args)
 Turns XML beautifier ON and OFF.
int cmd_debug (vector< string > &args)
 Turns debug messages ON and OFF.
int cmd_autorsp (vector< string > &args)
 Turns auto-show response ON and OFF.
int cmd_keepalive (vector< string > &args)
 Turns keep-alive ON and OFF.
int cmd_peer_crt_check (vector< string > &args)
 Turn peer's certificate check ON and OFF.
string getpasswd (string prompt)
 Function to read from stdin without echoing.
void init_commands ()
 Populates set of available commands.
const SheppCommandfind_command (string name)
 Given a word check if it's a valid SheppCommand.
int executeInputFile (const string &file)
void print_cmd_sent_ok ()
 Prints "command sent ok" message.
int process_action (Action &act)
 Send and EPP Action.

Detailed Description

EPP command-line shell client command functions include file.


Function Documentation

int cmd_about ( vector< string > &  args  ) 

Prints version information.

Parameters:
args input command-line
Returns:
0 if ok, -1 otherwise

References about().

Referenced by init_commands().

int cmd_autorsp ( vector< string > &  args  ) 

Turns auto-show response ON and OFF.

Parameters:
args input command-line
Returns:
0 if ok, -1 otherwise

Referenced by init_commands().

int cmd_beauty ( vector< string > &  args  ) 

Turns XML beautifier ON and OFF.

Parameters:
args input command-line
Returns:
0 if ok, -1 otherwise

Referenced by init_commands().

int cmd_client_pem ( vector< string > &  args  ) 

Sets client.pem certificate file location.

Parameters:
args input command-line
Returns:
0 if ok, -1 otherwise

Referenced by init_commands().

int cmd_connect ( vector< string > &  args  ) 

Connects to previously specified server and port.

Parameters:
args input command-line
Returns:
0 if ok, -1 otherwise

References _server, _session, cmd_server(), cmd_xmlrsp(), GeneralException::get_code(), GeneralException::get_low_level_msg(), and GeneralException::get_msg().

Referenced by init_commands().

int cmd_contact ( vector< string > &  args  ) 

main contact command

Parameters:
arg command-line input arguments
Returns:
0 if ok, -1 otherwise

References cmd_contact_check(), cmd_contact_create(), cmd_contact_delete(), cmd_contact_help(), cmd_contact_info(), cmd_contact_renew(), cmd_contact_transfer(), and cmd_contact_update().

Referenced by init_commands().

int cmd_debug ( vector< string > &  args  ) 

Turns debug messages ON and OFF.

Parameters:
args input command-line
Returns:
0 if ok, -1 otherwise

Referenced by init_commands().

int cmd_disconnect ( vector< string > &  args  ) 

Closes connection.

Parameters:
args input command-line
Returns:
0 if ok, -1 otherwise

References _server, _session, GeneralException::get_code(), GeneralException::get_low_level_msg(), and GeneralException::get_msg().

Referenced by init_commands().

int cmd_domain ( vector< string > &  args  ) 

main domain command

Parameters:
arg command-line input arguments
Returns:
0 if ok, -1 otherwise

References cmd_domain_check(), cmd_domain_create(), cmd_domain_delete(), cmd_domain_help(), cmd_domain_info(), cmd_domain_renew(), cmd_domain_transfer(), and cmd_domain_update().

Referenced by init_commands().

int cmd_hello ( vector< string > &  args  ) 

Send an EPP HELLO.

Parameters:
args input command-line
Returns:
0 if ok, -1 otherwise

References _session, GeneralException::get_code(), GeneralException::get_low_level_msg(), GeneralException::get_msg(), and print_cmd_sent_ok().

Referenced by init_commands().

int cmd_help ( vector< string > &  args  ) 

Prints help.

Parameters:
args input command-line
Returns:
0 if ok, -1 otherwise

References _commands.

Referenced by init_commands().

int cmd_keepalive ( vector< string > &  args  ) 

Turns keep-alive ON and OFF.

Parameters:
args input command-line
Returns:
0 if ok, -1 otherwise

Referenced by init_commands().

int cmd_lang ( vector< string > &  args  ) 

Sets text language based on input command-line.

Parameters:
args input command-line
Returns:
0 if ok, -1 otherwise

Referenced by init_commands().

int cmd_login ( vector< string > &  args  ) 

Send an EPP Login.

Parameters:
args input command-line
Returns:
0 if ok, -1 otherwise

References LoginCmd::add_extURI(), Login::get_command(), process_action(), LoginCmd::set_clID(), LoginCmd::set_lang(), LoginCmd::set_new_pw(), and LoginCmd::set_pw().

Referenced by init_commands().

int cmd_login_new_pw ( vector< string > &  args  ) 

Sets new EPP login password based on input command-line.

Parameters:
args input command-line
Returns:
0 if ok, -1 otherwise

References getpasswd().

Referenced by init_commands().

int cmd_login_pw ( vector< string > &  args  ) 

Sets EPP login password based on input command-line.

Parameters:
args input command-line
Returns:
0 if ok, -1 otherwise

References getpasswd().

Referenced by init_commands().

int cmd_logout ( vector< string > &  args  ) 

Send an EPP Logout.

Parameters:
args input command-line
Returns:
0 if ok, -1 otherwise

References process_action().

Referenced by init_commands().

int cmd_pass ( vector< string > &  args  ) 

Sets SSL certificate passphrase based on input command-line.

Parameters:
args input command-line
Returns:
0 if ok, -1 otherwise

References getpasswd().

Referenced by init_commands().

int cmd_peer_crt_check ( vector< string > &  args  ) 

Turn peer's certificate check ON and OFF.

Parameters:
args input command-line
Returns:
0 if ok, -1 otherwise

Referenced by init_commands().

int cmd_poll ( vector< string > &  args  ) 

main poll command

Parameters:
arg command-line input arguments
Returns:
0 if ok, -1 otherwise

References cmd_poll_help(), Poll::get_command(), PollCmd::get_msgID(), PollCmd::get_op(), process_action(), PollCmd::set_msgID(), and PollCmd::set_op().

Referenced by init_commands().

int cmd_port ( vector< string > &  args  ) 

Sets server port based on input command-line.

Parameters:
args input command-line
Returns:
0 if ok, -1 otherwise

Referenced by init_commands().

int cmd_quit ( vector< string > &  args  ) 

Leaves shepp.

Parameters:
args input command-line
Returns:
0 if ok, -1 otherwise

References _session.

Referenced by init_commands(), and main().

int cmd_root_pem ( vector< string > &  args  ) 

Sets root.pem certificate file location.

Parameters:
args input command-line
Returns:
0 if ok, -1 otherwise

Referenced by init_commands().

int cmd_runxml ( vector< string > &  args  ) 

Run XML input command.

Returns:
0 if ok, -1 otherwise

References _session, GeneralException::get_code(), GeneralException::get_low_level_msg(), GeneralException::get_msg(), and print_cmd_sent_ok().

Referenced by init_commands().

int cmd_server ( vector< string > &  args  ) 

Sets server address [and port] based on input command-line.

Parameters:
args input command-line
Returns:
0 if ok, -1 otherwise

References _server, and SheppStrUtil::split().

Referenced by cmd_connect(), init_commands(), and main().

int cmd_source ( vector< string > &  args  ) 

Given a input file, read and execute all shepp commands in this file

Parameters:
args input command-line
Returns:
0 if ok, -1 otherwise

References executeInputFile().

Referenced by init_commands().

int cmd_user ( vector< string > &  args  ) 

Sets login user based on input command-line.

Parameters:
args input command-line
Returns:
0 if ok, -1 otherwise

Referenced by init_commands().

int cmd_xmlcmd ( vector< string > &  args  ) 

Shows last XML command.

Parameters:
args input command-line
Returns:
0 if ok, -1 otherwise

References _session, GeneralException::get_code(), GeneralException::get_msg(), StrUtil::iso88591_to_utf8(), and StrUtil::xml_beautifier().

Referenced by init_commands().

int cmd_xmlrsp ( vector< string > &  args  ) 

Shows last XML response.

Parameters:
args input command-line
Returns:
0 if ok, -1 otherwise

References GeneralException::get_code(), GeneralException::get_msg(), and StrUtil::xml_beautifier().

Referenced by cmd_connect(), init_commands(), and print_cmd_sent_ok().

int executeInputFile ( const string &  file  ) 

Given a input file, read and execute all shepp commands in this file

Parameters:
inputFile input file with shepp commands
Returns:
0 if ok, -1 otherwise

References find_command(), SheppCommand::function, init_commands(), SheppStrUtil::parse_line(), and SheppStrUtil::trim().

Referenced by cmd_source(), and main().

const SheppCommand* find_command ( string  name  ) 

Given a word check if it's a valid SheppCommand.

Parameters:
name of command check validity
Returns:
pointer to a SheppCommand if found, NULL pointer if not found

References _commands.

Referenced by execute(), and executeInputFile().

string getpasswd ( string  prompt  ) 

Function to read from stdin without echoing.

Parameters:
prompt prompt to be echoed
Returns:
content read from stdin

Referenced by cmd_login_new_pw(), cmd_login_pw(), and cmd_pass().

int process_action ( Action act  ) 
Generated on Wed Aug 11 16:56:44 2010 for libepp_nicbr by  doxygen 1.6.3