LogService
libdadi: utility tools for distributed applications
logFwdr.hh
1 /****************************************************************************/
2 /* Log forwarder implementation - Forwarder executable */
3 /* */
4 /* Author(s): */
5 /* - Gael Le Mahec (gael.le.mahec@ens-lyon.fr) */
6 /* */
7 /* This file is part of DIET . */
8 /* */
9 /* Copyright (C) 2000-2003 ENS Lyon, LIFC, INSA, INRIA and SysFera (2000) */
10 /* */
11 /* - Frederic.Desprez@ens-lyon.fr (Project Manager) */
12 /* - Eddy.Caron@ens-lyon.fr (Technical Manager) */
13 /* - Tech@sysfera.com (Maintainer and Technical Support) */
14 /* */
15 /* This software is a computer program whose purpose is to provide an */
16 /* distributed logging services. */
17 /* */
18 /* */
19 /* This software is governed by the CeCILL license under French law and */
20 /* abiding by the rules of distribution of free software. You can use, */
21 /* modify and/ or redistribute the software under the terms of the CeCILL */
22 /* license as circulated by CEA, CNRS and INRIA at the following URL */
23 /* "http://www.cecill.info". */
24 /* */
25 /* As a counterpart to the access to the source code and rights to copy, */
26 /* modify and redistribute granted by the license, users are provided */
27 /* only with a limited warranty and the software's author, the holder */
28 /* of the economic rights, and the successive licensors have only */
29 /* limited liability. */
30 /* */
31 /* In this respect, the user's attention is drawn to the risks */
32 /* associated with loading, using, modifying and/or developing or */
33 /* reproducing the software by the user in light of its specific status */
34 /* of free software, that may mean that it is complicated to */
35 /* manipulate, and that also therefore means that it is reserved for */
36 /* developers and experienced professionals having in-depth computer */
37 /* knowledge. Users are therefore encouraged to load and test the */
38 /* software's suitability as regards their requirements in conditions */
39 /* enabling the security of their systems and/or data to be ensured and, */
40 /* more generally, to use and operate it in the same conditions as */
41 /* regards security. */
42 /* */
43 /* The fact that you are presently reading this means that you have had */
44 /* knowledge of the CeCILL license and that you accept its terms. */
45 /* */
46 /****************************************************************************/
47 
48 #ifndef _LOGFWDR_HH_
49 #define _LOGFWDR_HH_
50 
51 #include <string>
52 #include "Options.hh"
53 
54 class LogForwarder;
55 class LogORBMgr;
56 
57 
58 class FwrdConfig : public Configuration {
59 public:
60  explicit FwrdConfig(const std::string& pgName);
61 
62  const std::string&
63  getName() const;
64 
65  const std::string&
66  getPeerName() const;
67 
68  const std::string&
69  getPeerIOR() const;
70 
71  const std::string&
72  getSshHost() const;
73 
74  const std::string&
75  getRemoteHost() const;
76 
77  const std::string&
78  getRemotePortTo() const;
79 
80  const std::string&
81  getRemotePortFrom() const;
82 
83  const std::string&
84  getLocalPortFrom() const;
85 
86  bool
87  createTo() const;
88 
89  bool
90  createFrom() const;
91 
92  const std::string&
93  getSshPath() const;
94 
95  const std::string&
96  getSshPort() const;
97 
98  const std::string&
99  getSshLogin() const;
100 
101  const std::string&
102  getSshKeyPath() const;
103 
104  int
105  getNbRetry() const;
106 
107  unsigned int
108  getWaitingTime() const;
109 
110  const std::string&
111  getCfgPath() const;
112 
113  void
114  setName(const std::string& name);
115 
116  void
117  setPeerName(const std::string& name);
118 
119  void
120  setPeerIOR(const std::string& ior);
121 
122  void
123  setSshHost(const std::string& host);
124 
125  void
126  setRemoteHost(const std::string& host);
127 
128  void
129  setRemotePortTo(const std::string& port);
130 
131  void
132  setRemotePortFrom(const std::string& port);
133 
134  void
135  setLocalPortFrom(const std::string& port);
136 
137  void
138  createTo(bool create);
139 
140  void
141  createFrom(bool create);
142 
143  void
144  setSshPath(const std::string& path);
145 
146  void
147  setSshPort(const std::string& port);
148 
149  void
150  setSshLogin(const std::string& login);
151 
152  void
153  setSshKeyPath(const std::string& path);
154 
155  void
156  setNbRetry(const int nb);
157 
158  void
159  setWaitingTime(const unsigned int time);
160 
161  void
162  setCfgPath(const std::string& path);
163 
164 private:
165  std::string name;
166  std::string peerName;
167  std::string peerHost;
168  std::string peerPort;
169  std::string peerIOR;
170 
171  std::string sshHost;
172  std::string remoteHost;
173  std::string localPortFrom;
174  std::string remotePortTo;
175  std::string remotePortFrom;
176  bool createTunnelTo;
177  bool createTunnelFrom;
178  std::string sshPath;
179  std::string sshPort;
180  std::string sshLogin;
181  std::string sshKeyPath;
182  int nbRetry;
183  std::string cfgPath;
184  unsigned int waitingTime;
185 };
186 
187 int
188 connectPeer(const std::string &ior, const std::string &peerIOR,
189  const std::string &newHost, const std::string &remoteHost,
190  int localPortFrom, int remotePortFrom,
191  LogForwarder *forwarder, LogORBMgr* mgr);
192 
193 void
194 name(const std::string& name, Configuration* cfg);
195 
196 void
197 peer_name(const std::string& name, Configuration* cfg);
198 
199 void
200 peer_ior(const std::string& ior, Configuration* cfg);
201 
202 void
203 ssh_host(const std::string& host, Configuration* cfg);
204 
205 void
206 remote_host(const std::string& host, Configuration* cfg);
207 
208 void
209 remote_port_to(const std::string& port, Configuration* cfg);
210 
211 void
212 remote_port_from(const std::string& port, Configuration* cfg);
213 
214 void
215 local_port_from(const std::string& port, Configuration* cfg);
216 
217 void
218 create(const std::string& create, Configuration* cfg);
219 
220 void
221 ssh_path(const std::string& path, Configuration* cfg);
222 
223 void
224 ssh_port(const std::string& port, Configuration* cfg);
225 
226 void
227 ssh_login(const std::string& login, Configuration* cfg);
228 
229 void
230 key_path(const std::string& path, Configuration* cfg);
231 
232 void
233 nb_retry(const std::string& nb, Configuration* cfg);
234 
235 void
236 tunnel_wait(const std::string& time, Configuration* cfg);
237 
238 /* Transformation function for the host name. */
239 int
240 change(int c);
241 
242 #endif // _LOGFWDR_HH_
Definition: LogForwarder.hh:59
Definition: logFwdr.hh:58
Definition: Options.hh:59
Definition: LogORBMgr.hh:68