X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;f=include%2Fmetaproxy%2Forigin.hpp;h=658872a44423618d23c25c06bf36e14f1db58919;hb=af17ce65db77bb9b783c44decd5976b4bb0f50dd;hp=44eefcf4ec1d37d2c780e4c48660ef8fe5c895a8;hpb=3e584362b6933174b28cf98ff3138a589ed8326d;p=metaproxy-moved-to-github.git diff --git a/include/metaproxy/origin.hpp b/include/metaproxy/origin.hpp index 44eefcf..658872a 100644 --- a/include/metaproxy/origin.hpp +++ b/include/metaproxy/origin.hpp @@ -1,5 +1,5 @@ /* This file is part of Metaproxy. - Copyright (C) 2005-2011 Index Data + Copyright (C) Index Data Metaproxy is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -31,23 +31,11 @@ namespace std { } namespace metaproxy_1 { - + class Origin { public: - Origin(std::string listen_host = "", unsigned int listen_port = 0); - - /// get function - right val in assignment - std::string listen_host() const; - - /// set function - left val in assignment - std::string & listen_host(); - - /// get function - right val in assignment - unsigned int listen_port() const; - - /// set function - left val in assignment - unsigned int & listen_port(); - + Origin(); + /// set client IP info - left val in assignment void set_tcpip_address(std::string addr, unsigned long id); @@ -56,32 +44,26 @@ namespace metaproxy_1 { /// set max sockets (for outgoing connections to a given target) int get_max_sockets(); - + /// get tcpip address std::string get_address(); + /// get tcpip address + std::string get_bind_address(); + void set_custom_session(const std::string &s); private: - friend std::ostream& + friend std::ostream& std::operator<<(std::ostream& os, const metaproxy_1::Origin& o); - - enum origin_t { - API, - UNIX, - TCPIP - } m_type; - std::string m_address; // UNIX+TCPIP + + std::string m_address; unsigned int m_origin_id; - std::string m_listen_host; - unsigned int m_listen_port; int m_max_sockets; std::string m_custom_session; + std::string get_forward_address() const; }; - } - - #endif /* * Local variables: