|
The Assimilation Monitoring Project
|
Discovery abstract base class - supporting the discovery of various local things by our subclasses. More...
|
Modules | |
| JSON discovery class. | |
| JSONDiscovery class - supporting the discovery of various things through scripts that produce JSON output to stdout. | |
| SwitchDiscovery class | |
| Class providing a switch discovery class for discovering network switch properties - subclass of Discovery class. | |
Functions | |
| FSTATIC char * | _discovery_instancename (const Discovery *self) |
| internal function return the type of Discovery object More... | |
| FSTATIC void | _discovery_flushcache (Discovery *self) |
| default (do-nothing) 'flush cache' function More... | |
| FSTATIC guint | _discovery_discoverintervalsecs (const Discovery *self) |
| default function - return zero for discovery interval More... | |
| FSTATIC gboolean | _discovery_rediscover (gpointer vself) |
| GSourceFunc function to invoke discover member function at the timed interval. More... | |
| FSTATIC void | _discovery_ghash_destructor (gpointer gdiscovery) |
| Discovery Destructor function for the GHashTable. More... | |
| FSTATIC void | _discovery_finalize (AssimObj *gself) |
| Finalizing function for Discovery objects. More... | |
| Discovery * | discovery_new (const char *instname, NetGSource *iosource, ConfigContext *context, gsize objsize) |
| Discovery constructor. More... | |
| void | discovery_register (Discovery *self) |
| Function for registering a discovery object with the discovery infrastructure. More... | |
| FSTATIC void | discovery_unregister (const char *instance) |
| void | discovery_unregister_all (void) |
| Unregister all discovery methods in preparation for shutting down - to make valgrind happy :-D. More... | |
| typedef struct _Discovery | Discovery |
| typedef struct _JsonDiscovery | JsonDiscovery |
| WINEXPORT JsonDiscovery * | jsondiscovery_new (const char *discoverytype, const char *instancename, int intervalsecs, ConfigContext *jsonparams, NetGSource *, ConfigContext *, gsize) |
| #define | JSONAGENTROOT DISCOVERY_DIR |
Discovery abstract base class - supporting the discovery of various local things by our subclasses.
| #define JSONAGENTROOT DISCOVERY_DIR |
Definition at line 33 of file jsondiscovery.h.
Referenced by jsondiscovery_new().
| typedef struct _Discovery Discovery |
Definition at line 45 of file discovery.h.
| typedef struct _JsonDiscovery JsonDiscovery |
Definition at line 35 of file jsondiscovery.h.
default function - return zero for discovery interval
| [in] | self | Object whose interval to return |
Definition at line 57 of file discovery.c.
Referenced by discovery_new().

Finalizing function for Discovery objects.
| [in,out] | gself | Object to finalize (free) |
Definition at line 66 of file discovery.c.
References CASTTOCLASS, FREECLASSOBJ, and UNREF.
Referenced by _jsondiscovery_finalize(), and discovery_new().

default (do-nothing) 'flush cache' function
| self | object whose cache we're suppossed to flush... |
Definition at line 50 of file discovery.c.
| FSTATIC void _discovery_ghash_destructor | ( | gpointer | gdiscovery | ) |
Discovery Destructor function for the GHashTable.
This function gets called every time a Discovery gets deleted from our _discovery_timers hash table. It has the potential for infinite mutual recursion with discovery_finalize() - which we prevent.
Definition at line 95 of file discovery.c.
References CASTTOCLASS, and UNREF.
Referenced by discovery_register().

| DEBUGDECLARATIONS FSTATIC char * _discovery_instancename | ( | const Discovery * | self | ) |
internal function return the type of Discovery object
| [in] | self | object whose instance name to return |
Definition at line 43 of file discovery.c.
Referenced by discovery_new().

| FSTATIC gboolean _discovery_rediscover | ( | gpointer | vself | ) |
GSourceFunc function to invoke discover member function at the timed interval.
This function is called by the g_main_loop mechanism when the rediscover timeout elapses.
| [in,out] | vself | Object to perform discovery on |
Definition at line 105 of file discovery.c.
References CASTTOCLASS.
Referenced by discovery_register().

| Discovery* discovery_new | ( | const char * | instname, |
| NetGSource * | iosource, | ||
| ConfigContext * | context, | ||
| gsize | objsize | ||
| ) |
Discovery constructor.
Note that derived classes must set the discover member function - or things might crash. That is certainly what will happen if you try and construct one of these objects directly and then use it.
| [in] | instname | instance name |
| [in,out] | iosource | I/O object |
| [in,out] | context | configuration context |
| [in] | objsize | number of bytes to malloc for the object (or zero) |
Definition at line 117 of file discovery.c.
References _Discovery::_config, _discovery_discoverintervalsecs(), _discovery_finalize(), _discovery_instancename(), _AssimObj::_finalize, _Discovery::_instancename, _Discovery::_iosource, _Discovery::_timerid, assimobj_new(), _Discovery::baseclass, BINDDEBUG, _Discovery::discover, _Discovery::discoverintervalsecs, _Discovery::instancename, NEWSUBCLASS, and REF.
Referenced by jsondiscovery_new(), and switchdiscovery_new().


| void discovery_register | ( | Discovery * | self | ) |
Function for registering a discovery object with the discovery infrastructure.
It runs the discover function, then schedules it for repeated discovery - if appropriate. It "knows" how often to rediscover things by calling the discoverintervalsecs() member function. If that function returns a value greater than zero, then this discovery object will be "re-discovered" according to the number of seconds returned.
| [in,out] | self | Discovery object to register |
Definition at line 146 of file discovery.c.
References _discovery_ghash_destructor(), _discovery_rediscover(), and REF.
Referenced by jsondiscovery_new(), and switchdiscovery_new().


| FSTATIC void discovery_unregister | ( | const char * | instance | ) |
Definition at line 163 of file discovery.c.
Referenced by nanoobey_stopdiscover().

| void discovery_unregister_all | ( | void | ) |
Unregister all discovery methods in preparation for shutting down - to make valgrind happy :-D.
Definition at line 172 of file discovery.c.
References DEBUGMSG1.
Referenced by nano_shutdown().

| WINEXPORT JsonDiscovery* jsondiscovery_new | ( | const char * | discoverytype, |
| const char * | instancename, | ||
| int | intervalsecs, | ||
| ConfigContext * | jsonparams, | ||
| NetGSource * | , | ||
| ConfigContext * | , | ||
| gsize | |||
| ) |