|
The Assimilation Monitoring Project
|
Basic utility functins for the CMA. More...
#include <projectcommon.h>#include <string.h>#include <cmalib.h>#include <frameset.h>#include <intframe.h>#include <ipportframe.h>#include <cstringframe.h>#include <frametypes.h>
Go to the source code of this file.
Functions | |
| FrameSet * | create_sendexpecthb (ConfigContext *config, guint16 msgtype, NetAddr *addrs, int addrcount) |
| Create a FrameSet class to send and expect heartbeats from the same sets of addresses. More... | |
| FrameSet * | create_setconfig (ConfigContext *cfg) |
| Create a FRAMESETTYPE_SETCONFIG FrameSet class. More... | |
Basic utility functins for the CMA.
Small enough to leave in the client code.
This file is part of the Assimilation Project.
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 cmalib.c.
| FrameSet* create_sendexpecthb | ( | ConfigContext * | config, |
| guint16 | msgtype, | ||
| NetAddr * | addrs, | ||
| int | addrcount | ||
| ) |
Create a FrameSet class to send and expect heartbeats from the same sets of addresses.
Keep in mind the entire packet needs to fit in a UDP packet (< 64K). The port, hbtime, deadtime, and warntime parameters apply to all given addresses.
| [in] | config | Provides deadtime, port, etc. |
| [in] | msgtype | message type to create |
| [in,out] | addrs | Addresses to include |
| [in] | addrcount | Count of 'addrs' provided |
Definition at line 42 of file cmalib.c.
References _IntFrame::baseclass, _IpPortFrame::baseclass, CONFIGNAME_DEADTIME, CONFIGNAME_HBTIME, CONFIGNAME_WARNTIME, frameset_append_frame(), frameset_new(), FRAMETYPE_HBDEADTIME, FRAMETYPE_HBINTERVAL, FRAMETYPE_HBWARNTIME, FRAMETYPE_IPPORT, _ConfigContext::getint, intframe_new(), ipportframe_netaddr_new(), _IntFrame::setint, and UNREF2.
Referenced by fakecma_startup().


| FrameSet* create_setconfig | ( | ConfigContext * | cfg | ) |
Create a FRAMESETTYPE_SETCONFIG FrameSet class.
We create it from a ConfigContext containing only values we want to go into the SETCONFIG message. We ignore frames in the ConfigContext (shouldn't be any). We are effectively a "friend" function to the ConfigContext object - either that or we cheated in order to iterate through its hash tables ;-)
Definition at line 91 of file cmalib.c.
References _ConfigContext::_values, _CstringFrame::baseclass, _IntFrame::baseclass, _IpPortFrame::baseclass, CFG_ARRAY, CFG_BOOL, CFG_CFGCTX, CFG_EEXIST, CFG_FLOAT, CFG_FRAME, CFG_INT64, CFG_NETADDR, CFG_NULL, CFG_STRING, cstringframe_new(), frame_default_valuefinalize(), frameset_append_frame(), frameset_new(), FRAMESETTYPE_SETCONFIG, FRAMETYPE_CINTVAL, FRAMETYPE_CSTRINGVAL, FRAMETYPE_IPPORT, FRAMETYPE_PARAMNAME, _ConfigContext::getaddr, _ConfigContext::getint, _ConfigContext::getstring, _ConfigContext::gettype, intframe_new(), ipportframe_netaddr_new(), _IntFrame::setint, _Frame::setvalue, and UNREF2.
Referenced by fakecma_startup().

