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.45 by pcg, Fri Mar 4 09:36:45 2005 UTC vs.
Revision 1.46 by pcg, Sat Mar 5 19:13:15 2005 UTC

644 { 644 {
645 connection *r = vpn->find_router (); 645 connection *r = vpn->find_router ();
646 646
647 if (r) 647 if (r)
648 { 648 {
649 slog (L_DEBUG, _("%s: no common protocol, trying indirectly through %s"), 649 slog (L_DEBUG, _("%s: no common protocol, trying indirectly through %s (%s)"),
650 conf->nodename, r->conf->nodename); 650 conf->nodename, r->conf->nodename, (const char *)r->si);
651 return r->si; 651 return r->si;
652 } 652 }
653 else 653 else
654 slog (L_DEBUG, _("%s: node unreachable, no common protocol"), 654 slog (L_DEBUG, _("%s: node unreachable, no common protocol"),
655 conf->nodename); 655 conf->nodename);
659} 659}
660 660
661void 661void
662connection::send_vpn_packet (vpn_packet *pkt, const sockinfo &si, int tos) 662connection::send_vpn_packet (vpn_packet *pkt, const sockinfo &si, int tos)
663{ 663{
664 bool ok; 664 if (!vpn->send_vpn_packet (pkt, si, tos))
665
666 switch (si.prot)
667 {
668 case PROT_IPv4:
669 ok = vpn->send_ipv4_packet (pkt, si, tos); break;
670 case PROT_UDPv4:
671 ok = vpn->send_udpv4_packet (pkt, si, tos); break;
672#if ENABLE_TCP
673 case PROT_TCPv4:
674 ok = vpn->send_tcpv4_packet (pkt, si, tos); break;
675#endif
676#if ENABLE_ICMP
677 case PROT_ICMPv4:
678 ok = vpn->send_icmpv4_packet (pkt, si, tos); break;
679#endif
680#if ENABLE_DNS
681 case PROT_DNSv4:
682 ok = send_dnsv4_packet (pkt, si, tos); break;
683#endif
684
685 default:
686 slog (L_CRIT, _("%s: FATAL: trying to send packet with unsupported protocol"), (const char *)si);
687 ok = false;
688 }
689
690 if (!ok)
691 reset_connection (); 665 reset_connection ();
692} 666}
693 667
694void 668void
695connection::send_ping (const sockinfo &si, u8 pong) 669connection::send_ping (const sockinfo &si, u8 pong)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines