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; }
147 void removeBytestreamHandler()
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,
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; }
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 );
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;
294 typedef std::map<std::string, AsyncS5BItem> AsyncTrackMap;
295 AsyncTrackMap m_asyncTrackMap;
297 ClientBase* m_parent;
298 BytestreamHandler* m_socks5BytestreamHandler;
299 SOCKS5BytestreamServer* m_server;
307 #endif // SOCKS5BYTESTREAMMANAGER_H__