Main Page   File List   File Members   Related Pages  

frdi_client.h File Reference

function headers and defines for the client package More...

#include "../shared/frdi.h"

Go to the source code of this file.

Compounds

struct  frdi__client_app
struct  frdi__client_user
struct  frdi__client_server
struct  frdi__client_game

Functions

frdi_client_app * frdiClientAppNew (frdi_app *app)
int frdiClientAppRun (frdi_client_app *self)
void frdiClientAppFree (frdi_client_app *self)
char * frdiClientAppDisplay (frdi_client_app *self)
void frdiClientPV (frdi_client_app *self, char *str)
void frdiClientPVF (frdi_client_app *self, char *format, void *arg)
frdi_connection * frdiClientServerConnectionNew (frdi_client_app *self, frdi_application *remote)
void * frdiClientServerConnectionRecieve (void *arg)
void * frdiClientUserConnectionRecieve (void *arg)
void frdiClientConnectionClose (frdi_connection *connection)
void * frdiClientUserListenerSpawner (void *arg)
void frdiClientUserListenerWaitStop (frdi_client_app *self)
void frdiClientUserListenerTellStop (frdi_client_app *self)
void frdiClientUserListenerTellStart (frdi_client_app *self)
frdi_client_user * frdiClientUserInitialise (frdi_client_app *self, frdi_connection *connection)
void frdiClientUserFinalise (frdi_client_app *self, frdi_client_user *user)
void frdiClientUserRecieve (frdi_client_app *self, frdi_connection *connection, frdi_message *message)
void frdiClientUserMessageSend (frdi_client_app *self, frdi_client_user *user, frdi_message *message)
char * frdiClientUserDisplay (frdi_client_app *self, frdi_client_user *user)
frdi_client_server * frdiClientServerInitialise (frdi_client_app *self, frdi_connection *connection)
void frdiClientServerFinalise (frdi_client_app *self, frdi_client_server *server)
void frdiClientServerMessageSend (frdi_client_app *self, frdi_client_server *server, frdi_message *message)
void frdiClientServerRecieve (frdi_client_app *self, frdi_connection *connection, frdi_message *message)
char * frdiClientServerDisplay (frdi_client_app *self, frdi_client_server *server)
void frdiClientUserMessageRecieve (frdi_client_app *self, frdi_client_user *user, frdi_message *message)
void frdiClientServerMessageRecieve (frdi_client_app *self, frdi_client_user *user, frdi_client_server *server, frdi_message *message)
void frdiClientUserMsU (frdi_client_app *self, frdi_client_user *user, frdi_message *old_message)
void frdiClientServerMsU (frdi_client_app *self, frdi_client_server *server, frdi_message *old_message)
void frdiClientTellServerStop (frdi_client_app *self, frdi_client_server *server)
void frdiClientTellUserStop (frdi_client_app *self, frdi_client_user *user)
void frdiClientTellAllStop (frdi_client_app *self)
void frdiClientGameSendServer (frdi_client_app *self, frdi_client_game *game, char *str)
void frdiClientServerMrD (frdi_client_app *self, frdi_client_user *user, frdi_client_server *server, frdi_message *message)
void frdiClientServerMrG (frdi_client_app *self, frdi_client_user *user, frdi_client_server *server, frdi_message *message)
void frdiClientServerMrK (frdi_client_app *self, frdi_client_user *user, frdi_client_server *server, frdi_message *message)
void frdiClientServerMrL (frdi_client_app *self, frdi_client_user *user, frdi_client_server *server, frdi_message *message)
void frdiClientServerMrM (frdi_client_app *self, frdi_client_user *user, frdi_client_server *server, frdi_message *message)
void frdiClientServerMrR (frdi_client_app *self, frdi_client_user *user, frdi_client_server *server, frdi_message *message)
void frdiClientServerMrU (frdi_client_app *self, frdi_client_user *user, frdi_client_server *server, frdi_message *message)
void frdiClientServerMrV (frdi_client_app *self, frdi_client_user *user, frdi_client_server *server, frdi_message *message)
void frdiClientServerMrE (frdi_client_app *self, frdi_client_user *user, frdi_client_server *server, frdi_message *message, char c)
void frdiClientGameSendUser (frdi_client_app *self, frdi_client_game *game, char *str)
void frdiClientUserMrD (frdi_client_app *self, frdi_client_user *user, frdi_message *message)
void frdiClientUserMrF (frdi_client_app *self, frdi_client_user *user, frdi_message *message)
void frdiClientUserMrG (frdi_client_app *self, frdi_client_user *user, frdi_message *message)
void frdiClientUserMrK (frdi_client_app *self, frdi_client_user *user, frdi_message *message)
void frdiClientUserMrL (frdi_client_app *self, frdi_client_user *user, frdi_message *message)
void frdiClientUserMrR (frdi_client_app *self, frdi_client_user *user, frdi_message *message)
void frdiClientUserMrU (frdi_client_app *self, frdi_client_user *user, frdi_message *message)
void frdiClientUserMrE (frdi_client_app *self, frdi_client_user *user, frdi_message *message, char c)
void frdiClientEncryptionMode (frdi_client_app *self, frdi_client_user *user, frdi_client_server *server, char *str)
void frdiClientAuthenticationMode (frdi_client_app *self, frdi_client_user *user, frdi_client_server *server, char *str)
void frdiClientAuthenticationTypePass (frdi_client_app *self, frdi_client_user *user, frdi_client_server *server, char *str)
void frdiClientAuthenticationType (frdi_client_app *self, frdi_client_user *user, frdi_client_server *server, char *str)
void frdiClientEncodingMode (frdi_client_app *self, frdi_client_user *user, frdi_client_server *server, char *str)
void frdiClientGameReceiveServer (frdi_client_app *self, frdi_client_game *game, char *str)
void frdiClientGameRevealUsertext (frdi_client_app *self, frdi_client_game *game)
void frdiClientGameReceiveUser (frdi_client_app *self, frdi_client_game *game, char *str)
frdi_client_game * frdiClientGameNew (frdi_client_app *self, char *game_id)
void frdiClientGameLog (frdi_client_app *self, frdi_client_game *game, char *str)
void frdiClientGameFinish (frdi_client_app *self, frdi_client_game *game)
char * frdiClientGameDescribe (frdi_client_app *self, frdi_client_game *game)
void frdiClientGameRegisterDigest (frdi_client_app *self, frdi_client_game *game, char *response)
void frdiClientGameVerifyDigest (frdi_client_app *self, frdi_client_game *game, char *response)
int frdiClientGameIsAllowed (frdi_client_app *self, frdi_client_game *game, char *prefix)
int frdiClientGameCountUsertexts (frdi_client_app *self, frdi_client_game *game)
int frdiClientGameCountDigests (frdi_client_app *self, frdi_client_game *game)
void frdiClientGameVerifyOutput (frdi_client_app *self, frdi_client_game *game)
char * frdiClientGameReport (frdi_client_app *self, frdi_client_game *game)
frdi_client_server * frdiClientGetServerForLink (frdi_client_app *self, frdi_client_user *user, char *link_id)


Detailed Description

function headers and defines for the client package

Author:
Douglas Reay <douglas-legal@reay.org>
Warning:

Function Documentation

frdi_client_app* frdiClientAppNew frdi_app *    app
 

somewhere to put globals

int frdiClientAppRun frdi_client_app *    self
 

doesn't exist until app ready to close

void frdiClientAppFree frdi_client_app *    self
 

release the object

char* frdiClientAppDisplay frdi_client_app *    self
 

return information about this application as a string

void frdiClientPV frdi_client_app *    self,
char *    str
 

print if verbose

void frdiClientPVF frdi_client_app *    self,
char *    format,
void *    arg
 

print if verbose using format

frdi_connection* frdiClientServerConnectionNew frdi_client_app *    self,
frdi_application *    remote
 

connect to a named fairdice server app

void* frdiClientServerConnectionRecieve void *    arg
 

recieve a message from a client-server connection

void* frdiClientUserConnectionRecieve void *    arg
 

recieve a message from a client-user connection

void frdiClientConnectionClose frdi_connection *    connection
 

on closing the connection, free the stuff we created

void* frdiClientUserListenerSpawner void *    arg
 

called in its own thread when the User listener receives a connection

void frdiClientUserListenerWaitStop frdi_client_app *    self
 

wait for the user listener thread to stop

void frdiClientUserListenerTellStop frdi_client_app *    self
 

send a message to the user listener thread to stop

void frdiClientUserListenerTellStart frdi_client_app *    self
 

launch the thread for the user listener

frdi_client_user* frdiClientUserInitialise frdi_client_app *    self,
frdi_connection *    connection
 

register a client-user connection

void frdiClientUserFinalise frdi_client_app *    self,
frdi_client_user *    user
 

de-register a client-user connection

void frdiClientUserRecieve frdi_client_app *    self,
frdi_connection *    connection,
frdi_message *    message
 

recieve a message from a client-user connection

void frdiClientUserMessageSend frdi_client_app *    self,
frdi_client_user *    user,
frdi_message *    message
 

send a message along a client-user connection

char* frdiClientUserDisplay frdi_client_app *    self,
frdi_client_user *    user
 

return a description of this client-user connection

frdi_client_server* frdiClientServerInitialise frdi_client_app *    self,
frdi_connection *    connection
 

register a client-server connection

void frdiClientServerFinalise frdi_client_app *    self,
frdi_client_server *    server
 

de-register a client-server connection

void frdiClientServerMessageSend frdi_client_app *    self,
frdi_client_server *    server,
frdi_message *    message
 

send a message along a client-server connection

void frdiClientServerRecieve frdi_client_app *    self,
frdi_connection *    connection,
frdi_message *    message
 

recieve a message from a client-server connection

char* frdiClientServerDisplay frdi_client_app *    self,
frdi_client_server *    server
 

return a description of this client-server connection

void frdiClientUserMessageRecieve frdi_client_app *    self,
frdi_client_user *    user,
frdi_message *    message
 

recieve a message from a user-client connection D Description F Find G Game K Keepalive L Link R Remote U Unknown

void frdiClientServerMessageRecieve frdi_client_app *    self,
frdi_client_user *    user,
frdi_client_server *    server,
frdi_message *    message
 

recieve a message from a client-server connection D Description G Game K Keepalive L Link M Mode R Remote U Unknown V Version

void frdiClientUserMsU frdi_client_app *    self,
frdi_client_user *    user,
frdi_message *    old_message
 

send a U type message along a client-user connection

void frdiClientServerMsU frdi_client_app *    self,
frdi_client_server *    server,
frdi_message *    old_message
 

send a U type message along a client-server connection

void frdiClientTellServerStop frdi_client_app *    self,
frdi_client_server *    server
 

tell a server connection that they are closing

void frdiClientTellUserStop frdi_client_app *    self,
frdi_client_user *    user
 

tell a user connections (and related server connections) that they are closing

void frdiClientTellAllStop frdi_client_app *    self
 

tell all connections (server and user) that they are closing

void frdiClientGameSendServer frdi_client_app *    self,
frdi_client_game *    game,
char *    str
 

Send str back to the server as a game message

void frdiClientServerMrD frdi_client_app *    self,
frdi_client_user *    user,
frdi_client_server *    server,
frdi_message *    message
 

Fairdice Client-Server connection message receive : Description CHALLENGE : D is <description> RESPONSE : none ACTION : set description of server

CHALLENGE : D request RESPONSE : D is <description> or RESPONSE : D null ACTION : none

void frdiClientServerMrG frdi_client_app *    self,
frdi_client_user *    user,
frdi_client_server *    server,
frdi_message *    message
 

Fairdice Client-Server connection message receive : Game

CHALLENGE : G <gamestr> <seperator> <data> RESPONSE : varies ACTION : parse <gamestr> into a frdi_client_game object. pass on to further method

void frdiClientServerMrK frdi_client_app *    self,
frdi_client_user *    user,
frdi_client_server *    server,
frdi_message *    message
 

Fairdice Client-Server connection message receive : Keepalive

CHALLENGE : K null RESPONSE : none ACTION : none

CHALLENGE : K ping request <integer> RESPONSE : K ping response <integer> ACTION : none

CHALLENGE : K ping response <integer> RESPONSE : none ACTION : record ping delay

CHALLENGE : K time request RESPONSE : K time response <timestamp> ACTION : none

CHALLENGE : K time response <timestamp> RESPONSE : none ACTION : synch time

void frdiClientServerMrL frdi_client_app *    self,
frdi_client_user *    user,
frdi_client_server *    server,
frdi_message *    message
 

Fairdice Client-Server connection message receive : Link

CHALLENGE : L opening RESPONSE : L opened ACTION : none

CHALLENGE : L opened RESPONSE : none ACTION : none

CHALLENGE : L closing RESPONSE : L closed ACTION : close this end of link

CHALLENGE : L closed RESPONSE : none ACTION : close this end of link

void frdiClientServerMrM frdi_client_app *    self,
frdi_client_user *    user,
frdi_client_server *    server,
frdi_message *    message
 

Fairdice Client-Server connection message receive : Mode

CHALLENGE : M auth <data> RESPONSE : varies ACTION : pass on to authentication negotiation method

CHALLENGE : M encrypt <data> RESPONSE : varies ACTION : pass on to encryption negotiation method

CHALLENGE : M encode <data> RESPONSE : varies ACTION : pass on to data encoding negotiation method

void frdiClientServerMrR frdi_client_app *    self,
frdi_client_user *    user,
frdi_client_server *    server,
frdi_message *    message
 

Fairdice Client-Server connection message receive : Remote

CHALLENGE : R <data> RESPONSE : none ACTION : pass on verbatim along the user (keeping the R prefix)

void frdiClientServerMrU frdi_client_app *    self,
frdi_client_user *    user,
frdi_client_server *    server,
frdi_message *    message
 

Fairdice Client-Server connection message receive : Unknown

CHALLENGE : U null RESPONSE : none ACTION : report the error

CHALLENGE : U <verbatim copy of message server got from us> RESPONSE : none ACTION : report the error

void frdiClientServerMrV frdi_client_app *    self,
frdi_client_user *    user,
frdi_client_server *    server,
frdi_message *    message
 

Fairdice Client-Server connection message receive : Version

CHALLENGE : V request RESPONSE : V offer <number selection> ACTION : none

CHALLENGE : V offer <number selection> RESPONSE : V select <number> or RESPONSE : V unsupported ACTION : none

CHALLENGE : V select <number> RESPONSE : none or RESPONSE : V unsupported ACTION : none

where <number> is a positive integer identifying a specific version of the client-server link protocol.

where <number range> is "<number>-<number>"

where <number selection> is a comma seperated list of <number> and or <number range>

for example 1,3-5,7

void frdiClientServerMrE frdi_client_app *    self,
frdi_client_user *    user,
frdi_client_server *    server,
frdi_message *    message,
char    c
 

Fairdice Client-Server connection message receive : A Mystery

CHALLENGE : <unparsable> RESPONSE : U <unparsable> ACTION : report the error

void frdiClientGameSendUser frdi_client_app *    self,
frdi_client_game *    game,
char *    str
 

Send str back to the user as a game message

void frdiClientUserMrD frdi_client_app *    self,
frdi_client_user *    user,
frdi_message *    message
 

Fairdice User-Client connection message receive : Description CHALLENGE : D is <description> RESPONSE : none ACTION : set description of user

CHALLENGE : D request RESPONSE : D is <description> or RESPONSE : D null ACTION : none

void frdiClientUserMrF frdi_client_app *    self,
frdi_client_user *    user,
frdi_message *    message
 

Fairdice User-Client connection message receive : Find CHALLENGE : F set user <userstr> CHALLENGE : F set secret <secret> CHALLENGE : F set server <serverstr> CHALLENGE : F set host <hoststr> RESPONSE : none ACTION : register the string ready for a connection attempt

CHALLENGE : F connect RESPONSE : F yes or RESPONSE : F no or RESPONSE : F no <message> ACTION : connect to the server (and host if specified)

CHALLENGE : F shutdown RESPONSE : none ACTION : stop the listener, close the application

void frdiClientUserMrG frdi_client_app *    self,
frdi_client_user *    user,
frdi_message *    message
 

Fairdice User-Client connection message receive : Game

CHALLENGE : G <gamestr> <seperator> <data> RESPONSE : varies ACTION : parse <gamestr> into a frdi_client_game object. pass on to further method

void frdiClientUserMrK frdi_client_app *    self,
frdi_client_user *    user,
frdi_message *    message
 

Fairdice User-Client connection message receive : Keepalive

CHALLENGE : K null RESPONSE : none ACTION : none

CHALLENGE : K ping request <integer> RESPONSE : K ping response <integer> ACTION : none

CHALLENGE : K ping response <integer> RESPONSE : none ACTION : record ping delay

CHALLENGE : K time request RESPONSE : K time response <timestamp> ACTION : none

CHALLENGE : K time response <timestamp> RESPONSE : none ACTION : synch time

void frdiClientUserMrL frdi_client_app *    self,
frdi_client_user *    user,
frdi_message *    message
 

Fairdice User-Client connection message receive : Link

CHALLENGE : L opening RESPONSE : L opened ACTION : none

CHALLENGE : L opened RESPONSE : none ACTION : none

CHALLENGE : L closing RESPONSE : L closed ACTION : close this end of link

CHALLENGE : L closed RESPONSE : none ACTION : close this end of link

void frdiClientUserMrR frdi_client_app *    self,
frdi_client_user *    user,
frdi_message *    message
 

Fairdice User-Client connection message receive : Remote

CHALLENGE : R <data> RESPONSE : none ACTION : pass on verbatim along to the client (keeping the R prefix)

void frdiClientUserMrU frdi_client_app *    self,
frdi_client_user *    user,
frdi_message *    message
 

Fairdice User-Client connection message receive : Unknown

CHALLENGE : U null RESPONSE : none ACTION : report the error

CHALLENGE : U <verbatim copy of message server got from us> RESPONSE : none ACTION : report the error

void frdiClientUserMrE frdi_client_app *    self,
frdi_client_user *    user,
frdi_message *    message,
char    c
 

Fairdice User-Client connection message receive : A Mystery

CHALLENGE : <unparsable> RESPONSE : U <unparsable> ACTION : report the error

void frdiClientEncryptionMode frdi_client_app *    self,
frdi_client_user *    user,
frdi_client_server *    server,
char *    str
 

negotiate which encryption mode to use

void frdiClientAuthenticationMode frdi_client_app *    self,
frdi_client_user *    user,
frdi_client_server *    server,
char *    str
 

negotiate which authentication mode to use

void frdiClientAuthenticationTypePass frdi_client_app *    self,
frdi_client_user *    user,
frdi_client_server *    server,
char *    str
 

messages specific to the authentication mode "pass"

void frdiClientAuthenticationType frdi_client_app *    self,
frdi_client_user *    user,
frdi_client_server *    server,
char *    str
 

messages specific to a particular authentication mode

void frdiClientEncodingMode frdi_client_app *    self,
frdi_client_user *    user,
frdi_client_server *    server,
char *    str
 

negotiate which encoding mode to use

void frdiClientGameReceiveServer frdi_client_app *    self,
frdi_client_game *    game,
char *    str
 

deal with a game str from the server

void frdiClientGameRevealUsertext frdi_client_app *    self,
frdi_client_game *    game
 

reveal our input

void frdiClientGameReceiveUser frdi_client_app *    self,
frdi_client_game *    game,
char *    str
 

deal with a game str from the user

frdi_client_game* frdiClientGameNew frdi_client_app *    self,
char *    game_id
 

create a game object (values get filled in by the create object)

void frdiClientGameLog frdi_client_app *    self,
frdi_client_game *    game,
char *    str
 

log it

void frdiClientGameFinish frdi_client_app *    self,
frdi_client_game *    game
 

de-register and destroy a game object

char* frdiClientGameDescribe frdi_client_app *    self,
frdi_client_game *    game
 

describe it

void frdiClientGameRegisterDigest frdi_client_app *    self,
frdi_client_game *    game,
char *    response
 

register a digest response is of the form "<integer> <string>"

void frdiClientGameVerifyDigest frdi_client_app *    self,
frdi_client_game *    game,
char *    response
 

verify a digest response is of the form "<user_id> <user_text>"

int frdiClientGameIsAllowed frdi_client_app *    self,
frdi_client_game *    game,
char *    prefix
 

check whether a response is allowed at a particular stage

int frdiClientGameCountUsertexts frdi_client_app *    self,
frdi_client_game *    game
 

have we received all the usertexts we requested? (there should be one for every player + 1 for the host - 1 for ourselves

int frdiClientGameCountDigests frdi_client_app *    self,
frdi_client_game *    game
 

have we received all the digests we requested? (there should be one for every player + 1 for the host - 1 for ourselves

void frdiClientGameVerifyOutput frdi_client_app *    self,
frdi_client_game *    game
 

verify the output

char* frdiClientGameReport frdi_client_app *    self,
frdi_client_game *    game
 

report the outcome of a game to the server in complete terms

frdi_client_server* frdiClientGetServerForLink frdi_client_app *    self,
frdi_client_user *    user,
char *    link_id
 

the correct replacelent for frdiClientGetServerForUser( link_id is of form "foo:123 ^ bar:123"


Generated on Wed Aug 18 13:23:49 2004 for Project Fairdice by doxygen1.2.18