libepp_nicbr
SheppGlobal.H
Go to the documentation of this file.
1 /* ${copyright}$ */
2 /* $Id: SheppGlobal.H 1128 2011-12-15 12:15:55Z rafael $ */
6 #ifndef __SHEPP_GLOBAL_H__
7 #define __SHEPP_GLOBAL_H__
8 
9 #include <string>
10 #include <memory>
11 
12 #include "libepp_nicbr.H"
13 #include "Session.H"
14 
15 #include "SheppCommand.H"
16 
17 #define DEFAULT_PORT 700
18 #define CLIENT_PEM SSLCERTDIR "/client.pem"
19 #define ROOT_PEM SSLCERTDIR "/root.pem"
20 
21 // Limits readline input size if LIMITED_READLINE is defined
22 #define MAX_TERM_DEV_LINE_SIZE 4096
23 
24 // Maximmum length a single input unit can have. This value is used by
25 // SheppStrUtil.H only to allocate a temporary buffer.
26 #define MAX_WORD_LENGTH 2048
27 
28 #include <list>
29 
30 using std::list;
31 using std::string;
32 using std::auto_ptr;
33 
34 LIBEPP_NICBR_NS_USE
35 
37 list<SheppCommand> _commands;
38 
40 string _server = "localhost";
41 int _port = DEFAULT_PORT;
42 string _user = "test";
43 string _passphrase = "client passphrase";
44 string _client_pem = CLIENT_PEM;
45 string _root_pem = ROOT_PEM;
46 bool _connected = false;
47 string _clTrID = "";
48 
49 string _login_pw = "";
50 string _login_new_pw = "";
51 bool _new_pw = false;
52 string _lang = "";
53 
54 bool _beauty = true;
55 bool _debug = false;
56 bool _autorsp = true;
57 
58 bool _keepalive = false;
59 bool _ka_running = false;
60 bool _cmd_running= false;
61 static int _keepalive_timer = 180;
62 
63 bool _peer_crt_check = true;
64 
65 string _xmlrsp = "";
66 string _xmlcmd = "";
67 
68 string _serverSecDnsVersion = "0";
69 
71 auto_ptr<Session> _session;
72 
74 void about()
75 {
76  printf("shepp version 0.0, an EPP shell client!\n");
77  printf("${copyright_short}$ <libepp@registro.br>\n");
78  printf("shepp is distributed with libepp-nicbr: "
79  "http://registro.br/epp/index-EN.html\n");
80 
81  set<string> extensions;
82 
83 #if USE_BR_ORG
84  extensions.insert("brorg");
85  extensions.insert("lacnicorg");
86 #endif //USE_BR_ORG
87 #if USE_BR_DOMAINS
88  extensions.insert("brdomain");
89 #endif //USE_BR_DOMAINS
90 #if USE_IP_MANAGEMENT
91  extensions.insert("ipnetwork");
92  extensions.insert("asn");
93  extensions.insert("asnreserve");
94 #endif //USE_IP_MANAGEMENT
95  extensions.insert("launch");
96  extensions.insert("mark");
97  extensions.insert("smd");
98  extensions.insert("rgp");
99  extensions.insert("secDNS");
100  extensions.insert("lacniccontact");
101 
102  printf("extensions: ");
103  if (!extensions.empty()) {
104  set<string>::iterator ext;
105  for (ext = extensions.begin(); ext != extensions.end(); ext++) {
106  printf("%s ", (*ext).c_str());
107  }
108  printf("\n");
109  } else {
110  printf("(none)\n");
111  }
112 }
113 #endif //__SHEPP_GLOBAL_H__
EPP Session Class.
Project defines.
EPP command-line shell client Command class.
string _server
Global connection setup variables.
Definition: SheppGlobal.H:40
auto_ptr< Session > _session
Reference to session.
Definition: SheppGlobal.H:71
void about()
shepp build info
Definition: SheppGlobal.H:74
LIBEPP_NICBR_NS_USE list< SheppCommand > _commands
Global container of available commands.
Definition: SheppGlobal.H:37