mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-02 03:52:49 -05:00
Support for doing DNS at the proxy end. I've invented a new type of
SockAddr, which just contains an unresolved hostname and is created by a stub function in *net.c. It's an error to pass this to most of the real-meat functions in *net.c; these fake addresses should have been dealt with by the time they get down that far. proxy.c now contains name_lookup(), a wrapper on sk_namelookup() which decides whether or not to do real DNS, and the individual proxy implementations each deal sensibly with being handed an unresolved address and avoid ever passing one down to *net.c. [originally from svn r2353]
This commit is contained in:
@ -68,6 +68,7 @@ Socket new_connection(SockAddr addr, char *hostname,
|
||||
int port, int privport,
|
||||
int oobinline, int nodelay, Plug plug);
|
||||
Socket new_listener(char *srcaddr, int port, Plug plug, int local_host_only);
|
||||
SockAddr name_lookup(char *host, int port, char **canonicalname);
|
||||
|
||||
/* socket functions */
|
||||
|
||||
@ -75,10 +76,11 @@ void sk_init(void); /* called once at program startup */
|
||||
void sk_cleanup(void); /* called just before program exit */
|
||||
|
||||
SockAddr sk_namelookup(char *host, char **canonicalname);
|
||||
SockAddr sk_nonamelookup(char *host);
|
||||
void sk_getaddr(SockAddr addr, char *buf, int buflen);
|
||||
int sk_hostname_is_local(char *name);
|
||||
int sk_address_is_local(SockAddr addr);
|
||||
enum { ADDRTYPE_IPV4, ADDRTYPE_IPV6 };
|
||||
enum { ADDRTYPE_IPV4, ADDRTYPE_IPV6, ADDRTYPE_NAME };
|
||||
int sk_addrtype(SockAddr addr);
|
||||
void sk_addrcopy(SockAddr addr, char *buf);
|
||||
void sk_addr_free(SockAddr addr);
|
||||
|
Reference in New Issue
Block a user