The Assimilation Project
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Nanoprobe implementation functions

A collection of useful functions for implementing nanoprobes - sans main program. More...

Data Structures

struct  startup_cruft
 Stuff we need only for passing parameters through our glib infrastructures - to start up nanoprobes. More...
 

Functions

FSTATIC void nanoobey_sendexpecthb (AuthListener *parent, FrameSet *fs, NetAddr *fromaddr)
 Act on (obey) a FRAMESETTYPE_SENDEXPECTHB FrameSet class. More...
 
FSTATIC void nanoobey_sendhb (AuthListener *parent, FrameSet *fs, NetAddr *fromaddr)
 Act on (obey) a FrameSet class telling us to send heartbeats. More...
 
FSTATIC void nanoobey_expecthb (AuthListener *parent, FrameSet *fs, NetAddr *fromaddr)
 Act on (obey) a FrameSet class telling us to expect heartbeats. More...
 
FSTATIC void nanoobey_stopsendexpecthb (AuthListener *parent, FrameSet *fs, NetAddr *fromaddr)
 Act on (obey) a FrameSet class telling us to stop sending and expecting heartbeats. More...
 
FSTATIC void nanoobey_stopsendhb (AuthListener *parent, FrameSet *fs, NetAddr *fromaddr)
 Act on (obey) a FrameSet class telling us to stop sending heartbeats. More...
 
FSTATIC void nanoobey_stopexpecthb (AuthListener *parent, FrameSet *fs, NetAddr *fromaddr)
 Act on (obey) a FrameSet class telling us to stop expecting heartbeats. More...
 
FSTATIC void nanoobey_setconfig (AuthListener *, FrameSet *fs, NetAddr *)
 
FSTATIC void nanoobey_change_debug (gint plusminus, AuthListener *parent, FrameSet *fs, NetAddr *fromaddr)
 Act on (obey) a FrameSet class telling us to increment or decrement debug levels either on a specific set of classes, or on all classes. More...
 
FSTATIC void nanoobey_incrdebug (AuthListener *parent, FrameSet *fs, NetAddr *fromaddr)
 Act on (obey) a FrameSet class telling us to increment debug levels either on a specific set of classes, or on all classes. More...
 
FSTATIC void nanoobey_decrdebug (AuthListener *parent, FrameSet *fs, NetAddr *fromaddr)
 Act on (obey) a FrameSet class telling us to decrement debug levels either on a specific set of classes, or on all classes. More...
 
FSTATIC void nanoobey_startdiscover (AuthListener *parent, FrameSet *fs, NetAddr *fromaddr)
 Act on (obey) a FrameSet class telling us to perform a possibly repeating discovery action. More...
 
FSTATIC void nanoobey_stopdiscover (AuthListener *parent, FrameSet *fs, NetAddr *fromaddr)
 Act on (obey) a FrameSet class telling us to stop a repeating discovery action. More...
 
FSTATIC void nanoobey_dorscoperation (AuthListener *, FrameSet *, NetAddr *)
 
FSTATIC void _nano_send_rscexitstatus (ConfigContext *request, gpointer user_data, enum HowDied reason, int rc, int signal, gboolean core_dumped, const char *stringresult)
 Callback that gets called when a resource operation sends back status. More...
 
FSTATIC void nanoobey_cancelrscoperation (AuthListener *, FrameSet *, NetAddr *)
 
FSTATIC void nano_schedule_discovery (const char *instance,guint32 interval,const char *json,ConfigContext *config,NetGSource *transport,NetAddr *fromaddr)
 Schedule a discovery instance, potentially repetitively. More...
 
FSTATIC void nano_stop_discovery (const char *discoveryname, NetGSource *, NetAddr *)
 
FSTATIC gboolean nano_startupidle (gpointer gcruft)
 Nanoprobe bootstrap routine. More...
 
FSTATIC gboolean nano_reqconfig (gpointer gcruft)
 Function to request our initial configuration data This is typically called from a g_main_loop timeout, and is also called directly - at startup. More...
 
FSTATIC void _real_heartbeat_agent (HbListener *who)
 Standard nanoprobe 'hearbeat received' agent. More...
 
FSTATIC void _real_deadtime_agent (HbListener *who)
 Standard nanoprobe 'deadtime elapsed' agent. More...
 
FSTATIC void _real_warntime_agent (HbListener *who, guint64 howlate)
 Standard nanoprobe 'warntime elapsed' agent - called when a heartbeat arrives after 'warntime' but before 'deadtime'. More...
 
FSTATIC void _real_comealive_agent (HbListener *who, guint64 howlate)
 Standard nanoprobe 'returned-from-the-dead' agent - called when a heartbeats arrive after 'deadtime'. More...
 
FSTATIC void _real_martian_agent (NetAddr *who)
 Standard nanoprobe 'martian heartbeat received' agent. More...
 
FSTATIC HbListener_real_hblistener_new (NetAddr *addr, ConfigContext *context)
 Default HbListener constructor. More...
 
FSTATIC gboolean _nano_final_shutdown (gpointer unused)
 
FSTATIC gboolean shutdown_when_outdone (gpointer unused)
 Shut down everything when output is all ACKed - this is idle loop code. More...
 
FSTATIC gboolean _nano_initconfig_OK (ConfigContext *config)
 
void nanoprobe_report_upstream (guint16 reporttype, NetAddr *who, const char *systemnm, guint64 howlate)
 Construct a frameset reporting something - and send it upstream. More...
 
PacketDecodernano_packet_decoder (void)
 Return our nanoprobe packet decoder map. More...
 
WINEXPORT void nano_start_full (const char *initdiscoverpath, guint discover_interval, NetGSource *io, ConfigContext *config)
 Here is how the startup process works: More...
 
WINEXPORT void nano_shutdown (gboolean report)
 Shut down the things started up by nano_start_full() - mainly free storage to make valgrind happy... More...
 
WINEXPORT gboolean nano_initiate_shutdown (void)
 Initiate shutdown - return TRUE if we have shut down immediately... More...
 

Variables

void(* nanoprobe_deadtime_agent )(HbListener *) = NULL
 
void(* nanoprobe_heartbeat_agent )(HbListener *) = NULL
 
void(* nanoprobe_warntime_agent )(HbListener *, guint64 howlate) = NULL
 
void(* nanoprobe_comealive_agent )(HbListener *, guint64 howlate) = NULL
 
WINEXPORT NanoHbStats nano_hbstats = {0U, 0U, 0U, 0U, 0U}
 
gboolean nano_connected = FALSE
 
WINEXPORT int errcount = 0
 error count More...
 
WINEXPORT GMainLoop * mainloop = NULL
 
HbListener *(* nanoprobe_hblistener_new )(NetAddr *, ConfigContext *) = _real_hblistener_new
 
gboolean nano_shutting_down = FALSE
 
GRand * nano_random = NULL
 
const char * procname = "nanoprobe"
 process name More...
 
ObeyFrameSetTypeMap collective_obeylist []
 The set of Collective Management Authority FrameTypes we know about, and what to do when we get them. More...
 

Detailed Description

A collection of useful functions for implementing nanoprobes - sans main program.

Function Documentation

FSTATIC gboolean _nano_final_shutdown ( gpointer  unused)

Definition at line 1351 of file nanoprobe.c.

References __FUNCTION__, _NetGSource::_netio, _NetIO::baseclass, DUMP, g_info, mainloop, nano_connected, nano_random, and _NetIO::outputpending().

Referenced by nano_initiate_shutdown().

Here is the call graph for this function:

Here is the caller graph for this function:

FSTATIC gboolean _nano_initconfig_OK ( ConfigContext config)

Definition at line 1060 of file nanoprobe.c.

References __FUNCTION__, _ConfigContext::baseclass, CONFIGNAME_CMADISCOVER, CONFIGNAME_CMAFAIL, DEBUGMSG2, DUMP2, and _ConfigContext::getaddr.

Referenced by nano_reqconfig(), and nanoobey_setconfig().

Here is the caller graph for this function:

FSTATIC void _nano_send_rscexitstatus ( ConfigContext request,
gpointer  user_data,
enum HowDied  reason,
int  rc,
int  signal,
gboolean  core_dumped,
const char *  stringresult 
)
FSTATIC void _real_comealive_agent ( HbListener who,
guint64  howlate 
)

Standard nanoprobe 'returned-from-the-dead' agent - called when a heartbeats arrive after 'deadtime'.

Supply your own in nanoprobe_comealive_agent if you want us to call it.

Definition at line 253 of file nanoprobe.c.

References _NetAddr::baseclass, _NanoHbStats::comealive_count, FRAMESETTYPE_HBBACKALIVE, _HbListener::listenaddr, nano_hbstats, nanoprobe_comealive_agent, nanoprobe_report_upstream(), and _AssimObj::toString.

Referenced by nanoobey_expecthb().

Here is the call graph for this function:

Here is the caller graph for this function:

FSTATIC void _real_deadtime_agent ( HbListener who)

Standard nanoprobe 'deadtime elapsed' agent.

Supply your own in nanoprobe_deadtime_agent if you want us to call it.

Definition at line 205 of file nanoprobe.c.

References _NetAddr::baseclass, _NanoHbStats::dead_count, FRAMESETTYPE_HBDEAD, _HbListener::listenaddr, nano_hbstats, nanoprobe_deadtime_agent, nanoprobe_report_upstream(), and _AssimObj::toString.

Referenced by nanoobey_expecthb().

Here is the call graph for this function:

Here is the caller graph for this function:

DEBUGDECLARATIONS FSTATIC HbListener * _real_hblistener_new ( NetAddr addr,
ConfigContext context 
)

Default HbListener constructor.

Supply your own in nanoprobe_hblistener_new if you need to construct a subclass object.

Definition at line 117 of file nanoprobe.c.

References hblistener_new().

Here is the call graph for this function:

FSTATIC void _real_heartbeat_agent ( HbListener who)

Standard nanoprobe 'hearbeat received' agent.

Supply your own in nanoprobe_heartbeat_agent if you want us to call it.

Definition at line 224 of file nanoprobe.c.

References _NanoHbStats::heartbeat_count, nano_hbstats, and nanoprobe_heartbeat_agent.

Referenced by nanoobey_expecthb().

Here is the caller graph for this function:

FSTATIC void _real_martian_agent ( NetAddr who)

Standard nanoprobe 'martian heartbeat received' agent.

Todo:
: need to limit the frequency of martian messages

Definition at line 170 of file nanoprobe.c.

References _NetAddr::baseclass, FRAMESETTYPE_HBMARTIAN, g_get_monotonic_time(), _NanoHbStats::martian_count, MARTIAN_TIMEOUT, nano_hbstats, nanoprobe_report_upstream(), and _AssimObj::toString.

Referenced by nano_start_full().

Here is the call graph for this function:

Here is the caller graph for this function:

FSTATIC void _real_warntime_agent ( HbListener who,
guint64  howlate 
)

Standard nanoprobe 'warntime elapsed' agent - called when a heartbeat arrives after 'warntime' but before 'deadtime'.

Supply your own in nanoprobe_warntime_agent if you want us to call it.

Definition at line 236 of file nanoprobe.c.

References _NetAddr::baseclass, FMT_64BIT, FRAMESETTYPE_HBLATE, _HbListener::listenaddr, nano_hbstats, nanoprobe_report_upstream(), nanoprobe_warntime_agent, _AssimObj::toString, and _NanoHbStats::warntime_count.

Referenced by nanoobey_expecthb().

Here is the call graph for this function:

Here is the caller graph for this function:

WINEXPORT gboolean nano_initiate_shutdown ( void  )

Initiate shutdown - return TRUE if we have shut down immediately...

Definition at line 1288 of file nanoprobe.c.

References _nano_final_shutdown(), _NetGSource::_netio, _ResourceQueue::cancelall, CASTTOCLASS, _FsProtocol::closeall, DEBUGMSG, discovery_unregister_all(), errcount, FRAMESETTYPE_HBSHUTDOWN, nano_connected, nano_shutting_down, nanoprobe_report_upstream(), procname, proj_get_sysname(), shutdown_when_outdone(), and UNREF.

Referenced by check_for_signals(), gotnetpkt(), and timeout_agent().

Here is the call graph for this function:

Here is the caller graph for this function:

PacketDecoder* nano_packet_decoder ( void  )

Return our nanoprobe packet decoder map.

Kind of like a secret decoder ring, but more useful ;-).

Definition at line 1180 of file nanoprobe.c.

References DIMOF, FRAMETYPEMAP, and packetdecoder_new().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

FSTATIC void nano_schedule_discovery ( const char *  instance,
guint32  interval,
const char *  json,
ConfigContext config,
NetGSource transport,
NetAddr fromaddr 
)

Schedule a discovery instance, potentially repetitively.

Parameters
[in]instanceName of this particular instance
[in]intervalHow often to run (0 == one-shot)
[in]jsonJSON data specifying the discovery
[in]configConfiguration context
[in,out]transportNetwork Transport
[in,out]fromaddrRequestor's address

Definition at line 971 of file nanoprobe.c.

References __FUNCTION__, arpdiscovery_new(), _ConfigContext::baseclass, configcontext_new_JSON_string(), CONFIGNAME_TYPE, DEBUGMSG3, _ConfigContext::getstring, jsondiscovery_new(), switchdiscovery_new(), _AssimObj::toString, UNREF, and UNREF2.

Referenced by nanoobey_startdiscover().

Here is the call graph for this function:

Here is the caller graph for this function:

WINEXPORT void nano_start_full ( const char *  initdiscoverpath,
guint  discover_interval,
NetGSource io,
ConfigContext config 
)

Here is how the startup process works:

  1. Submit a network discovery request from an idle task, rescheduling until it completes. Go to next step when this is done. nano_startupidle()
  2. Repeatedly send out a "request for configuration" packet once the discovery data shows up in the config context, until the rest of our config comes in nano_reqconfig()
  3. When the CMA receives this request it will send outout a FRAMESETTYPE_SETCONFIG FrameSet class and a series of SENDEXPECTHB heartbeat packets. We'll just keep asking until we receive the SETCONFIG we're looking for (currently every 5 seconds).
  4. When the FRAMESETTYPE_SETCONFIG packet is received, this enables the sending of discovery data from all (JSON and switch (LLDP/CDP)) sources. nanoobey_setconfig() In the case of the SwitchDiscovery data, we're already trying to collect it.
  5. When we receive FRAMESETTYPE_SENDEXPECTHB packets (or similar), we start sending heartbeats and timing heartbeats to flag "dead" machines as we were told. nanoobey_sendhb(), nanoobey_expecthb(), and/or nanoobey_sendexpecthb()
  6. Now everything is running in "normal" mode. Happy days! Eventually we are likely to be told to do other things (monitor services, set up discovery, respond to other queries) but we'll always go through these steps.
Parameters
[in]initdiscoverpathpathname of initial network discovery agent
[in]discover_intervaldiscovery interval for agent above
[in,out]ionetwork connectivity object
[in,out]configconfiguration object

Definition at line 1216 of file nanoprobe.c.

References _real_martian_agent(), _Listener::associate, authlistener_new(), _AuthListener::baseclass, BINDDEBUG, CASTTOCLASS, startup_cruft::discover_interval, hblistener_set_martian_callback(), nano_random, nano_shutting_down, and nano_startupidle().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean nano_startupidle ( gpointer  gcruft)

Nanoprobe bootstrap routine.

We are a g_main_loop idle function which kicks off a discovery action and continues to run as idle until the discovery finishes, then we schedule a request for configuration - which will run periodically until we get our configuration information safely stored away in our ConfigContext.

Definition at line 1025 of file nanoprobe.c.

References _AuthListener::baseclass, _Listener::config, configcontext_new_JSON_string(), startup_cruft::discover_interval, _ConfigContext::getstring, startup_cruft::initdiscover, startup_cruft::iosource, jsondiscovery_new(), nano_reqconfig(), nano_shutting_down, UNREF, and UNREF2.

Referenced by nano_start_full().

Here is the call graph for this function:

Here is the caller graph for this function:

FSTATIC void nano_stop_discovery ( const char *  discoveryname,
NetGSource ,
NetAddr  
)
FSTATIC void nanoobey_cancelrscoperation ( AuthListener parent,
FrameSet fs,
NetAddr fromaddr 
)
FSTATIC void nanoobey_change_debug ( gint  plusminus,
AuthListener parent,
FrameSet fs,
NetAddr fromaddr 
)

Act on (obey) a FrameSet class telling us to increment or decrement debug levels either on a specific set of classes, or on all classes.

Parameters
[in]plusminus+1 or -1 - for incrementing/decrementing
[in]parentAuthListener class. object invoking us
[in]fsFrameSet class giving the details
[in,out]fromaddrAddress this message came from

Definition at line 694 of file nanoprobe.c.

References CASTTOCLASS, _FrameSet::framelist, FRAMETYPE_CSTRINGVAL, proj_class_decr_debug(), proj_class_incr_debug(), _Frame::type, and _Frame::value.

Referenced by nanoobey_decrdebug(), and nanoobey_incrdebug().

Here is the call graph for this function:

Here is the caller graph for this function:

FSTATIC void nanoobey_decrdebug ( AuthListener parent,
FrameSet fs,
NetAddr fromaddr 
)

Act on (obey) a FrameSet class telling us to decrement debug levels either on a specific set of classes, or on all classes.

Parameters
[in]parentAuthListener class. object invoking us
[in]fsFrameSet class indicating who to send HBs to
[in,out]fromaddrAddress this message came from

Definition at line 745 of file nanoprobe.c.

References nanoobey_change_debug().

Here is the call graph for this function:

void nanoobey_expecthb ( AuthListener parent,
FrameSet fs,
NetAddr fromaddr 
)

Act on (obey) a FrameSet class telling us to expect heartbeats.

Such framesets are sent when the Collective Authority wants us to expect Heartbeats from various addresses. This might be from a FRAMESETTYPE_EXPECTHB FrameSet or a FRAMESETTYPE_SENDEXPECTHB FrameSet. The deadtime, warntime can come from the FrameSet or the ConfigContext class parameter we're given - with the FrameSet taking priority.

If these parameters are in the FrameSet, they have to precede the FRAMETYPE_IPPORT IpPortFrame class in the FrameSet.

Parameters
[in]parentAuthListener class. object invoking us
[in]fsFrameSet class indicating who to send HBs to
[in,out]fromaddrAddress this message came from

Definition at line 353 of file nanoprobe.c.

References __FUNCTION__, _real_comealive_agent(), _real_deadtime_agent(), _real_heartbeat_agent(), _real_warntime_agent(), _NetGSource::addListener, _Listener::associate, _CstringFrame::baseclass, _AuthListener::baseclass, _HbListener::baseclass, CASTTOCLASS, _Listener::config, obsolete_cma::config, CONFIG_DEFAULT_DEADTIME, CONFIG_DEFAULT_WARNTIME, configcontext_new_JSON_string(), CONFIGNAME_TIMEOUT, CONFIGNAME_WARNTIME, DEBUGMSG3, _FrameSet::framelist, FRAMESETTYPE_HEARTBEAT, FRAMETYPE_HBDEADTIME, FRAMETYPE_HBWARNTIME, FRAMETYPE_IPPORT, FRAMETYPE_RSCJSON, _IntFrame::getint, _ConfigContext::getint, _IpPortFrame::getnetaddr, hblistener_new(), nano_shutting_down, _HbListener::set_comealive_callback, _HbListener::set_deadtime, _HbListener::set_deadtime_callback, _HbListener::set_heartbeat_callback, _HbListener::set_warntime, _HbListener::set_warntime_callback, _Listener::transport, transport, _Frame::type, UNREF, UNREF2, and _Frame::value.

Referenced by nanoobey_sendexpecthb().

Here is the call graph for this function:

Here is the caller graph for this function:

FSTATIC void nanoobey_incrdebug ( AuthListener parent,
FrameSet fs,
NetAddr fromaddr 
)

Act on (obey) a FrameSet class telling us to increment debug levels either on a specific set of classes, or on all classes.

Parameters
[in]parentAuthListener class. object invoking us
[in]fsFrameSet class indicating who to send HBs to
[in,out]fromaddrAddress this message came from

Definition at line 734 of file nanoprobe.c.

References nanoobey_change_debug().

Here is the call graph for this function:

void nanoobey_sendexpecthb ( AuthListener parent,
FrameSet fs,
NetAddr fromaddr 
)

Act on (obey) a FRAMESETTYPE_SENDEXPECTHB FrameSet class.

This frameset is sent when the Collective Authority wants us to both send Heartbeats to an address and expect heartbeats back from them. The deadtime, warntime, send interval and port number can come from the FrameSet or from the ConfigContext class parameter we're given. If these parameters are in the FrameSet, they have to precede the FRAMETYPE_IPPORT IpPortFrame class in the FrameSet.

Parameters
[in]parentAuthListener class. object invoking us
[in]fsFrameSet class indicating who to send HBs to
[in,out]fromaddrAddress this message came from

Definition at line 466 of file nanoprobe.c.

References FRAMESETTYPE_SENDEXPECTHB, _FrameSet::fstype, nano_shutting_down, nanoobey_expecthb(), and nanoobey_sendhb().

Here is the call graph for this function:

void nanoobey_sendhb ( AuthListener parent,
FrameSet fs,
NetAddr fromaddr 
)

Act on (obey) a FrameSet class telling us to send heartbeats.

Such FrameSets are sent when the Collective Authority wants us to send Heartbeats to various addresses. This might be from a FRAMESETTYPE_SENDHB FrameSet or a FRAMESETTYPE_SENDEXPECTHB FrameSet. The send interval can come from the FrameSet or from the ConfigContext class parameter we're given - with the FrameSet taking priority.

If these parameters are in the FrameSet, they have to precede the FRAMETYPE_IPPORT IpPortFrame class in the FrameSet.

Parameters
[in]parentAuthListener class. object invoking us
[in]fsFrameSet class indicating who to send HBs to
[in,out]fromaddrAddress this message came from

Definition at line 280 of file nanoprobe.c.

References __FUNCTION__, _CstringFrame::baseclass, _AuthListener::baseclass, CASTTOCLASS, _Listener::config, obsolete_cma::config, CONFIG_DEFAULT_HBTIME, configcontext_new_JSON_string(), CONFIGNAME_INTERVAL, DEBUGMSG3, _FrameSet::framelist, FRAMETYPE_HBINTERVAL, FRAMETYPE_IPPORT, FRAMETYPE_RSCJSON, _IntFrame::getint, _ConfigContext::getint, _IpPortFrame::getnetaddr, hbsender_new(), nano_shutting_down, _Listener::transport, _Frame::type, UNREF, and _Frame::value.

Referenced by nanoobey_sendexpecthb().

Here is the call graph for this function:

Here is the caller graph for this function:

FSTATIC void nanoobey_startdiscover ( AuthListener parent,
FrameSet fs,
NetAddr fromaddr 
)

Act on (obey) a FrameSet class telling us to perform a possibly repeating discovery action.

FRAMETYPE_DISCNAME - Name of this particular discovery action Everything else we need to know comes through as a JSON string. Having the discovery name be separate is handy for putting them in a table. Don't need the interval once it's started, so no reason to put it in the JSON.

Parameters
[in]parentAuthListener class. object invoking us
[in]fsFrameSet class giving operational details
[in,out]fromaddrAddress this message came from

Definition at line 760 of file nanoprobe.c.

References __FUNCTION__, _CstringFrame::baseclass, _AuthListener::baseclass, CASTTOCLASS, _Listener::config, DEBUGMSG3, _FrameSet::framelist, FRAMETYPE_DISCINTERVAL, FRAMETYPE_DISCJSON, FRAMETYPE_DISCNAME, _IntFrame::getint, nano_schedule_discovery(), nano_shutting_down, _Listener::transport, _Frame::type, and _Frame::value.

Here is the call graph for this function:

FSTATIC void nanoobey_stopdiscover ( AuthListener parent,
FrameSet fs,
NetAddr fromaddr 
)

Act on (obey) a FrameSet class telling us to stop a repeating discovery action.

FRAMETYPE_DISCNAME - Name of this particular discovery action

Parameters
[in]parentAuthListener class. object invoking us
[in]fsFrameSet class giving operational details
[in,out]fromaddrAddress this message came from

Definition at line 936 of file nanoprobe.c.

References _CstringFrame::baseclass, CASTTOCLASS, discovery_unregister(), _FrameSet::framelist, FRAMETYPE_DISCNAME, _Frame::type, and _Frame::value.

Here is the call graph for this function:

void nanoobey_stopexpecthb ( AuthListener parent,
FrameSet fs,
NetAddr fromaddr 
)

Act on (obey) a FrameSet class telling us to stop expecting heartbeats.

Such FrameSets are sent when the Collective Authority wants us to stop listening to a machine because of a machine coming alive or dying (reconfiguration). This might be from a FRAMESETTYPE_STOPEXPECTHB FrameSet or a FRAMESETTYPE_STOPSENDEXPECTHB FrameSet.

Parameters
[in]parentAuthListener class. object invoking us
[in]fsFrameSet class indicating who to stop expecting HBs from
[in,out]fromaddrAddress this message came from

Definition at line 516 of file nanoprobe.c.

References _NetGSource::_netio, _AuthListener::baseclass, CASTTOCLASS, _NetIO::closeconn(), DEFAULT_FSP_QID, destaddr, _FrameSet::framelist, FRAMETYPE_IPPORT, _IpPortFrame::getnetaddr, hblistener_unlisten(), _Listener::transport, transport, and _Frame::type.

Referenced by nanoobey_stopsendexpecthb().

Here is the call graph for this function:

Here is the caller graph for this function:

void nanoobey_stopsendexpecthb ( AuthListener parent,
FrameSet fs,
NetAddr fromaddr 
)

Act on (obey) a FrameSet class telling us to stop sending and expecting heartbeats.

Such FrameSets are sent when the Collective Authority wants us to communicating with a machine because of a machine coming alive or dying (reconfiguration).

Parameters
[in]parentAuthListener class. object invoking us
[in]fsFrameSet class indicating who to stop talking to
[in,out]fromaddrAddress this message came from

Definition at line 546 of file nanoprobe.c.

References nanoobey_stopexpecthb(), and nanoobey_stopsendhb().

Here is the call graph for this function:

void nanoobey_stopsendhb ( AuthListener parent,
FrameSet fs,
NetAddr fromaddr 
)

Act on (obey) a FrameSet class telling us to stop sending heartbeats.

Such FrameSets are sent when the Collective Authority wants us to stop heartbeating a machine because of a machine coming alive or dying (reconfiguration). This might be from a FRAMESETTYPE_STOPSENDHB FrameSet or a FRAMESETTYPE_STOPSENDEXPECTHB FrameSet.

Parameters
[in]parentAuthListener class. object invoking us
[in]fsFrameSet class indicating who to stop sending HBs to
[in,out]fromaddrAddress this message came from

Definition at line 487 of file nanoprobe.c.

References CASTTOCLASS, _FrameSet::framelist, FRAMETYPE_IPPORT, _IpPortFrame::getnetaddr, hbsender_stopsend(), and _Frame::type.

Referenced by nanoobey_stopsendexpecthb().

Here is the call graph for this function:

Here is the caller graph for this function:

void nanoprobe_report_upstream ( guint16  reporttype,
NetAddr who,
const char *  systemnm,
guint64  howlate 
)

Construct a frameset reporting something - and send it upstream.

Parameters
reporttypeFrameSet Type of report to create
whoWho is being reported on
systemnmName of system doing the reporting
howlateHow late was the heartbeat? This is optional - zero means ignore this parameter.

Definition at line 124 of file nanoprobe.c.

References __FUNCTION__, _NetGSource::_netio, _CstringFrame::baseclass, _IntFrame::baseclass, _IpPortFrame::baseclass, _NetAddr::baseclass, cstringframe_new(), DEBUGMSG, DEBUGMSG3, DEFAULT_FSP_QID, DUMP3, frame_default_valuefinalize(), frameset_append_frame(), frameset_new(), FRAMETYPE_ELAPSEDTIME, FRAMETYPE_HOSTNAME, FRAMETYPE_IPPORT, intframe_new(), ipportframe_netaddr_new(), nano_shutting_down, _NetIO::sendareliablefs(), _IntFrame::setint, _Frame::setvalue, UNREF, and UNREF2.

Referenced by _real_comealive_agent(), _real_deadtime_agent(), _real_martian_agent(), _real_warntime_agent(), and nano_initiate_shutdown().

Here is the call graph for this function:

Here is the caller graph for this function:

FSTATIC gboolean shutdown_when_outdone ( gpointer  unused)

Shut down everything when output is all ACKed - this is idle loop code.

Definition at line 1325 of file nanoprobe.c.

References __FUNCTION__, _NetGSource::_netio, _ReliableUDP::_protocol, _FsProtocol::activeconncount, CASTTOCLASS, FSPROTO_ACKTIMEOUTINT, g_get_monotonic_time(), g_info, and mainloop.

Referenced by nano_initiate_shutdown().

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

ObeyFrameSetTypeMap collective_obeylist[]
Initial value:
= {
{0, NULL},
}
#define FRAMESETTYPE_STOPRSCOP
Stop a (possibly-repeating) JSON resource action.
Definition: framesettypes.h:59
FSTATIC void nanoobey_dorscoperation(AuthListener *, FrameSet *, NetAddr *)
Definition: nanoprobe.c:865
FSTATIC void nanoobey_startdiscover(AuthListener *, FrameSet *, NetAddr *)
Act on (obey) a FrameSet class telling us to perform a possibly repeating discovery action...
Definition: nanoprobe.c:760
#define FRAMESETTYPE_STOPSENDHB
Stop sending Heartbeats to these addresses.
Definition: framesettypes.h:50
FSTATIC void nanoobey_cancelrscoperation(AuthListener *, FrameSet *, NetAddr *)
Definition: nanoprobe.c:900
#define FRAMESETTYPE_STOPEXPECTHB
Stop expecting (listening for) Heartbeats from these addresses.
Definition: framesettypes.h:51
#define FRAMESETTYPE_STOPSENDEXPECTHB
Stop sending Heartbeats to these addresses, and stop expecting them as well.
Definition: framesettypes.h:52
FSTATIC void nanoobey_stopdiscover(AuthListener *, FrameSet *, NetAddr *)
Act on (obey) a FrameSet class telling us to stop a repeating discovery action.
Definition: nanoprobe.c:936
FSTATIC void nanoobey_decrdebug(AuthListener *, FrameSet *, NetAddr *)
Act on (obey) a FrameSet class telling us to decrement debug levels either on a specific set of class...
Definition: nanoprobe.c:745
#define FRAMESETTYPE_EXPECTHB
Expect (listen for) Heartbeats from these addresses.
Definition: framesettypes.h:48
#define FRAMESETTYPE_SENDHB
Send Heartbeats to these addresses.
Definition: framesettypes.h:47
#define FRAMESETTYPE_DODISCOVER
Perform (repeating) JSON discovery action.
Definition: framesettypes.h:56
FSTATIC void nanoobey_sendexpecthb(AuthListener *, FrameSet *fs, NetAddr *)
Act on (obey) a FRAMESETTYPE_SENDEXPECTHB FrameSet class.
Definition: nanoprobe.c:466
FSTATIC void nanoobey_stopsendexpecthb(AuthListener *, FrameSet *fs, NetAddr *)
Act on (obey) a FrameSet class telling us to stop sending and expecting heartbeats.
Definition: nanoprobe.c:546
#define FRAMESETTYPE_INCRDEBUG
Increment debug for some or all classes.
Definition: framesettypes.h:54
FSTATIC void nanoobey_stopexpecthb(AuthListener *, FrameSet *fs, NetAddr *)
Act on (obey) a FrameSet class telling us to stop expecting heartbeats.
Definition: nanoprobe.c:516
FSTATIC void nanoobey_stopsendhb(AuthListener *, FrameSet *fs, NetAddr *)
Act on (obey) a FrameSet class telling us to stop sending heartbeats.
Definition: nanoprobe.c:487
#define FRAMESETTYPE_SETCONFIG
Initial configuration packet.
Definition: framesettypes.h:53
FSTATIC void nanoobey_incrdebug(AuthListener *, FrameSet *, NetAddr *)
Act on (obey) a FrameSet class telling us to increment debug levels either on a specific set of class...
Definition: nanoprobe.c:734
#define FRAMESETTYPE_DECRDEBUG
Increment debug for some or all classes.
Definition: framesettypes.h:55
FSTATIC void nanoobey_expecthb(AuthListener *, FrameSet *fs, NetAddr *)
Act on (obey) a FrameSet class telling us to expect heartbeats.
Definition: nanoprobe.c:353
#define FRAMESETTYPE_STOPDISCOVER
Stop a repeating JSON discovery action.
Definition: framesettypes.h:57
#define FRAMESETTYPE_SENDEXPECTHB
Send Heartbeats to these addresses, and expect them as well.
Definition: framesettypes.h:49
FSTATIC void nanoobey_setconfig(AuthListener *, FrameSet *fs, NetAddr *)
Definition: nanoprobe.c:561
#define FRAMESETTYPE_DORSCOP
Do a (possibly-repeating) JSON resource action.
Definition: framesettypes.h:58
FSTATIC void nanoobey_sendhb(AuthListener *, FrameSet *fs, NetAddr *)
Act on (obey) a FrameSet class telling us to send heartbeats.
Definition: nanoprobe.c:280

The set of Collective Management Authority FrameTypes we know about, and what to do when we get them.

Resistance is futile...

Definition at line 1159 of file nanoprobe.c.

WINEXPORT int errcount = 0

error count

Definition at line 65 of file nanoprobe.c.

Referenced by check_JSON(), main(), and nano_initiate_shutdown().

GMainLoop * mainloop = NULL

Definition at line 66 of file nanoprobe.c.

Referenced by _nano_final_shutdown(), main(), and shutdown_when_outdone().

gboolean nano_connected = FALSE

Definition at line 64 of file nanoprobe.c.

Referenced by _nano_final_shutdown(), nano_initiate_shutdown(), and nanoobey_setconfig().

GRand* nano_random = NULL

Definition at line 103 of file nanoprobe.c.

Referenced by _nano_final_shutdown(), arpdiscovery_new(), and nano_start_full().

void(* nanoprobe_comealive_agent)(HbListener *, guint64 howlate) = NULL

Definition at line 62 of file nanoprobe.c.

Referenced by _real_comealive_agent().

void(* nanoprobe_deadtime_agent)(HbListener *) = NULL

Definition at line 59 of file nanoprobe.c.

Referenced by _real_deadtime_agent().

HbListener*(* nanoprobe_hblistener_new)(NetAddr *, ConfigContext *) = _real_hblistener_new

Definition at line 100 of file nanoprobe.c.

void(* nanoprobe_heartbeat_agent)(HbListener *) = NULL

Definition at line 60 of file nanoprobe.c.

Referenced by _real_heartbeat_agent().

void(* nanoprobe_warntime_agent)(HbListener *, guint64 howlate) = NULL

Definition at line 61 of file nanoprobe.c.

Referenced by _real_warntime_agent().

const char* procname = "nanoprobe"

process name

Definition at line 104 of file nanoprobe.c.

Referenced by nano_initiate_shutdown().