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

Comparing gvpe/src/sockinfo.C (file contents):
Revision 1.15 by pcg, Thu Mar 3 16:54:34 2005 UTC vs.
Revision 1.19 by pcg, Fri Mar 18 01:53:05 2005 UTC

20*/ 20*/
21 21
22#include "config.h" 22#include "config.h"
23 23
24#include <netdb.h> 24#include <netdb.h>
25
26#include "gettext.h"
27 25
28#include "sockinfo.h" 26#include "sockinfo.h"
29#include "slog.h" 27#include "slog.h"
30 28
31// all ipv4-based protocols 29// all ipv4-based protocols
62 60
63void 61void
64sockinfo::set (const conf_node *conf, u8 prot_) 62sockinfo::set (const conf_node *conf, u8 prot_)
65{ 63{
66 if (prot_ == PROT_DNSv4) 64 if (prot_ == PROT_DNSv4)
67 set (conf->dns_hostname, conf->dns_hostname ? conf->dns_port : 0, prot_); 65 {
66 host = htonl (conf->id); port = 0; prot = prot_;
67 }
68 else 68 else
69 set (conf->hostname, 69 set (conf->hostname,
70 prot_ == PROT_UDPv4 ? conf->udp_port 70 prot_ == PROT_UDPv4 ? conf->udp_port
71 : prot_ == PROT_TCPv4 ? conf->tcp_port 71 : prot_ == PROT_TCPv4 ? conf->tcp_port
72 : prot_ == PROT_DNSv4 ? conf->dns_port 72 : prot_ == PROT_DNSv4 ? conf->dns_port
169 { 169 {
170 prot = prot_; 170 prot = prot_;
171 port = htons (conf->tcp_port); 171 port = htons (conf->tcp_port);
172 return true; 172 return true;
173 } 173 }
174
175#if ENABLE_DNS
176 if (conf
177 && prot_ & PROT_DNSv4
178 && conf->protocols & PROT_DNSv4
179 && conf->dns_port)
180 {
181 set (::conf.dns_forw_host, ::conf.dns_forw_port, prot_);
182 return true;
183 }
184#endif
185 } 174 }
186 175
187 return false; 176 return false;
188} 177}
189 178

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines