The Assimilation Project
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
discovery.h
Go to the documentation of this file.
1 
36 #ifndef _DISCOVERY_H
37 #define _DISCOVERY_H
38 #include <projectcommon.h>
39 #include <assimobj.h>
40 #include <netgsource.h>
41 #include <configcontext.h>
44 
45 typedef struct _Discovery Discovery;
47 struct _Discovery {
49  char* (*instancename)(const Discovery* self);
50  void (*flushcache)(Discovery* self);
51  gboolean (*discover)(Discovery* self);
52  guint (*discoverintervalsecs) (const Discovery* self);
53  void (*sendjson)(Discovery*, char*, gsize);
55  guint64 reportcount;
56  guint64 discovercount;
58  char* _instancename;
60  guint _timerid;
63  gboolean _sentyet;
65 };
66 
67 WINEXPORT Discovery* discovery_new(const char *,NetGSource*, ConfigContext*, gsize objsize);
70 WINEXPORT void discovery_unregister(const char *);
71 #ifdef DISCOVERY_SUBCLASS
73 #endif
74 
75 
77 
78 #endif /* _DISCOVERY_H */
guint64 discovercount
How many times have we discovered something.
Definition: discovery.h:57
WINEXPORT void discovery_register(Discovery *self)
Function for registering a discovery object with the discovery infrastructure.
Definition: discovery.c:172
WINEXPORT void discovery_unregister_all(void)
Unregister all discovery methods in preparation for shutting down - to make valgrind happy :-D...
Definition: discovery.c:200
char * _instancename
Timer id for repeating discovery.
Definition: discovery.h:59
#define WINEXPORT
Definition: projectcommon.h:45
WINEXPORT Discovery * discovery_new(const char *, NetGSource *, ConfigContext *, gsize objsize)
Discovery constructor.
Definition: discovery.c:142
This file defines our base object class: AssimObj.
guint _timerid
Timer id for repeating discovery.
Definition: discovery.h:60
NetGSource * _iosource
How to send packets.
Definition: discovery.h:61
void(* flushcache)(Discovery *self)
Flush any cache held.
Definition: discovery.h:50
void(* sendjson)(Discovery *, char *, gsize)
Send JSON string.
Definition: discovery.h:54
Project common header file.
Implements Configuration Context class.
WINEXPORT void discovery_unregister(const char *)
Definition: discovery.c:190
Discovery class abstract C-class - it supports discovering "things" through subclasses for different ...
Definition: discovery.h:47
guint64 reportcount
How many times have we reported anything new upstream.
Definition: discovery.h:55
gboolean(* discover)(Discovery *self)
Perform the discovery.
Definition: discovery.h:51
Implements NetIO GSource object.
guint(* discoverintervalsecs)(const Discovery *self)
How often to re-discover? (in seconds)
Definition: discovery.h:52
ConfigContext * _config
Configuration Parameters - has address of CMA.
Definition: discovery.h:62
AssimObj baseclass
Base object class.
Definition: discovery.h:48
The NetGSource class objects integrate NetIO class objects into the g_main_loop paradigm.
Definition: netgsource.h:43
FSTATIC void _discovery_finalize(AssimObj *gself)
Finalizing function for Discovery objects.
Definition: discovery.c:71
gboolean _sentyet
TRUE if we've sent this yet.
Definition: discovery.h:64