/* This file is part of Metaproxy.
- Copyright (C) 2005-2011 Index Data
+ Copyright (C) 2005-2012 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
}
namespace std {
- std::ostream& operator<<(std::ostream& os, metaproxy_1::Origin& o);
+ std::ostream& operator<<(std::ostream& os, const metaproxy_1::Origin& o);
}
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);
/// set max sockets (for outgoing connections to a given target)
int get_max_sockets();
-
+
/// get tcpip address
std::string get_address();
+
+ void set_custom_session(const std::string &s);
private:
- friend std::ostream&
- std::operator<<(std::ostream& os, metaproxy_1::Origin& o);
-
- enum origin_t {
- API,
- UNIX,
- TCPIP
- } m_type;
- std::string m_address; // UNIX+TCPIP
+ friend std::ostream&
+ std::operator<<(std::ostream& os, const metaproxy_1::Origin& o);
+
+ 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;
};
-
}
-
-
#endif
/*
* Local variables: