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.44 by pcg, Tue Dec 4 17:17:20 2007 UTC vs.
Revision 1.45 by pcg, Thu Dec 6 00:35:29 2007 UTC

87 snprintf (ext, 16, "_%d", (*c)->conf->id); 87 snprintf (ext, 16, "_%d", (*c)->conf->id);
88 (*c)->script_init_env (ext); 88 (*c)->script_init_env (ext);
89 } 89 }
90} 90}
91 91
92inline const char *
92const char *vpn::script_if_init () 93vpn::script_if_init ()
93{ 94{
94 script_init_env (); 95 script_init_env ();
95 96
96 return tap->if_up (); 97 return tap->if_up ();
97} 98}
98 99
100inline const char *
99const char *vpn::script_if_up () 101vpn::script_if_up ()
100{ 102{
101 script_init_env (); 103 script_init_env ();
102 104
103 char *filename; 105 char *filename;
104 asprintf (&filename, 106 asprintf (&filename,
501 } 503 }
502 504
503 return false; 505 return false;
504} 506}
505 507
506void 508inline void
507vpn::ipv4_ev (ev::io &w, int revents) 509vpn::ipv4_ev (ev::io &w, int revents)
508{ 510{
509 if (revents & EV_READ) 511 if (revents & EV_READ)
510 { 512 {
511 vpn_packet *pkt = new vpn_packet; 513 vpn_packet *pkt = new vpn_packet;
542 exit (EXIT_FAILURE); 544 exit (EXIT_FAILURE);
543 } 545 }
544} 546}
545 547
546#if ENABLE_ICMP 548#if ENABLE_ICMP
547void 549inline void
548vpn::icmpv4_ev (ev::io &w, int revents) 550vpn::icmpv4_ev (ev::io &w, int revents)
549{ 551{
550 if (revents & EV_READ) 552 if (revents & EV_READ)
551 { 553 {
552 vpn_packet *pkt = new vpn_packet; 554 vpn_packet *pkt = new vpn_packet;
590 exit (EXIT_FAILURE); 592 exit (EXIT_FAILURE);
591 } 593 }
592} 594}
593#endif 595#endif
594 596
595void 597inline void
596vpn::udpv4_ev (ev::io &w, int revents) 598vpn::udpv4_ev (ev::io &w, int revents)
597{ 599{
598 if (revents & EV_READ) 600 if (revents & EV_READ)
599 { 601 {
600 vpn_packet *pkt = new vpn_packet; 602 vpn_packet *pkt = new vpn_packet;
627 revents); 629 revents);
628 exit (EXIT_FAILURE); 630 exit (EXIT_FAILURE);
629 } 631 }
630} 632}
631 633
632void 634inline void
633vpn::tap_ev (ev::io &w, int revents) 635vpn::tap_ev (ev::io &w, int revents)
634{ 636{
635 if (revents & EV_READ) 637 if (revents & EV_READ)
636 { 638 {
637 /* process data */ 639 /* process data */
669 } 671 }
670 else 672 else
671 abort (); 673 abort ();
672} 674}
673 675
674void 676inline void
675vpn::event_cb (ev::timer &w, int) 677vpn::event_cb (ev::timer &w, int)
676{ 678{
677 if (events) 679 if (events)
678 { 680 {
679 if (events & EVENT_SHUTDOWN) 681 if (events & EVENT_SHUTDOWN)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines