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,
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;
A virtual interface that allows to receive new incoming Bytestream requests from remote entities.
This is the common base class for a Jabber/XMPP Client and a Jabber Component.
An abstraction of an IQ stanza.
A virtual interface which can be reimplemented to receive IQ stanzas.
An SOCKS5BytestreamManager dispatches SOCKS5 Bytestreams.
void removeBytestreamHandler()
void setStreamHosts(StreamHostList hosts)
void registerSOCKS5BytestreamServer(SOCKS5BytestreamServer *server)
void registerBytestreamHandler(BytestreamHandler *s5bh)
void removeSOCKS5BytestreamServer()
A server listening for SOCKS5 bytestreams.
An implementation of a single SOCKS5 Bytestream (XEP-0065).
This class abstracts a stanza extension, which is usually an XML child element in a specific namespac...
This is an abstraction of an XML element.
The namespace for the gloox library.
const std::string EmptyString
@ StanzaErrorNotAcceptable
std::list< StreamHost > StreamHostList
std::map< std::string, std::string > StringMap