00001
00002
00006 #ifndef __SHEPP_GLOBAL_H__
00007 #define __SHEPP_GLOBAL_H__
00008
00009 #include <string>
00010 #include <memory>
00011
00012 #include "libepp_nicbr.H"
00013 #include "Session.H"
00014
00015 #include "SheppCommand.H"
00016
00017 #define SHEPP_VERSION "1.8"
00018 #define DEFAULT_PORT 700
00019 #define CLIENT_PEM SSLCERTDIR "/client.pem"
00020 #define ROOT_PEM SSLCERTDIR "/root.pem"
00021
00022
00023 #define MAX_TERM_DEV_LINE_SIZE 4096
00024
00025
00026
00027 #define MAX_WORD_LENGTH 2048
00028
00029 #include <list>
00030
00031 using std::list;
00032 using std::string;
00033 using std::auto_ptr;
00034
00035 LIBEPP_NICBR_NS_USE
00036
00038 list<SheppCommand> _commands;
00039
00041 string _server = "localhost";
00042 int _port = DEFAULT_PORT;
00043 string _user = "test";
00044 string _passphrase = "client passphrase";
00045 string _client_pem = CLIENT_PEM;
00046 string _root_pem = ROOT_PEM;
00047 bool _connected = false;
00048
00049 string _login_pw = "";
00050 string _login_new_pw = "";
00051 bool _new_pw = false;
00052 string _lang = "";
00053
00054 bool _beauty = true;
00055 bool _debug = false;
00056 bool _autorsp = true;
00057
00058 bool _keepalive = false;
00059 bool _ka_running = false;
00060 bool _cmd_running= false;
00061 static int _keepalive_timer = 180;
00062
00063 bool _peer_crt_check = true;
00064
00065 string _xmlrsp = "";
00066 string _xmlcmd = "";
00067
00069 auto_ptr<Session> _session;
00070
00072 void about()
00073 {
00074 printf("shepp version " SHEPP_VERSION ", an EPP client shell!\n");
00075 printf("Copyright 2006-2009 Registro.br <libepp@registro.br>\n");
00076 printf("shepp is distributed with libepp-nicbr: "
00077 "http://registro.br/epp/index-EN.html\n");
00078
00079 set<string> extensions;
00080
00081 #if USE_BR_ORG
00082 extensions.insert("brorg");
00083 #endif //USE_BR_ORG
00084 #if USE_BR_DOMAINS
00085 extensions.insert("brdomain");
00086 #endif //USE_BR_DOMAINS
00087 #if USE_IP_MANAGEMENT
00088 extensions.insert("ipnetwork");
00089 extensions.insert("asn");
00090 #endif //USE_IP_MANAGEMENT
00091
00092 printf("extensions: ");
00093 if (!extensions.empty()) {
00094 set<string>::iterator ext;
00095 for (ext = extensions.begin(); ext != extensions.end(); ext++) {
00096 printf("%s ", (*ext).c_str());
00097 }
00098 printf("\n");
00099 } else {
00100 printf("(none)\n");
00101 }
00102 }
00103 #endif //__SHEPP_GLOBAL_H__