ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/src/vped.C
(Generate patch)

Comparing gvpe/src/vped.C (file contents):
Revision 1.2 by pcg, Thu Mar 6 18:43:07 2003 UTC vs.
Revision 1.3 by pcg, Fri Mar 21 23:17:01 2003 UTC

42 42
43#include "conf.h" 43#include "conf.h"
44#include "slog.h" 44#include "slog.h"
45#include "util.h" 45#include "util.h"
46#include "protocol.h" 46#include "protocol.h"
47#include "iom.h"
47 48
48vpn network; 49vpn network;
49 50
50static loglevel llevel = L_NONE; 51static loglevel llevel = L_NONE;
51 52
166*/ 167*/
167RETSIGTYPE 168RETSIGTYPE
168sigterm_handler (int a) 169sigterm_handler (int a)
169{ 170{
170 network.events |= vpn::EVENT_SHUTDOWN; 171 network.events |= vpn::EVENT_SHUTDOWN;
172 network.event.start (0);
171} 173}
172 174
173RETSIGTYPE 175RETSIGTYPE
174sighup_handler (int a) 176sighup_handler (int a)
175{ 177{
176 network.events |= vpn::EVENT_RECONNECT; 178 network.events |= vpn::EVENT_RECONNECT;
179 network.event.start (0);
177} 180}
178 181
179RETSIGTYPE 182RETSIGTYPE
180sigusr1_handler (int a) 183sigusr1_handler (int a)
181{ 184{
248 251
249 set_loglevel (llevel != L_NONE ? llevel : conf.llevel); 252 set_loglevel (llevel != L_NONE ? llevel : conf.llevel);
250 253
251 RAND_load_file ("/dev/urandom", 1024); 254 RAND_load_file ("/dev/urandom", 1024);
252 255
253 if (!thisnode) 256 if (!THISNODE)
254 { 257 {
255 slog (L_ERR, _("current node not set, or node '%s' not found in configfile, use the -n switch when starting vped."), 258 slog (L_ERR, _("current node not set, or node '%s' not found in configfile, use the -n switch when starting vped."),
256 thisnode ? thisnode : "<unset>"); 259 thisnode ? thisnode : "<unset>");
257 exit (1); 260 exit (1);
258 } 261 }
262 265
263 setup_signals (); 266 setup_signals ();
264 267
265 if (!network.setup ()) 268 if (!network.setup ())
266 { 269 {
267 network.main_loop (); 270 iom.loop ();
268 cleanup_and_exit (1); 271 cleanup_and_exit (1);
269 } 272 }
270 273
271 slog (L_ERR, _("unable to setup network, unrecoverable error, exiting.")); 274 slog (L_ERR, _("unable to setup network, unrecoverable error, exiting."));
272 cleanup_and_exit (1); 275 cleanup_and_exit (1);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines