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

Comparing gvpe/src/vpn.C (file contents):
Revision 1.49 by pcg, Sun Aug 10 01:34:36 2008 UTC vs.
Revision 1.50 by pcg, Sun Aug 10 02:49:21 2008 UTC

724 724
725 conns.clear (); 725 conns.clear ();
726 726
727 connection_init (); 727 connection_init ();
728 728
729 for (configuration::node_vector::iterator i = conf.nodes.begin (); 729 for (configuration::node_vector::iterator i = conf.nodes.begin (); i != conf.nodes.end (); ++i)
730 i != conf.nodes.end (); ++i) 730 conns.push_back (new connection (this, *i));
731 { 731
732 connection *conn = new connection (this, *i); 732 for (conns_vector::iterator c = conns.begin (); c != conns.end (); ++c)
733 conns.push_back (conn);
734 conn->establish_connection (); 733 (*c)->establish_connection ();
735 }
736} 734}
737 735
738bool vpn::can_direct (conf_node *src, conf_node *dst) const 736bool vpn::can_direct (conf_node *src, conf_node *dst) const
739{ 737{
740 return src != dst 738 return src != dst
819 o->rekey (); 817 o->rekey ();
820 } 818 }
821 } 819 }
822} 820}
823 821
824void vpn::send_connect_request (int id) 822void vpn::send_connect_request (connection *c)
825{ 823{
826 connection *c = find_router_for (conns[id]); 824 connection *r = find_router_for (c);
827 825
828 if (c) 826 if (r)
829 { 827 {
830 slog (L_TRACE, _("%s: no way to connect, sending mediated connection request via %s."), 828 slog (L_TRACE, _("%s: no way to connect, sending mediated connection request via %s."),
831 conns[id]->conf->nodename, c->conf->nodename); 829 c->conf->nodename, r->conf->nodename);
832 c->send_connect_request (id); 830 r->send_connect_request (c->conf->id);
833 } 831 }
834 else 832 else
835 slog (L_DEBUG, _("%s: no way to connect and no router found: unable to connect."), conns[id]->conf->nodename); 833 slog (L_DEBUG, _("%s: no way to connect and no router found: unable to connect."),
834 c->conf->nodename);
836} 835}
837 836
838void 837void
839connection::dump_status () 838connection::dump_status ()
840{ 839{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines