tcppm.c 807 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. 3APA3A simpliest proxy server
  3. (c) 2002-2008 by ZARAZA <3APA3A@security.nnov.ru>
  4. please read License Agreement
  5. $Id: tcppm.c,v 1.15 2012-02-05 22:29:02 vlad Exp $
  6. */
  7. #include "proxy.h"
  8. #ifndef PORTMAP
  9. #define PORTMAP
  10. #endif
  11. #define RETURN(xxx) { param->res = xxx; goto CLEANRET; }
  12. void * tcppmchild(struct clientparam* param) {
  13. int res;
  14. if(!param->hostname)parsehostname((char *)param->srv->target, param, ntohs(param->srv->targetport));
  15. param->operation = CONNECT;
  16. res = (*param->srv->authfunc)(param);
  17. if(res) {RETURN(res);}
  18. RETURN (sockmap(param, conf.timeouts[CONNECTION_L]));
  19. CLEANRET:
  20. (*param->srv->logfunc)(param, NULL);
  21. freeparam(param);
  22. return (NULL);
  23. }
  24. #ifdef WITHMAIN
  25. struct proxydef childdef = {
  26. tcppmchild,
  27. 0,
  28. 0,
  29. S_TCPPM,
  30. ""
  31. };
  32. #include "proxymain.c"
  33. #endif