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

Comparing gvpe/src/connection.C (file contents):
Revision 1.65 by pcg, Tue Dec 4 17:17:20 2007 UTC vs.
Revision 1.66 by pcg, Thu Dec 6 00:35:29 2007 UTC

91 rsachallenge chg; 91 rsachallenge chg;
92}; 92};
93 93
94struct rsa_cache : list<rsa_entry> 94struct rsa_cache : list<rsa_entry>
95{ 95{
96 void cleaner_cb (ev::timer &w, int revents); ev::timer cleaner; 96 inline void cleaner_cb (ev::timer &w, int revents); ev::timer cleaner;
97 97
98 bool find (const rsaid &id, rsachallenge &chg) 98 bool find (const rsaid &id, rsachallenge &chg)
99 { 99 {
100 for (iterator i = begin (); i != end (); ++i) 100 for (iterator i = begin (); i != end (); ++i)
101 { 101 {
745 send_vpn_packet (r, si); 745 send_vpn_packet (r, si);
746 746
747 delete r; 747 delete r;
748} 748}
749 749
750void 750inline void
751connection::establish_connection_cb (ev::timer &w, int revents) 751connection::establish_connection_cb (ev::timer &w, int revents)
752{ 752{
753 if (!ictx 753 if (!ictx
754 && conf != THISNODE 754 && conf != THISNODE
755 && connectmode != conf_node::C_NEVER 755 && connectmode != conf_node::C_NEVER
839 send_reset (si); 839 send_reset (si);
840 840
841 reset_connection (); 841 reset_connection ();
842} 842}
843 843
844void 844inline void
845connection::rekey_cb (ev::timer &w, int revents) 845connection::rekey_cb (ev::timer &w, int revents)
846{ 846{
847 reset_connection (); 847 reset_connection ();
848 establish_connection (); 848 establish_connection ();
849} 849}
1176 send_reset (rsi); 1176 send_reset (rsi);
1177 break; 1177 break;
1178 } 1178 }
1179} 1179}
1180 1180
1181inline void
1181void connection::keepalive_cb (ev::timer &w, int revents) 1182connection::keepalive_cb (ev::timer &w, int revents)
1182{ 1183{
1183 if (ev_now () >= last_activity + ::conf.keepalive + 30) 1184 if (ev_now () >= last_activity + ::conf.keepalive + 30)
1184 { 1185 {
1185 reset_connection (); 1186 reset_connection ();
1186 establish_connection (); 1187 establish_connection ();
1231 asprintf (&env, "DESTNODE=%s", conf->nodename); putenv (env); 1232 asprintf (&env, "DESTNODE=%s", conf->nodename); putenv (env);
1232 asprintf (&env, "DESTIP=%s", si.ntoa ()); putenv (env); 1233 asprintf (&env, "DESTIP=%s", si.ntoa ()); putenv (env);
1233 asprintf (&env, "DESTPORT=%d", ntohs (si.port)); putenv (env); 1234 asprintf (&env, "DESTPORT=%d", ntohs (si.port)); putenv (env);
1234} 1235}
1235 1236
1237inline const char *
1236const char *connection::script_node_up () 1238connection::script_node_up ()
1237{ 1239{
1238 script_init_connect_env (); 1240 script_init_connect_env ();
1239 1241
1240 putenv ((char *)"STATE=up"); 1242 putenv ((char *)"STATE=up");
1241 1243
1246 ::conf.script_node_up ? ::conf.script_node_up : "node-up"); 1248 ::conf.script_node_up ? ::conf.script_node_up : "node-up");
1247 1249
1248 return filename; 1250 return filename;
1249} 1251}
1250 1252
1253inline const char *
1251const char *connection::script_node_down () 1254connection::script_node_down ()
1252{ 1255{
1253 script_init_connect_env (); 1256 script_init_connect_env ();
1254 1257
1255 putenv ((char *)"STATE=down"); 1258 putenv ((char *)"STATE=down");
1256 1259

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines