The Assimilation Project
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
FsProtocol class
Collaboration diagram for FsProtocol class:

Macros

#define A_CLOSE   (1<<0)
 0x01 - set cleanup timer More...
 
#define A_OOPS   (1<<1)
 0x02 - this should not happen - complain about it More...
 
#define A_DEBUG   (1<<2)
 0x04 - print state info, etc More...
 
#define A_SNDNAK   (1<<3)
 0x08 Don't appear to be using this action... More...
 
#define A_SNDSHUT   (1<<4)
 0x10 Send CONNSHUT packet More...
 
#define A_ACKTO   (1<<5)
 0x20 - Announce an ACK timeout - 0x20 More...
 
#define A_ACKME   (1<<6)
 0x40 - Ack this packet More...
 
#define A_TIMER   (1<<7)
 0x80 Start the FSPROTO_SHUT_TO timer - calls _fsprotocol_shuttimeout - More...
 
#define A_NOTIME   (1<<8)
 0x100 Cancel the FSPROTO_SHUT_TO timer More...
 
#define A_NOSHUT   (1<<9)
 0x200 Flush out any pending CONNSHUT packets More...
 
#define SHUTnTIMER   (A_SNDSHUT|A_TIMER)
 
#define ACKnSHUT   (A_ACKME|SHUTnTIMER)
 
#define ACKnCLOSE   (A_ACKME|A_CLOSE)
 
#define CLOSEnNOTIME   (A_CLOSE|A_NOTIME)
 
#define TRYXMIT(fspe)   {AUDITFSPE(fspe); _fsprotocol_xmitifwecan(fspe);}
 Try and transmit a packet after auditing the FSPE data structure. More...
 

Enumerations

enum  _FsProtoInput {
  FSPROTO_GOTSTART = 0, FSPROTO_REQSEND = 1, FSPROTO_GOTACK = 2, FSPROTO_GOTCONN_NAK = 3,
  FSPROTO_REQSHUTDOWN = 4, FSPROTO_RCVSHUTDOWN = 5, FSPROTO_ACKTIMEOUT = 6, FSPROTO_OUTALLDONE = 7,
  FSPROTO_SHUT_TO = 8, FSPROTO_INVAL
}
 Inputs are: More...
 

Functions

FSTATIC const char * _fsprotocol_fsa_states (FsProtoState state)
 Returns the state name (string) for state - returns static data. More...
 
FSTATIC const char * _fsprotocol_fsa_inputs (FsProtoInput input)
 Returns the input name (string) for an input - returns static array. More...
 
FSTATIC const char * _fsprotocol_fsa_actions (unsigned actionmask)
 Returns a string representing a set of actions - static array returned. More...
 
FSTATIC void _fsprotocol_fsa (FsProtoElem *fspe,FsProtoInput input, FrameSet *fs)
 FsProtocol Finite state Automaton modelling connection establishment and shutdown. More...
 
FSTATIC void _fsprotocol_flush_pending_connshut (FsProtoElem *fspe)
 Flush the leading CONNSHUT packet in the queue – if any. More...
 
FSTATIC void _fsprotocol_auditfspe (const FsProtoElem *self, const char *function, int lineno)
 Audit a FsProtoElem object for consistency */. More...
 
FSTATIC void _fsprotocol_auditiready (const char *fun, unsigned lineno, const FsProtocol *self)
 
FSTATIC FsProtoElem_fsprotocol_find (FsProtocol *self, guint16 qid, const NetAddr *destaddr)
 Locate the FsProtoElem structure that corresponds to this (destaddr, qid) pair Convert everything to v6 addresses before lookup. More...
 
FSTATIC FsProtoElem_fsprotocol_findbypkt (FsProtocol *self, NetAddr *addr, FrameSet *fs)
 Find the FsProtoElem that corresponds to the given FrameSet class. More...
 
FSTATIC FsProtoElem_fsprotocol_addconn (FsProtocol *self, guint16 qid, NetAddr *destaddr)
 Add and return a FsProtoElem connection to our collection of connections... More...
 
FSTATIC void _fsprotocol_closeconn (FsProtocol *self, guint16 qid, const NetAddr *destaddr)
 Close a specific connection - allowing it to be reopened by more communication – effectively a reset. More...
 
FSTATIC void _fsprotocol_closeall (FsProtocol *self)
 Start the process of shutting down all our connections. More...
 
FSTATIC gboolean _fsprotocol_canclose_immediately (gpointer v_fspe, gpointer unused, gpointer unused_user)
 Returns TRUE if the given FSPE can be closed immediately. More...
 
FSTATIC int _fsprotocol_activeconncount (FsProtocol *self)
 
FSTATIC FsProtoState _fsprotocol_connstate (FsProtocol *self, guint16 qid, const NetAddr *destaddr)
 
FSTATIC void _fsprotocol_fspe_reinit (FsProtoElem *self)
 
FSTATIC void _fsprotocol_fspe_closeconn (FsProtoElem *self)
 Close down (destroy) an FSPE-level connection Note that this depends on FsProtoElemSearchKey being the same as start of FsProtoElem. More...
 
WINEXPORT FsProtocolfsprotocol_new (guint objsize, NetIO *io, guint rexmit_timer_uS)
 Construct an FsQueue object. More...
 
FSTATIC void _fsprotocol_finalize (AssimObj *aself)
 Finalize function for our FsProtocol class objects. More...
 
FSTATIC void _fsprotocol_protoelem_destroy (gpointer fsprotoelemthing)
 Finalize function suitable for GHashTables holding FsProtoElems as keys (and values) More...
 
FSTATIC gboolean _fsprotocol_protoelem_equal (gconstpointer lhs, gconstpointer rhs)
 Equal-compare function for FsProtoElem structures suitable for GHashTables. More...
 
FSTATIC guint _fsprotocol_protoelem_hash (gconstpointer fsprotoelemthing)
 Hash function over FsProtoElem structures suitable for GHashTables. More...
 
FSTATIC gboolean _fsprotocol_iready (FsProtocol *self)
 Return TRUE if there are any packets available to read. More...
 
FSTATIC gboolean _fsprotocol_outputpending (FsProtocol *self)
 Return TRUE if there are any unACKed packets in any output queue. More...
 
FSTATIC FrameSet_fsprotocol_read (FsProtocol *self, NetAddr **fromaddr)
 Read the next available packet from any of our sources. More...
 
FSTATIC void _fsprotocol_receive (FsProtocol *self, NetAddr *fromaddr, FrameSet *fs)
 Enqueue a received packet - handling ACKs when they show up. More...
 
FSTATIC gboolean _fsprotocol_send1 (FsProtocol *self, FrameSet *fs, guint16 qid, NetAddr *toaddr)
 Enqueue and send a single reliable frameset. More...
 
FSTATIC gboolean _fsprotocol_send (FsProtocol *self, GSList *framesets, guint16 qid, NetAddr *toaddr)
 Enqueue and send a list of reliable FrameSets (send all or none) More...
 
FSTATIC void _fsprotocol_ackmessage (FsProtocol *self, NetAddr *destaddr, FrameSet *fs)
 Send an ACK packet that corresponds to this FrameSet. More...
 
FSTATIC void _fsprotocol_ackseqno (FsProtocol *self, NetAddr *destaddr, SeqnoFrame *seq)
 Send an ACK packet that corresponds to this sequence number frame. More...
 
FSTATIC void _fsprotocol_xmitifwecan (FsProtoElem *fspe)
 Our role in life is to send any packets that need sending. More...
 
FSTATIC gboolean _fsprotocol_timeoutfun (gpointer userdata)
 Retransmit timer function... More...
 
FSTATIC gboolean _fsprotocol_shuttimeout (gpointer userdata)
 Channel shutdown timer - invokes the FSA with FSPROTO_SHUT_TO. More...
 
FSTATIC gboolean _fsprotocol_finalizetimer (gpointer userdata)
 Close down (free up) an FSPE object when the timer pops - provided its still closed... More...
 
FSTATIC void _fsprotocol_log_conn (FsProtocol *self, guint16 qid, NetAddr *destaddr)
 Dump information about this connection to our logs. More...
 
typedef struct _FsProtocol FsProtocol
 

Detailed Description

Macro Definition Documentation

#define A_ACKME   (1<<6)

0x40 - Ack this packet

Definition at line 119 of file fsprotocol.c.

Referenced by _fsprotocol_fsa(), and _fsprotocol_fsa_actions().

#define A_ACKTO   (1<<5)

0x20 - Announce an ACK timeout - 0x20

Definition at line 118 of file fsprotocol.c.

Referenced by _fsprotocol_fsa(), and _fsprotocol_fsa_actions().

#define A_CLOSE   (1<<0)

0x01 - set cleanup timer

Definition at line 113 of file fsprotocol.c.

Referenced by _fsprotocol_fsa(), and _fsprotocol_fsa_actions().

#define A_DEBUG   (1<<2)

0x04 - print state info, etc

Definition at line 115 of file fsprotocol.c.

Referenced by _fsprotocol_fsa(), and _fsprotocol_fsa_actions().

#define A_NOSHUT   (1<<9)

0x200 Flush out any pending CONNSHUT packets

Definition at line 123 of file fsprotocol.c.

Referenced by _fsprotocol_fsa(), and _fsprotocol_fsa_actions().

#define A_NOTIME   (1<<8)

0x100 Cancel the FSPROTO_SHUT_TO timer

Definition at line 122 of file fsprotocol.c.

Referenced by _fsprotocol_fsa(), and _fsprotocol_fsa_actions().

#define A_OOPS   (1<<1)

0x02 - this should not happen - complain about it

Definition at line 114 of file fsprotocol.c.

Referenced by _fsprotocol_fsa(), and _fsprotocol_fsa_actions().

#define A_SNDNAK   (1<<3)

0x08 Don't appear to be using this action...

Definition at line 116 of file fsprotocol.c.

Referenced by _fsprotocol_fsa(), and _fsprotocol_fsa_actions().

#define A_SNDSHUT   (1<<4)

0x10 Send CONNSHUT packet

Definition at line 117 of file fsprotocol.c.

Referenced by _fsprotocol_fsa(), and _fsprotocol_fsa_actions().

#define A_TIMER   (1<<7)

0x80 Start the FSPROTO_SHUT_TO timer - calls _fsprotocol_shuttimeout -

which will eventually call the FSA with FSPROTO_SHUT_TO

Definition at line 120 of file fsprotocol.c.

Referenced by _fsprotocol_fsa(), and _fsprotocol_fsa_actions().

#define ACKnCLOSE   (A_ACKME|A_CLOSE)

Definition at line 127 of file fsprotocol.c.

#define ACKnSHUT   (A_ACKME|SHUTnTIMER)

Definition at line 126 of file fsprotocol.c.

#define CLOSEnNOTIME   (A_CLOSE|A_NOTIME)

Definition at line 128 of file fsprotocol.c.

#define SHUTnTIMER   (A_SNDSHUT|A_TIMER)

Definition at line 125 of file fsprotocol.c.

#define TRYXMIT (   fspe)    {AUDITFSPE(fspe); _fsprotocol_xmitifwecan(fspe);}

Try and transmit a packet after auditing the FSPE data structure.

Definition at line 400 of file fsprotocol.c.

Referenced by _fsprotocol_read(), _fsprotocol_receive(), _fsprotocol_send(), _fsprotocol_send1(), and _fsprotocol_timeoutfun().

Typedef Documentation

typedef struct _FsProtocol FsProtocol

Definition at line 45 of file fsprotocol.h.

Enumeration Type Documentation

Inputs are:

Enumerator
FSPROTO_GOTSTART 

Received a packet with sequence number 1 and a valid (new) session id.

FSPROTO_REQSEND 

Got request to send a packet.

FSPROTO_GOTACK 

Received a legitimate ACK.

FSPROTO_GOTCONN_NAK 

Received a CONN_NAK packet.

FSPROTO_REQSHUTDOWN 

Got request to shut down.

FSPROTO_RCVSHUTDOWN 

Received a CONNSHUT packet.

FSPROTO_ACKTIMEOUT 

Timed out waiting for an ACK.

FSPROTO_OUTALLDONE 

All output has been ACKed.

FSPROTO_SHUT_TO 

Got a timeout waiting for a SHUTDOWN.

FSPROTO_INVAL 

End marker – invalid input.

Definition at line 87 of file fsprotocol.c.

Function Documentation

FSTATIC void _fsprotocol_ackmessage ( FsProtocol self,
NetAddr destaddr,
FrameSet fs 
)

Send an ACK packet that corresponds to this FrameSet.

Definition at line 1130 of file fsprotocol.c.

References _fsprotocol_ackseqno(), and _FrameSet::getseqno.

Referenced by fsprotocol_new().

Here is the call graph for this function:

Here is the caller graph for this function:

FSTATIC void _fsprotocol_ackseqno ( FsProtocol self,
NetAddr destaddr,
SeqnoFrame seq 
)

Send an ACK packet that corresponds to this sequence number frame.

Definition at line 1140 of file fsprotocol.c.

References __FUNCTION__, _SeqnoFrame::_qid, AUDITFSPE, _Frame::baseclass, _SeqnoFrame::baseclass, _NetAddr::baseclass, _SeqnoFrame::compare, DEBUGMSG3, DUMP3, frameset_append_frame(), frameset_new(), FRAMESETTYPE_ACK, _FsProtoElem::lastacksent, REF2, UNREF, and UNREF2.

Referenced by _fsprotocol_ackmessage(), _fsprotocol_fsa(), and _fsprotocol_receive().

Here is the call graph for this function:

Here is the caller graph for this function:

FSTATIC int _fsprotocol_activeconncount ( FsProtocol self)
FSTATIC FsProtoElem * _fsprotocol_addconn ( FsProtocol self,
guint16  qid,
NetAddr destaddr 
)

Add and return a FsProtoElem connection to our collection of connections...

Note that if it's already there, the existing connection will be returned.

Parameters
selftypical FsProtocol 'self' object
qidQueue id for the connection
destaddrdestination address

Definition at line 522 of file fsprotocol.c.

References __FUNCTION__, _FsProtoElem::_qid, _FsProtoElem::acktimeout, _NetAddr::baseclass, DEBUGMSG3, DUMP3, _FsProtoElem::endpoint, _FsProtoElem::finalizetimer, FSPR_NONE, fsqueue_new(), _FsProtoElem::inq, _FsProtoElem::lastacksent, _FsProtoElem::lastseqsent, MALLOCCLASS, _FsProtoElem::nextrexmit, _FsProtoElem::outq, _FsProtoElem::parent, _FsProtoElem::shutdown_complete, _FsProtoElem::shuttimer, _FsProtoElem::state, and _NetAddr::toIPv6.

Referenced by fsprotocol_new().

Here is the call graph for this function:

Here is the caller graph for this function:

FSTATIC void _fsprotocol_auditfspe ( const FsProtoElem self,
const char *  function,
int  lineno 
)

Audit a FsProtoElem object for consistency */.

Definition at line 406 of file fsprotocol.c.

References DUMP, and _FsProtocol::unacked.

FSTATIC void _fsprotocol_auditiready ( const char *  fun,
unsigned  lineno,
const FsProtocol self 
)
FSTATIC gboolean _fsprotocol_canclose_immediately ( gpointer  unused_key,
gpointer  v_fspe,
gpointer  unused_user 
)

Returns TRUE if the given FSPE can be closed immediately.

Definition at line 596 of file fsprotocol.c.

References _FsQueue::_nextseqno, _NetAddr::baseclass, CASTTOCLASS, DUMP3, _FsProtoElem::endpoint, _FsProtoElem::inq, and _FsProtoElem::outq.

Referenced by _fsprotocol_closeall().

Here is the caller graph for this function:

FSTATIC void _fsprotocol_closeall ( FsProtocol self)

Start the process of shutting down all our connections.

Definition at line 577 of file fsprotocol.c.

References __FUNCTION__, _fsprotocol_canclose_immediately(), _fsprotocol_closeconn(), _FsProtoElem::_qid, CASTTOCLASS, DEBUGMSG, and _FsProtoElem::endpoint.

Referenced by fsprotocol_new().

Here is the call graph for this function:

Here is the caller graph for this function:

FSTATIC void _fsprotocol_closeconn ( FsProtocol self,
guint16  qid,
const NetAddr destaddr 
)

Close a specific connection - allowing it to be reopened by more communication – effectively a reset.

Parameters
selftypical FsProtocol 'self' object
qidQueue id for the connection
destaddrdestination address

Definition at line 559 of file fsprotocol.c.

References _fsprotocol_find(), _fsprotocol_fsa(), _NetAddr::baseclass, DEBUG, DUMP, DUMP3, and FSPROTO_REQSHUTDOWN.

Referenced by _fsprotocol_closeall(), and fsprotocol_new().

Here is the call graph for this function:

Here is the caller graph for this function:

FSTATIC FsProtoState _fsprotocol_connstate ( FsProtocol self,
guint16  qid,
const NetAddr destaddr 
)

Definition at line 640 of file fsprotocol.c.

References _fsprotocol_find(), FSPR_NONE, and _FsProtoElem::state.

Referenced by fsprotocol_new().

Here is the call graph for this function:

Here is the caller graph for this function:

FSTATIC void _fsprotocol_finalize ( AssimObj aself)

Finalize function for our FsProtocol class objects.

Parameters
aselfFsProtocol object to finalize

Definition at line 767 of file fsprotocol.c.

References CASTTOCLASS, DUMP3, and FREECLASSOBJ.

Referenced by fsprotocol_new().

Here is the caller graph for this function:

FSTATIC gboolean _fsprotocol_finalizetimer ( gpointer  userdata)

Close down (free up) an FSPE object when the timer pops - provided its still closed...

Definition at line 1311 of file fsprotocol.c.

References _fsprotocol_fspe_closeconn(), AUDITFSPE, CASTTOCLASS, FSPR_NONE, and _FsProtoElem::state.

Referenced by _fsprotocol_fsa().

Here is the call graph for this function:

Here is the caller graph for this function:

FSTATIC FsProtoElem * _fsprotocol_find ( FsProtocol self,
guint16  qid,
const NetAddr destaddr 
)

Locate the FsProtoElem structure that corresponds to this (destaddr, qid) pair Convert everything to v6 addresses before lookup.

Parameters
selftypical FsProtocol 'self' object
qidQueue id of far endpoint
destaddrdestination address

Definition at line 466 of file fsprotocol.c.

References _NetAddr::_addrtype, _FsProtoElemSearchKey::_qid, ADDR_FAMILY_IPV4, ADDR_FAMILY_IPV6, CASTTOCLASS, destaddr, _FsProtoElemSearchKey::endpoint, _NetAddr::toIPv6, and UNREF.

Referenced by _fsprotocol_closeconn(), _fsprotocol_connstate(), and fsprotocol_new().

Here is the caller graph for this function:

FSTATIC FsProtoElem * _fsprotocol_findbypkt ( FsProtocol self,
NetAddr addr,
FrameSet fs 
)

Find the FsProtoElem that corresponds to the given FrameSet class.

The FrameSet can have a sequence number - or not.

Todo:
Should we only do this for the case where the frameset type is STARTUP?
Parameters
selfThe FsProtocol object we're operating on
addrThe Network address we're looking for
fsThe FrameSet whose queue id we'll use in looking for it

Definition at line 496 of file fsprotocol.c.

References DEFAULT_FSP_QID, _SeqnoFrame::getqid, and _FrameSet::getseqno.

Referenced by fsprotocol_new().

Here is the caller graph for this function:

FSTATIC void _fsprotocol_flush_pending_connshut ( FsProtoElem fspe)

Flush the leading CONNSHUT packet in the queue – if any.

Definition at line 381 of file fsprotocol.c.

References _FrameSet::baseclass, DUMP3, _FsQueue::flush1, FRAMESETTYPE_CONNSHUT, _FrameSet::fstype, _FsProtoElem::outq, and _FsQueue::qhead.

Referenced by _fsprotocol_fsa().

Here is the caller graph for this function:

FSTATIC void _fsprotocol_fsa ( FsProtoElem fspe,
FsProtoInput  input,
FrameSet fs 
)
FSTATIC const char* _fsprotocol_fsa_actions ( unsigned  actionmask)

Returns a string representing a set of actions - static array returned.

Definition at line 184 of file fsprotocol.c.

References A_ACKME, A_ACKTO, A_CLOSE, A_DEBUG, A_NOSHUT, A_NOTIME, A_OOPS, A_SNDNAK, A_SNDSHUT, A_TIMER, and DIMOF.

FSTATIC const char * _fsprotocol_fsa_inputs ( FsProtoInput  input)

Returns the input name (string) for an input - returns static array.

Definition at line 163 of file fsprotocol.c.

References FSPROTO_ACKTIMEOUT, FSPROTO_GOTACK, FSPROTO_GOTCONN_NAK, FSPROTO_GOTSTART, FSPROTO_INVAL, FSPROTO_OUTALLDONE, FSPROTO_RCVSHUTDOWN, FSPROTO_REQSEND, FSPROTO_REQSHUTDOWN, and FSPROTO_SHUT_TO.

Referenced by _fsprotocol_fsa().

Here is the caller graph for this function:

FSTATIC const char * _fsprotocol_fsa_states ( FsProtoState  state)

Returns the state name (string) for state - returns static data.

Definition at line 145 of file fsprotocol.c.

References FSPR_INIT, FSPR_INVALID, FSPR_NONE, FSPR_SHUT1, FSPR_SHUT2, FSPR_SHUT3, and FSPR_UP.

Referenced by _fsprotocol_fsa().

Here is the caller graph for this function:

FSTATIC void _fsprotocol_fspe_closeconn ( FsProtoElem self)

Close down (destroy) an FSPE-level connection Note that this depends on FsProtoElemSearchKey being the same as start of FsProtoElem.

Definition at line 694 of file fsprotocol.c.

References DUMP5.

Referenced by _fsprotocol_finalizetimer().

Here is the caller graph for this function:

FSTATIC void _fsprotocol_fspe_reinit ( FsProtoElem self)

Definition at line 651 of file fsprotocol.c.

References __FUNCTION__, AUDITIREADY, DUMP3, FSPR_NONE, and UNREF2.

Referenced by _fsprotocol_fsa(), and _fsprotocol_protoelem_destroy().

Here is the caller graph for this function:

FSTATIC gboolean _fsprotocol_iready ( FsProtocol self)

Return TRUE if there are any packets available to read.

Parameters
selfOur object

Definition at line 845 of file fsprotocol.c.

References AUDITIREADY.

Referenced by fsprotocol_new().

Here is the caller graph for this function:

FSTATIC void _fsprotocol_log_conn ( FsProtocol self,
guint16  qid,
NetAddr destaddr 
)

Dump information about this connection to our logs.

Definition at line 1324 of file fsprotocol.c.

References _NetAddr::baseclass, _FsQueue::baseclass, g_info, _FsProtoElem::inq, _FsProtoElem::outq, and _AssimObj::toString.

Referenced by fsprotocol_new().

Here is the caller graph for this function:

FSTATIC gboolean _fsprotocol_outputpending ( FsProtocol self)

Return TRUE if there are any unACKed packets in any output queue.

Parameters
selfOur object

Definition at line 853 of file fsprotocol.c.

Referenced by fsprotocol_new().

Here is the caller graph for this function:

FSTATIC void _fsprotocol_protoelem_destroy ( gpointer  fsprotoelemthing)

Finalize function suitable for GHashTables holding FsProtoElems as keys (and values)

Parameters
fsprotoelemthingFsProtoElem to destroy

Definition at line 798 of file fsprotocol.c.

References __FUNCTION__, _fsprotocol_fspe_reinit(), CASTTOCLASS, DUMP3, DUMP5, FREECLASSOBJ, and UNREF.

Referenced by fsprotocol_new().

Here is the call graph for this function:

Here is the caller graph for this function:

FSTATIC gboolean _fsprotocol_protoelem_equal ( gconstpointer  lhs,
gconstpointer  rhs 
)

Equal-compare function for FsProtoElem structures suitable for GHashTables.

Parameters
lhsFsProtoElem left hand side to compare
rhsFsProtoElem right hand side to compare

Definition at line 821 of file fsprotocol.c.

References _FsProtoElem::_qid, _FsProtoElem::endpoint, and _NetAddr::equal.

Referenced by fsprotocol_new().

Here is the caller graph for this function:

FSTATIC guint _fsprotocol_protoelem_hash ( gconstpointer  fsprotoelemthing)

Hash function over FsProtoElem structures suitable for GHashTables.

Parameters
fsprotoelemthingFsProtoElem to hash

Definition at line 835 of file fsprotocol.c.

References _FsProtoElem::_qid, _FsProtoElem::endpoint, and _NetAddr::hash.

Referenced by fsprotocol_new().

Here is the caller graph for this function:

FSTATIC FrameSet * _fsprotocol_read ( FsProtocol self,
NetAddr **  fromaddr 
)

Read the next available packet from any of our sources.

Parameters
selfOur object - our very self!
fromaddrThe IP address our result came from

Definition at line 860 of file fsprotocol.c.

References _FsQueue::_destaddr, _FsQueue::_nextseqno, _SeqnoFrame::_reqid, AUDITIREADY, _FrameSet::baseclass, CASTTOCLASS, _FsQueue::deq, DUMP4, _FrameSet::getseqno, _FsProtoElem::inq, _FsQueue::isready, _FsQueue::qhead, REF, and TRYXMIT.

Referenced by fsprotocol_new().

Here is the caller graph for this function:

FSTATIC gboolean _fsprotocol_send ( FsProtocol self,
GSList *  framesets,
guint16  qid,
NetAddr toaddr 
)

Enqueue and send a list of reliable FrameSets (send all or none)

Parameters
selfOur object
framesetsFramesets to be sent
qidFar endpoint queue id
toaddrWhere to send them

Definition at line 1087 of file fsprotocol.c.

References __FUNCTION__, _fsprotocol_fsa(), _FsQueue::_q, AUDITFSPE, CASTTOCLASS, DEBUGMSG3, _FsQueue::enq, FSPR_INSHUTDOWN, FSPROTO_REQSEND, _FrameSet::fstype, _FsQueue::hasqspace, _FsProtoElem::outq, _FsProtoElem::parent, _FsProtoElem::state, TRYXMIT, and _FsProtocol::unacked.

Referenced by fsprotocol_new().

Here is the call graph for this function:

Here is the caller graph for this function:

FSTATIC gboolean _fsprotocol_send1 ( FsProtocol self,
FrameSet fs,
guint16  qid,
NetAddr toaddr 
)

Enqueue and send a single reliable frameset.

Todo:
: This might be slow if we send a lot of packets to an endpoint before getting a response, but that's not very likely.
Parameters
selfOur object
fsFrameset to send
qidFar endpoint queue id
toaddrWhere to send it

Definition at line 1048 of file fsprotocol.c.

References __FUNCTION__, _fsprotocol_fsa(), _FsQueue::_q, _FsProtoElem::acktimeout, AUDITFSPE, DEBUGMSG2, _FsQueue::enq, FSPR_INSHUTDOWN, FSPROTO_REQSEND, g_get_monotonic_time(), _FsProtoElem::nextrexmit, _FsProtoElem::outq, _FsProtoElem::parent, _FsProtoElem::state, TRYXMIT, and _FsProtocol::unacked.

Referenced by fsprotocol_new().

Here is the call graph for this function:

Here is the caller graph for this function:

FSTATIC gboolean _fsprotocol_shuttimeout ( gpointer  userdata)

Channel shutdown timer - invokes the FSA with FSPROTO_SHUT_TO.

Definition at line 1302 of file fsprotocol.c.

References _fsprotocol_fsa(), CASTTOCLASS, and FSPROTO_SHUT_TO.

Referenced by _fsprotocol_fsa().

Here is the call graph for this function:

Here is the caller graph for this function:

FSTATIC gboolean _fsprotocol_timeoutfun ( gpointer  userdata)

Retransmit timer function...

Definition at line 1281 of file fsprotocol.c.

References __FUNCTION__, AUDITFSPE, CASTTOCLASS, DEBUGMSG4, and TRYXMIT.

Referenced by fsprotocol_new().

Here is the caller graph for this function:

FSTATIC void _fsprotocol_xmitifwecan ( FsProtoElem fspe)

Our role in life is to send any packets that need sending.

Find every packet which is eligible to be sent and send it out

What makes a packet eligible to be sent?

It hasn't been sent yet and there are not too many ACKs outstanding on this fspe Too many means: fspe->outstanding_acks >= parent->window_size.

OR it is time to retransmit.

When do we perform re-transmission of unACKed packets? When it's been longer than parent->rexmit_period seconds since the last re-transmission of this fspe

What do we do when it's time to perform a re-transmission? We retransmit only the oldest FrameSet awaiting an ACK.

Parameters
fspeThe FrameSet protocol element to operate on

Definition at line 1193 of file fsprotocol.c.

References __FUNCTION__, _fsprotocol_fsa(), _FsQueue::_q, _FsProtoElem::acktimeout, _FsProtocol::acktimeout, AUDITFSPE, _NetAddr::baseclass, _SeqnoFrame::baseclass, _Frame::baseclass, _FrameSet::baseclass, CASTTOCLASS, _SeqnoFrame::compare, DUMP3, _FsProtoElem::endpoint, FSPROTO_ACKTIMEOUT, g_get_monotonic_time(), _FrameSet::getseqno, _FsProtocol::io, _FsProtoElem::lastseqsent, _FsProtoElem::nextrexmit, _FsProtoElem::outq, _FsProtoElem::parent, _FsQueue::qhead, REF2, _FsProtocol::rexmit_interval, _NetIO::sendaframeset(), _FsProtocol::unacked, UNREF2, and _FsProtocol::window_size.

Here is the call graph for this function:

WINEXPORT FsProtocol* fsprotocol_new ( guint  objsize,
NetIO io,
guint  rexmit_timer_uS 
)

Construct an FsQueue object.

The key and the data are in fact the same object Don't want to free the object twice ;-) - hence the final NULL argument

Parameters
objsizeSize of object to be constructed
ioPointer to NetIO for us to reference
rexmit_timer_uSRetransmit timer in microseconds

Definition at line 705 of file fsprotocol.c.

References __FUNCTION__, _fsprotocol_ackmessage(), _fsprotocol_activeconncount(), _fsprotocol_addconn(), _fsprotocol_closeall(), _fsprotocol_closeconn(), _fsprotocol_connstate(), _fsprotocol_finalize(), _fsprotocol_find(), _fsprotocol_findbypkt(), _fsprotocol_iready(), _fsprotocol_log_conn(), _fsprotocol_outputpending(), _fsprotocol_protoelem_destroy(), _fsprotocol_protoelem_equal(), _fsprotocol_protoelem_hash(), _fsprotocol_read(), _fsprotocol_receive(), _fsprotocol_send(), _fsprotocol_send1(), _fsprotocol_timeoutfun(), assimobj_new(), BINDDEBUG, DEBUGMSG3, FSPROTO_ACKTIMEOUTINT, FSPROTO_REXMITINTERVAL, FSPROTO_WINDOWSIZE, and NEWSUBCLASS.

Referenced by reliableudp_new().

Here is the call graph for this function:

Here is the caller graph for this function: