14 #ifndef SOCKS5BYTESTREAMMANAGER_H__
15 #define SOCKS5BYTESTREAMMANAGER_H__
17 #include "iqhandler.h"
19 #include "stanzaextension.h"
24 class BytestreamHandler;
25 class SOCKS5BytestreamServer;
26 class SOCKS5Bytestream;
94 void addStreamHost(
const JID& jid,
const std::string& host,
int port );
111 bool requestSOCKS5Bytestream(
const JID& to, S5BMode mode,
const std::string& sid =
EmptyString,
112 const JID& from =
JID() );
126 void acceptSOCKS5Bytestream(
const std::string& sid );
142 { m_socks5BytestreamHandler = s5bh; }
148 { m_socks5BytestreamHandler = 0; }
163 virtual bool handleIq(
const IQ& iq );
166 virtual void handleIqID(
const IQ& iq,
int context );
169 #ifdef SOCKS5BYTESTREAMMANAGER_TEST
187 Query(
const std::string& sid, S5BMode mode,
188 const StreamHostList& hosts );
197 Query(
const JID& jid,
const std::string& sid,
bool activate );
203 Query(
const Tag* tag );
214 const std::string& sid()
const {
return m_sid; }
220 const JID& jid()
const {
return m_jid; }
226 S5BMode mode()
const {
return m_mode; }
232 const StreamHostList& hosts()
const {
return m_hosts; }
235 virtual const std::string& filterString()
const;
238 virtual StanzaExtension* newInstance(
const Tag* tag )
const
240 return new Query( tag );
244 virtual Tag* tag()
const;
247 virtual StanzaExtension* clone()
const
249 return new Query( *
this );
264 StreamHostList m_hosts;
269 SOCKS5BytestreamManager& operator=(
const SOCKS5BytestreamManager&);
271 bool haveStream(
const JID& from );
272 const StreamHost* findProxy(
const JID& from,
const std::string& hostjid,
const std::string& sid );
274 void acknowledgeStreamHost(
bool success,
const JID& jid,
const std::string& sid );
283 typedef std::map<std::string, SOCKS5Bytestream*> S5BMap;
291 StreamHostList sHosts;
294 typedef std::map<std::string, AsyncS5BItem> AsyncTrackMap;
295 AsyncTrackMap m_asyncTrackMap;
297 ClientBase* m_parent;
298 BytestreamHandler* m_socks5BytestreamHandler;
299 SOCKS5BytestreamServer* m_server;
300 StreamHostList m_hosts;
307 #endif // SOCKS5BYTESTREAMMANAGER_H__
void setStreamHosts(StreamHostList hosts)
A server listening for SOCKS5 bytestreams.
An abstraction of an IQ stanza.
void removeBytestreamHandler()
An SOCKS5BytestreamManager dispatches SOCKS5 Bytestreams.
std::list< StreamHost > StreamHostList
The namespace for the gloox library.
This class abstracts a stanza extension, which is usually an element in a specific namespace...
std::map< std::string, std::string > StringMap
void registerSOCKS5BytestreamServer(SOCKS5BytestreamServer *server)
A virtual interface which can be reimplemented to receive IQ stanzas.
An implementation of a single SOCKS5 Bytestream (XEP-0065).
void registerBytestreamHandler(BytestreamHandler *s5bh)
A virtual interface that allows to receive new incoming Bytestream requests from remote entities...
const std::string EmptyString
void removeSOCKS5BytestreamServer()
This is the common base class for a Jabber/XMPP Client and a Jabber Component.
This is an abstraction of an XML element.