1 /* This file is part of Metaproxy.
2 Copyright (C) 2005-2011 Index Data
4 Metaproxy is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2, or (at your option) any later
9 Metaproxy is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #ifndef YP2_ORIGIN_HPP
20 #define YP2_ORIGIN_HPP
25 namespace metaproxy_1 {
30 std::ostream& operator<<(std::ostream& os, metaproxy_1::Origin& o);
33 namespace metaproxy_1 {
37 Origin(std::string listen_host = "", unsigned int listen_port = 0);
39 /// get function - right val in assignment
40 std::string listen_host() const;
42 /// set function - left val in assignment
43 std::string & listen_host();
45 /// get function - right val in assignment
46 unsigned int listen_port() const;
48 /// set function - left val in assignment
49 unsigned int & listen_port();
51 /// set client IP info - left val in assignment
52 void set_tcpip_address(std::string addr, unsigned long id);
54 /// set max sockets (for outgoing connections to a given target)
55 void set_max_sockets(int max_sockets);
57 /// set max sockets (for outgoing connections to a given target)
58 int get_max_sockets();
61 std::string get_address();
63 void set_custom_session(const std::string &s);
66 std::operator<<(std::ostream& os, metaproxy_1::Origin& o);
73 std::string m_address; // UNIX+TCPIP
74 unsigned int m_origin_id;
75 std::string m_listen_host;
76 unsigned int m_listen_port;
78 std::string m_custom_session;
89 * c-file-style: "Stroustrup"
90 * indent-tabs-mode: nil
92 * vim: shiftwidth=4 tabstop=8 expandtab