The Assimilation Project
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
HbSender class.

Class for heartbeat Senders - We send heartbeats to the chosen few. More...

Collaboration diagram for HbSender class.:

Data Structures

struct  _HbSender
 This is the base HbSender class. object - which sends heartbeats to particular listeners. More...
 

Macros

#define ONESEC   1000000
 

Functions

FSTATIC void _hbsender_addlist (HbSender *self)
 Add an HbSender to our global list of HbSenders. More...
 
FSTATIC void _hbsender_dellist (HbSender *self)
 Remove an HbSender from our global list of HbSenders. More...
 
FSTATIC gboolean _hbsender_gsourcefunc (gpointer gself)
 A GSourceFunc to be used with g_timeout_add_seconds() More...
 
FSTATIC void _hbsender_ref (HbSender *self)
 Increment the reference count by one. More...
 
FSTATIC void _hbsender_unref (HbSender *self)
 Decrement the reference count by one - possibly freeing up the object. More...
 
FSTATIC void _hbsender_notify_function (gpointer data)
 
FSTATIC void _hbsender_finalize (HbSender *self)
 Finalize an HbSender. More...
 
HbSenderhbsender_new (NetAddr *sendaddr, NetGSource *outmethod, guint interval, gsize objsize)
 Construct a new HbSender - setting up timeout data structures for it. More...
 
void hbsender_stopsend (NetAddr *sendaddr)
 Stop sending heartbeats to a particular address. More...
 
FSTATIC void _hbsender_sendheartbeat (HbSender *self)
 
void hbsender_stopallsenders (void)
 

Detailed Description

Class for heartbeat Senders - We send heartbeats to the chosen few.

Macro Definition Documentation

#define ONESEC   1000000

Definition at line 49 of file hbsender.c.

Function Documentation

FSTATIC void _hbsender_addlist ( HbSender self)

Add an HbSender to our global list of HbSenders.

Parameters
[in]selfThe sender to add

Definition at line 53 of file hbsender.c.

Referenced by hbsender_new().

Here is the caller graph for this function:

FSTATIC void _hbsender_dellist ( HbSender self)

Remove an HbSender from our global list of HbSenders.

Parameters
[in]selfThe sender to remove from our list

Definition at line 61 of file hbsender.c.

Referenced by _hbsender_unref().

Here is the caller graph for this function:

FSTATIC void _hbsender_finalize ( HbSender self)

Finalize an HbSender.

Parameters
[in,out]selfSender to finalize

Definition at line 110 of file hbsender.c.

References FREECLASSOBJ, and UNREF.

Referenced by hbsender_new().

Here is the caller graph for this function:

FSTATIC gboolean _hbsender_gsourcefunc ( gpointer  gself)

A GSourceFunc to be used with g_timeout_add_seconds()

Parameters
[in,out]gselfPointer to 'self'

Definition at line 73 of file hbsender.c.

References _hbsender_sendheartbeat(), and CASTTOCLASS.

Referenced by hbsender_new().

Here is the call graph for this function:

Here is the caller graph for this function:

FSTATIC void _hbsender_notify_function ( gpointer  data)

Definition at line 102 of file hbsender.c.

References CASTTOCLASS.

Referenced by hbsender_new().

Here is the caller graph for this function:

FSTATIC void _hbsender_ref ( HbSender self)

Increment the reference count by one.

Parameters
[in,out]selfObject to increment reference count for

Definition at line 83 of file hbsender.c.

Referenced by hbsender_new().

Here is the caller graph for this function:

FSTATIC void _hbsender_sendheartbeat ( HbSender self)

Definition at line 174 of file hbsender.c.

References frameset_new(), FRAMESETTYPE_HEARTBEAT, and UNREF.

Referenced by _hbsender_gsourcefunc().

Here is the call graph for this function:

Here is the caller graph for this function:

FSTATIC void _hbsender_unref ( HbSender self)

Decrement the reference count by one - possibly freeing up the object.

Parameters
[in,out]selfObject to decrement reference count for

Definition at line 90 of file hbsender.c.

References _hbsender_dellist().

Referenced by hbsender_new().

Here is the call graph for this function:

Here is the caller graph for this function:

HbSender* hbsender_new ( NetAddr sendaddr,
NetGSource outmethod,
guint  interval,
gsize  objsize 
)

Construct a new HbSender - setting up timeout data structures for it.

This can be used directly or by derived classes.

Parameters
[in]sendaddrAddress to send to
[in]outmethodMechanism for sending packets
[in]intervalHow often to send, in seconds
[in]objsizesize of HbSender structure (0 for sizeof(HbSender))

Definition at line 127 of file hbsender.c.

References _HbSender::_expected_interval, _HbSender::_finalize, _hbsender_addlist(), _hbsender_finalize(), _hbsender_gsourcefunc(), _hbsender_notify_function(), _hbsender_ref(), _hbsender_unref(), _HbSender::_outmethod, _HbSender::_refcount, _HbSender::_sendaddr, BINDDEBUG, DEBUGMSG3, MALLOCCLASS, REF, _HbSender::ref, _HbSender::timeout_source, and _HbSender::unref.

Referenced by nanoobey_sendhb().

Here is the call graph for this function:

Here is the caller graph for this function:

void hbsender_stopallsenders ( void  )

Definition at line 182 of file hbsender.c.

References CASTTOCLASS, and _HbSender::unref.

Referenced by nano_shutdown().

Here is the caller graph for this function:

void hbsender_stopsend ( NetAddr sendaddr)

Stop sending heartbeats to a particular address.

Parameters
[in,out]sendaddrSender to remove from list

Definition at line 162 of file hbsender.c.

References _HbSender::_sendaddr, CASTTOCLASS, _NetAddr::equal, and _HbSender::unref.

Referenced by nanoobey_stopsendhb().

Here is the caller graph for this function: