Destination.hpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright (c) 2002-2009 Moxie Marlinspike
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License as
  6. * published by the Free Software Foundation; either version 3 of the
  7. * License, or (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful, but
  10. * WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  17. * USA
  18. */
  19. #ifndef __DESTINATION_H__
  20. #define __DESTINATION_H__
  21. #include <boost/asio.hpp>
  22. class IndeterminateDestinationException : public std::exception {
  23. public:
  24. virtual const char* what() const throw() {
  25. return "Could not determine original destination...";
  26. }
  27. };
  28. class Destination {
  29. public:
  30. static int getOriginalDestination(boost::asio::ip::tcp::socket &socket,
  31. boost::asio::ip::tcp::endpoint &originalDestination);
  32. };
  33. #endif