The Assimilation Project
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
hblistener.h
Go to the documentation of this file.
1 
26 #ifndef _HBLISTENER_H
27 #define _HBLISTENER_H
28 #include <projectcommon.h>
29 #include <netaddr.h>
30 #include <netgsource.h>
31 #include <listener.h>
32 typedef struct _HbListener HbListener;
33 
34 typedef enum {
38 
41 
44 struct _HbListener {
46  guint64 (*get_deadtime)(HbListener*);
47  void (*set_deadtime)(HbListener*, guint64);
48  guint64 (*get_warntime)(HbListener*);
49  void (*set_warntime)(HbListener*, guint64);
50  void (*set_heartbeat_callback)(HbListener*, void (*)(HbListener* who));
51  void (*set_deadtime_callback)(HbListener*, void (*)(HbListener* who));
52  void (*set_warntime_callback)(HbListener*, void (*)(HbListener* who, guint64 howlate));
53  void (*set_comealive_callback)(HbListener*, void (*)(HbListener* who, guint64 howlate));
56  void (*_warntime_callback)(HbListener* who, guint64 howlate);
57  void (*_comealive_callback)(HbListener* who, guint64 howlate);
59  guint64 _warn_interval;
60  guint64 nexttime;
61  guint64 warntime;
64 };
65 #define DEFAULT_DEADTIME 60 // seconds
66 
67 WINEXPORT HbListener* hblistener_new(NetAddr*, ConfigContext* config, gsize hblisten_objsize);
68 WINEXPORT void hblistener_unlisten(NetAddr* unlistenaddr);
73 
74 #endif /* _HBLISTENER_H */