Shadowrun: Awakened 29 September 2011 - Build 871
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Static Private Attributes
cat::sphynx::Client Class Reference

#include <SphynxClient.hpp>

Inheritance diagram for cat::sphynx::Client:

List of all members.

Public Member Functions

 Client ()
bool Connect (const char *hostname, Port port)
bool Connect (const NetAddr &addr)
void Disconnect ()
bool SetServerKey (ThreadPoolLocalStorage *tls, const void *server_key, int key_bytes, const char *session_key)
virtual ~Client ()

Protected Member Functions

bool IsConnected ()
virtual void OnClose ()=0
virtual void OnConnect (ThreadPoolLocalStorage *tls)=0
virtual void OnConnectFail ()=0
virtual void OnDisconnect ()=0
virtual void OnMessage (ThreadPoolLocalStorage *tls, BufferStream msg, u32 bytes)=0
virtual void OnTick (ThreadPoolLocalStorage *tls, u32 now)=0
virtual void OnTimestampDeltaUpdate (u32 rtt, s32 delta)

Protected Attributes

AuthenticatedEncryption _auth_enc
bool _connected
u32 _last_recv_tsc
u32 _last_send_mstsc
NetAddr _server_addr

Private Member Functions

virtual void OnRead (ThreadPoolLocalStorage *tls, const NetAddr &src, u8 *data, u32 bytes)
bool OnResolve (const char *hostname, const NetAddr *array, int array_length)
void OnUnreachable (const NetAddr &src)
virtual void OnWrite (u32 bytes)
bool PostHello ()
virtual bool PostPacket (u8 *buffer, u32 buf_bytes, u32 msg_bytes, u32 skip_bytes)
bool ThreadFunction (void *param)

Private Attributes

u8 _cached_challenge [CHALLENGE_BYTES]
KeyAgreementInitiator _key_agreement_initiator
WaitableFlag _kill_flag
u8 _server_public_key [PUBLIC_KEY_BYTES]
char _session_key [SESSION_KEY_BYTES]

Static Private Attributes

static const int CLIENT_THREAD_KILL_TIMEOUT = 10000
static const int CONNECT_TIMEOUT = 6000
static const int HANDSHAKE_TICK_RATE = 100
static const int INITIAL_HELLO_POST_INTERVAL = 200
static const u32 MTU_PROBE_INTERVAL = 8000
static const int SESSION_KEY_BYTES = 32

Detailed Description

Definition at line 45 of file SphynxClient.hpp.


Constructor & Destructor Documentation

cat::sphynx::Client::Client ( )
virtual cat::sphynx::Client::~Client ( ) [virtual]

Member Function Documentation

bool cat::sphynx::Client::Connect ( const char *  hostname,
Port  port 
)
bool cat::sphynx::Client::Connect ( const NetAddr addr)
void cat::sphynx::Client::Disconnect ( )
bool cat::sphynx::Client::IsConnected ( ) [inline, protected]

Definition at line 83 of file SphynxClient.hpp.

References _connected.

{ return _connected; }
virtual void cat::sphynx::Client::OnClose ( ) [protected, pure virtual]

Implements cat::UDPEndpoint.

virtual void cat::sphynx::Client::OnConnect ( ThreadPoolLocalStorage tls) [protected, pure virtual]
virtual void cat::sphynx::Client::OnConnectFail ( ) [protected, pure virtual]
virtual void cat::sphynx::Client::OnDisconnect ( ) [protected, pure virtual]
virtual void cat::sphynx::Client::OnMessage ( ThreadPoolLocalStorage tls,
BufferStream  msg,
u32  bytes 
) [protected, pure virtual]
virtual void cat::sphynx::Client::OnRead ( ThreadPoolLocalStorage tls,
const NetAddr src,
u8 data,
u32  bytes 
) [private, virtual]

Implements cat::UDPEndpoint.

bool cat::sphynx::Client::OnResolve ( const char *  hostname,
const NetAddr array,
int  array_length 
) [private]
virtual void cat::sphynx::Client::OnTick ( ThreadPoolLocalStorage tls,
u32  now 
) [protected, pure virtual]
virtual void cat::sphynx::Client::OnTimestampDeltaUpdate ( u32  rtt,
s32  delta 
) [inline, protected, virtual]

Reimplemented from cat::sphynx::Transport.

Definition at line 88 of file SphynxClient.hpp.

{}
void cat::sphynx::Client::OnUnreachable ( const NetAddr src) [private, virtual]

Reimplemented from cat::UDPEndpoint.

virtual void cat::sphynx::Client::OnWrite ( u32  bytes) [private, virtual]

Implements cat::UDPEndpoint.

bool cat::sphynx::Client::PostHello ( ) [private]
virtual bool cat::sphynx::Client::PostPacket ( u8 buffer,
u32  buf_bytes,
u32  msg_bytes,
u32  skip_bytes 
) [private, virtual]
bool cat::sphynx::Client::SetServerKey ( ThreadPoolLocalStorage tls,
const void *  server_key,
int  key_bytes,
const char *  session_key 
)
bool cat::sphynx::Client::ThreadFunction ( void *  param) [private, virtual]

Implements cat::Thread.


Member Data Documentation

Definition at line 66 of file SphynxClient.hpp.

Definition at line 58 of file SphynxClient.hpp.

Definition at line 65 of file SphynxClient.hpp.

Referenced by IsConnected().

Definition at line 56 of file SphynxClient.hpp.

Definition at line 60 of file SphynxClient.hpp.

Definition at line 69 of file SphynxClient.hpp.

Definition at line 63 of file SphynxClient.hpp.

Definition at line 64 of file SphynxClient.hpp.

Definition at line 57 of file SphynxClient.hpp.

Definition at line 54 of file SphynxClient.hpp.

const int cat::sphynx::Client::CLIENT_THREAD_KILL_TIMEOUT = 10000 [static, private]

Definition at line 51 of file SphynxClient.hpp.

const int cat::sphynx::Client::CONNECT_TIMEOUT = 6000 [static, private]

Definition at line 49 of file SphynxClient.hpp.

const int cat::sphynx::Client::HANDSHAKE_TICK_RATE = 100 [static, private]

Definition at line 47 of file SphynxClient.hpp.

const int cat::sphynx::Client::INITIAL_HELLO_POST_INTERVAL = 200 [static, private]

Definition at line 48 of file SphynxClient.hpp.

const u32 cat::sphynx::Client::MTU_PROBE_INTERVAL = 8000 [static, private]

Definition at line 50 of file SphynxClient.hpp.

const int cat::sphynx::Client::SESSION_KEY_BYTES = 32 [static, private]

Definition at line 53 of file SphynxClient.hpp.


The documentation for this class was generated from the following file:

Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.

GNU Lesser General Public License 3 Sourceforge.net