noproxy.c 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * noproxy.c: an alternative to proxy.c, for use by auxiliary programs
  3. * that need to make network connections but don't want to include all
  4. * the full-on support for endless network proxies (and its
  5. * configuration requirements). Implements the primary APIs of
  6. * proxy.c, but maps them straight to the underlying network layer.
  7. */
  8. #include "putty.h"
  9. #include "network.h"
  10. #include "proxy.h"
  11. SockAddr *name_lookup(const char *host, int port, char **canonicalname,
  12. Conf *conf, int addressfamily, LogContext *logctx,
  13. const char *reason)
  14. {
  15. return sk_namelookup(host, canonicalname, addressfamily);
  16. }
  17. Socket *new_connection(SockAddr *addr, const char *hostname,
  18. int port, bool privport,
  19. bool oobinline, bool nodelay, bool keepalive,
  20. Plug *plug, Conf *conf, Interactor *itr)
  21. {
  22. return sk_new(addr, port, privport, oobinline, nodelay, keepalive, plug);
  23. }
  24. Socket *new_listener(const char *srcaddr, int port, Plug *plug,
  25. bool local_host_only, Conf *conf, int addressfamily)
  26. {
  27. return sk_newlistener(srcaddr, port, plug, local_host_only, addressfamily);
  28. }