The Assimilation Project
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
hblistener.c File Reference

Implements the HbListener class. class - for listening to heartbeats. More...

#include <memory.h>
#include <glib.h>
#include <frame.h>
#include <frameset.h>
#include <hblistener.h>
#include <stdlib.h>
Include dependency graph for hblistener.c:

Go to the source code of this file.

Macros

#define IS_LISTENER_SUBCLASS   1
 
#define ONESEC   1000000
 

Functions

FSTATIC void _hblistener_notify_function (gpointer ignoreddata)
 
FSTATIC void _hblistener_finalize (AssimObj *self)
 Finalize an HbListener. More...
 
FSTATIC void _hblistener_addlist (HbListener *self)
 Add an HbListener to our global list of HBListeners, and unref (and neuter) any old HbListeners listening to this same address. More...
 
FSTATIC void _hblistener_dellist (HbListener *self)
 Remove an HbListener from our global list of HBListeners. More...
 
FSTATIC void _hblistener_checktimeouts (gboolean urgent)
 Function called when it's time to see if anyone timed out... More...
 
FSTATIC gboolean _hblistener_got_frameset (Listener *self, FrameSet *fs, NetAddr *srcaddr)
 Function called when a heartbeat FrameSet class (fs) arrived from the given NetAddr class (srcaddr) More...
 
FSTATIC void _hblistener_set_deadtime (HbListener *self,guint64 deadtime)
 Set deadtime. More...
 
FSTATIC void _hblistener_set_warntime (HbListener *self,guint64 warntime)
 Set warntime. More...
 
FSTATIC guint64 _hblistener_get_deadtime (HbListener *self)
 Return deadtime. More...
 
FSTATIC guint64 _hblistener_get_warntime (HbListener *self)
 Return warntime. More...
 
FSTATIC gboolean _hblistener_gsourcefunc (gpointer ignored)
 A GSourceFunc to be used with g_timeout_add_seconds() More...
 
FSTATIC void _hblistener_set_deadtime_callback (HbListener *self, void(*callback)(HbListener *who))
 Call to set a callback to be called when a node apparently dies. More...
 
FSTATIC void _hblistener_set_heartbeat_callback (HbListener *self, void(*callback)(HbListener *who))
 Call to set a callback to be called when a heartbeat is received. More...
 
FSTATIC void _hblistener_set_warntime_callback (HbListener *self, void(*callback)(HbListener *who, guint64 howlate))
 Call to set a callback to be called when a node passes warntime before heartbeating again. More...
 
FSTATIC void _hblistener_set_comealive_callback (HbListener *self, void(*callback)(HbListener *who, guint64 howlate))
 Call to set a callback to be called when a node passes deadtime but heartbeats again. More...
 
HbListenerhblistener_find_by_address (const NetAddr *which)
 Find the listener that's listening to a particular address. More...
 
FSTATIC void hblistener_shutdown (void)
 Shuts down all our hblisteners... More...
 
HbListenerhblistener_new (NetAddr *listenaddr, ConfigContext *cfg, gsize objsize)
 Construct a new HbListener - setting up GSource and timeout data structures for it. More...
 
FSTATIC void hblistener_unlisten (NetAddr *unlistenaddr)
 Stop expecting (listening for) heartbeats from a particular address. More...
 
FSTATIC void hblistener_set_martian_callback (void(*callback)(NetAddr *who))
 Call to set a callback to be called when an unrecognized node sends us a heartbeat. More...
 

Variables

 DEBUGDECLARATIONS
 

Detailed Description

Implements the HbListener class. class - for listening to heartbeats.

We are told what addresses to listen for, what ones to stop listening for at run time and time out both warning times, and fatal (dead) times.

This file is part of the Assimilation Project.

Author
Copyright © 2011, 2012 - Alan Robertson alanr.nosp@m.@uni.nosp@m.x.sh
The Assimilation software is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

The Assimilation software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with the Assimilation Project software. If not, see http://www.gnu.org/licenses/

Definition in file hblistener.c.

Macro Definition Documentation

#define IS_LISTENER_SUBCLASS   1

Definition at line 24 of file hblistener.c.

Variable Documentation

DEBUGDECLARATIONS

Definition at line 49 of file hblistener.c.