|
Yate
|
A server to server stream. More...
#include <yatejabber.h>
Protected Attributes | |
| NamedList | m_remoteDomains |
Protected Attributes inherited from JBStream | |
| State | m_state |
| String | m_id |
| JabberID | m_local |
| JabberID | m_remote |
| String | m_serverHost |
| int | m_flags |
| XMPPNamespace::Type | m_xmlns |
| XMPPFeatureList | m_features |
| JBEvent * | m_lastEvent |
| ObjList | m_events |
| ObjList | m_pending |
| unsigned int | m_stanzaIndex |
| u_int64_t | m_setupTimeout |
| u_int64_t | m_startTimeout |
| u_int64_t | m_pingTimeout |
| u_int64_t | m_pingInterval |
| u_int64_t | m_nextPing |
| u_int64_t | m_idleTimeout |
| u_int64_t | m_connectTimeout |
| unsigned int | m_restart |
| u_int64_t | m_timeToFillRestart |
| String | m_pingId |
Friends | |
| class | JBStream |
Additional Inherited Members | |
Public Types inherited from JBStream | |
| enum | Type { c2s = 0 , s2s , comp , cluster , TypeCount } |
| enum | State { Idle = 0 , Connecting , WaitStart , Starting , Features , WaitTlsRsp , Securing , Auth , Challenge , Compressing , Register , Running , Destroy } |
| enum | Flags { NoAutoRestart = 0x00000001 , TlsRequired = 0x00000002 , AllowPlainAuth = 0x00000004 , DialbackOnly = 0x00000008 , RegisterUser = 0x00000010 , Compress = 0x00000020 , InError = 0x00000080 , RosterRequested = 0x00000100 , AvailableResource = 0x00000200 , PositivePriority = 0x00000400 , SetCompressed = 0x00010000 , StreamSecured = 0x00020000 , StreamTls = 0x00040000 , StreamAuthenticated = 0x00080000 , StreamRemoteVer1 = 0x00100000 , StreamLocalVer1 = 0x00200000 , StreamWaitBindRsp = 0x01000000 , StreamWaitSessRsp = 0x02000000 , StreamWaitChallenge = 0x04000000 , StreamWaitChgRsp = 0x08000000 , StreamRfc3920Chg = 0x10000000 , StreamCompressed = 0x20000000 , StreamCanCompress = 0x40000000 , StreamFlags = 0x000000ff , InternalFlags = 0xffff0000 } |
Static Public Member Functions inherited from JBStream | |
| static Type | lookupType (const char *text, Type defVal=TypeCount) |
Static Public Member Functions inherited from RefObject | |
| static bool | alive (const RefObject *obj) |
| static bool | efficientIncDec () |
Static Public Member Functions inherited from GenObject | |
| static void * | getObject (const String &name, const GenObject *obj) |
| static bool | getObjCounting () |
| static void | setObjCounting (bool enable) |
| static NamedCounter * | getObjCounter (const String &name, bool create=true) |
| static ObjList & | getObjCounters () |
Static Public Member Functions inherited from Mutex | |
| static int | count () |
| static int | locks () |
| static bool | efficientTimedLock () |
Static Public Member Functions inherited from Lockable | |
| static void | wait (unsigned long maxwait) |
| static unsigned long | wait () |
| static void | startUsingNow () |
| static void | enableSafety (bool safe=true) |
| static bool | safety () |
Public Attributes inherited from JBStream | |
| SASL * | m_sasl |
Static Public Attributes inherited from JBStream | |
| static const TokenDict | s_stateName [] |
| static const TokenDict | s_flagName [] |
| static const TokenDict | s_typeName [] |
A server to server stream.
This class holds a server to server stream
| JBServerStream | ( | JBEngine * | engine, |
| Socket * | socket, | ||
| bool | component = false |
||
| ) |
Constructor. Build an incoming stream from a socket
| engine | Engine owning this stream |
| socket | The socket |
| component | True to build an external component stream |
| JBServerStream | ( | JBEngine * | engine, |
| const JabberID & | local, | ||
| const JabberID & | remote, | ||
| const char * | dbId = 0, |
||
| const char * | dbKey = 0, |
||
| bool | dbOnly = false, |
||
| const NamedList * | params = 0 |
||
| ) |
Constructor. Build an outgoing stream
| engine | Engine owning this stream |
| local | Local party jabber id |
| remote | Remote party jabber id |
| dbId | Optional dialback id (stream id) |
| dbKey | Optional dialback key to verify |
| dbOnly | True if this is a dialback only stream |
| params | Optional stream parameters |
| JBServerStream | ( | JBEngine * | engine, |
| const JabberID & | local, | ||
| const JabberID & | remote, | ||
| const String * | name = 0, |
||
| const NamedList * | params = 0 |
||
| ) |
Constructor. Build an outgoing component stream
| engine | Engine owning this stream |
| local | Local party jabber id |
| remote | Remote party jabber id |
| name | Optional stream name |
| params | Optional stream parameters |
|
inlineprotected |
Adjust a dialback response to avoid sending XEP 0220 'error' to a party not advertising rfc3920 version=1 (might not support it)
| rsp | The response to adjust |
References JBStream::flag(), and Mutex::lock().
|
protectedvirtual |
|
inline |
Check if this is an outgoing dialback stream
References JBStream::flag(), and JBStream::outgoing().
Check if this stream has an already authenticated remote domain. This method is not thread safe
| domain | Domain to check |
| auth | Check if the domain is authenticated |
References NamedList::getParam(), JBServerStream::m_remoteDomains, and String::null().
|
protectedvirtual |
Process elements in Auth state
| xml | Received element (will be consumed) |
| from | Already parsed source JID |
| to | Already parsed destination JID |
Reimplemented from JBStream.
Process dialback key (db:result) requests
| xml | Received element (will be consumed) |
| from | Already parsed source JID |
| to | Already parsed destination JID |
|
protectedvirtual |
Process elements in Running state
| xml | Received element (will be consumed) |
| from | Already parsed source JID |
| to | Already parsed destination JID |
Reimplemented from JBStream.
|
protectedvirtual |
Process stream start elements while waiting for them
| xml | Received xml element |
| from | The 'from' attribute |
| to | The 'to' attribute |
Reimplemented from JBStream.
Retrieve the list of remote domains. This method is not thread safe
References JBServerStream::m_remoteDomains.
| bool sendDbResult | ( | const JabberID & | from, |
| const JabberID & | to, | ||
| XMPPError::Type | rsp = XMPPError::NoError |
||
| ) |
Send a dialback key response. Update the remote domains list. Terminate the stream if there are no more remote domains
| from | The 'from' attribute |
| to | The 'to' attribute |
| rsp | The response as enumeration: set it to NoError if valid, NotAuthorized if invalid or any other error to send a db:result error type |
| bool sendDbVerify | ( | const char * | from, |
| const char * | to, | ||
| const char * | id, | ||
| XMPPError::Type | rsp = XMPPError::NoError |
||
| ) |
Send a dialback verify response
| from | The 'from' attribute |
| to | The 'to' attribute |
| id | The 'id' attribute |
| rsp | The response as enumeration: set it to NoError if valid, NotAuthorized if invalid or any other error to send a db:verify error type |
| bool sendDialback | ( | ) |
Send dialback data (key/verify)
|
inlinevirtual |
| bool startComp | ( | const String & | local = String::empty(), |
| const String & | remote = String::empty() |
||
| ) |
Start a component stream (reply to received stream start). Send handshake if outgoing
| local | Local domain. Ignored if outgoing |
| remote | Remote domain. Ignored if outgoing |
|
inline |
Take the dialback key from this stream
References Mutex::lock().
|
protected |
Incoming stream remote domains. Each element's value will contain the dialback key if not authenticated
Referenced by JBServerStream::hasRemoteDomain(), and JBServerStream::remoteDomains().