… | |
… | |
17 | Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
17 | Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
18 | */ |
18 | */ |
19 | |
19 | |
20 | #include "config.h" |
20 | #include "config.h" |
21 | |
21 | |
22 | #include <arpa/inet.h> |
|
|
23 | #include <netdb.h> |
22 | #include <netdb.h> |
24 | |
23 | |
25 | #include "gettext.h" |
24 | #include "gettext.h" |
26 | |
25 | |
27 | #include "sockinfo.h" |
26 | #include "sockinfo.h" |
… | |
… | |
63 | sockinfo::set (const conf_node *conf, u8 prot_) |
62 | sockinfo::set (const conf_node *conf, u8 prot_) |
64 | { |
63 | { |
65 | set (conf->hostname, |
64 | set (conf->hostname, |
66 | prot_ == PROT_UDPv4 ? conf->udp_port |
65 | prot_ == PROT_UDPv4 ? conf->udp_port |
67 | : prot_ == PROT_TCPv4 ? conf->tcp_port |
66 | : prot_ == PROT_TCPv4 ? conf->tcp_port |
|
|
67 | : prot_ == PROT_DNSv4 ? conf->dns_port |
68 | : 0, |
68 | : 0, |
69 | prot_); |
69 | prot_); |
70 | } |
70 | } |
71 | |
71 | |
72 | const sockaddr * |
72 | const sockaddr * |
… | |
… | |
119 | if (conf |
119 | if (conf |
120 | && prot & PROTv4 |
120 | && prot & PROTv4 |
121 | && conf->protocols & PROT_TCPv4 |
121 | && conf->protocols & PROT_TCPv4 |
122 | && conf->tcp_port) |
122 | && conf->tcp_port) |
123 | protocols |= PROT_TCPv4; |
123 | protocols |= PROT_TCPv4; |
|
|
124 | |
|
|
125 | if (conf |
|
|
126 | && prot & PROTv4 |
|
|
127 | && conf->protocols & PROT_DNSv4) |
|
|
128 | protocols |= PROT_DNSv4; |
124 | |
129 | |
125 | return protocols; |
130 | return protocols; |
126 | } |
131 | } |
127 | |
132 | |
128 | bool |
133 | bool |