The Assimilation Project
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
configcontext.h File Reference

Implements Configuration Context class. More...

#include <projectcommon.h>
#include <assimobj.h>
#include <netaddr.h>
#include <signframe.h>
#include <address_family_numbers.h>
Include dependency graph for configcontext.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _ConfigValue
 
struct  _ConfigContext
 
#define CONFIG_DEFAULT_DEADTIME   30
 Default "deadtime". More...
 
#define CONFIG_DEFAULT_HBTIME   3
 Default heartbeat interval. More...
 
#define CONFIG_DEFAULT_WARNTIME   10
 Default warning time. More...
 
#define CONFIG_DEFAULT_CMAPORT   1984
 Default CMA port. More...
 
#define CONFIG_DEFAULT_ADDR   {127,0,0,1}
 
#define CONFIG_DEFAULT_ADDRTYPE   ADDR_FAMILY_IPV4
 
#define CONFIG_DEFAULT_SIGNFRAME_TYPE   G_CHECKSUM_SHA256
 
#define CONFIGNAME_INTERVAL   "repeat"
 How long to wait between events. More...
 
#define CONFIGNAME_WARNTIME   "warn"
 How long w/o heartbeats before whining? More...
 
#define CONFIGNAME_TIMEOUT   "timeout"
 How before declaring a serious problem... More...
 
#define CONFIGNAME_INITDELAY   "init_delay"
 How long to wait before starting. More...
 
#define CONFIGNAME_CMAPORT   "cmaport"
 Default Port for contacting the CMA. More...
 
#define CONFIGNAME_CMAINIT   "cmainit"
 Initial startup contact address for the CMA. More...
 
#define CONFIGNAME_CMAADDR   "cmaaddr"
 Address of the Collective Management authority. More...
 
#define CONFIGNAME_CMADISCOVER   "cmadisc"
 Address of where to send discovery reports. More...
 
#define CONFIGNAME_CMAFAIL   "cmafail"
 Address of where to send failure reports. More...
 
#define CONFIGNAME_TYPE   "type"
 Type of resource or discovery. More...
 
#define CONFIGNAME_INSTANCE   "instance"
 Instance name for discovery. More...
 
#define CONFIGNAME_DEVNAME   "device"
 Name of NIC for discovery. More...
 
#define CONFIGNAME_SWPROTOS   "swprotocols"
 List of switch protocols as an array of strings. More...
 
#define CONFIGNAME_OUTSIG   "outsig"
 SignFrame to use to sign/verify packets. More...
 
#define CONFIGNAME_CRYPT   "crypt"
 Frame to use for encrypting/decrypting packets. More...
 
#define CONFIGNAME_COMPRESS   "compress"
 Frame to use for compressing/decompressing. More...
 
#define CONFIGNAME_CPRS_THRESH   "compression_threshold"
 Threshold for compressing (integer) More...
 
#define CONFIGNAME_COMPRESSTYPE   "compression_method"
 Compression method (string) More...
 
#define CONFIGINTDEFAULTS
 Default values for some (integer) configuration values. More...
 
enum  ConfigValType {
  CFG_EEXIST, CFG_NULL, CFG_BOOL, CFG_INT64,
  CFG_STRING, CFG_FLOAT, CFG_ARRAY, CFG_CFGCTX,
  CFG_NETADDR, CFG_FRAME
}
 
typedef struct _ConfigContext ConfigContext
 This is the base ConfigContext class object providing configuration context for our clients, and is managed by our C-Class Management system. More...
 
typedef struct _ConfigValue ConfigValue
 
WINEXPORT ConfigContextconfigcontext_new (gsize objsize)
 Construct a new ConfigContext object - with no values defaulted. More...
 
WINEXPORT ConfigContextconfigcontext_new_JSON_string (const char *jsontext)
 Construct a ConfigContext object from the given JSON string. More...
 

Detailed Description

Implements Configuration Context class.

This class holds all the information concerning our basic configuration - things like our signature SignFrame class, the public key of our master, and the address of the Collective Management Authority and so on...

This file is part of the Assimilation Project.

Author
Copyright © 2011, 2012 - Alan Robertson alanr.nosp@m.@uni.nosp@m.x.sh
The Assimilation software is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

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 configcontext.h.

Macro Definition Documentation

#define CONFIG_DEFAULT_ADDR   {127,0,0,1}

Definition at line 112 of file configcontext.h.

#define CONFIG_DEFAULT_ADDRTYPE   ADDR_FAMILY_IPV4

Definition at line 113 of file configcontext.h.

#define CONFIG_DEFAULT_CMAPORT   1984

Default CMA port.

Definition at line 111 of file configcontext.h.

#define CONFIG_DEFAULT_DEADTIME   30

Default "deadtime".

Definition at line 108 of file configcontext.h.

Referenced by create_sendexpecthb(), and nanoobey_expecthb().

#define CONFIG_DEFAULT_HBTIME   3

Default heartbeat interval.

Definition at line 109 of file configcontext.h.

Referenced by create_sendexpecthb(), and nanoobey_sendhb().

#define CONFIG_DEFAULT_SIGNFRAME_TYPE   G_CHECKSUM_SHA256

Definition at line 114 of file configcontext.h.

#define CONFIG_DEFAULT_WARNTIME   10

Default warning time.

Definition at line 110 of file configcontext.h.

Referenced by create_sendexpecthb(), and nanoobey_expecthb().

#define CONFIGINTDEFAULTS
Value:
{ \
{CONFIGNAME_DEADTIME, CONFIG_DEFAULT_DEADTIME}, \
{CONFIGNAME_HBTIME, CONFIG_DEFAULT_HBTIME}, \
}
#define CONFIG_DEFAULT_WARNTIME
Default warning time.
#define CONFIGNAME_CMAPORT
Default Port for contacting the CMA.
#define CONFIG_DEFAULT_HBTIME
Default heartbeat interval.
#define CONFIGNAME_WARNTIME
How long w/o heartbeats before whining?
#define CONFIG_DEFAULT_DEADTIME
Default "deadtime".
#define CONFIG_DEFAULT_CMAPORT
Default CMA port.

Default values for some (integer) configuration values.

Definition at line 137 of file configcontext.h.

#define CONFIGNAME_CMAADDR   "cmaaddr"

Address of the Collective Management authority.

Definition at line 123 of file configcontext.h.

Referenced by main().

#define CONFIGNAME_CMADISCOVER   "cmadisc"

Address of where to send discovery reports.

Definition at line 124 of file configcontext.h.

Referenced by _arpdiscovery_dispatch(), _discovery_sendjson(), _jsondiscovery_discover(), _nano_initconfig_OK(), _switchdiscovery_dispatch(), and main().

#define CONFIGNAME_CMAFAIL   "cmafail"

Address of where to send failure reports.

Definition at line 125 of file configcontext.h.

Referenced by _nano_initconfig_OK(), main(), and nanoobey_setconfig().

#define CONFIGNAME_CMAINIT   "cmainit"

Initial startup contact address for the CMA.

(could be a multicast address)

Definition at line 121 of file configcontext.h.

Referenced by main(), and nano_reqconfig().

#define CONFIGNAME_CMAPORT   "cmaport"

Default Port for contacting the CMA.

Definition at line 120 of file configcontext.h.

Referenced by main().

#define CONFIGNAME_COMPRESS   "compress"

Frame to use for compressing/decompressing.

Definition at line 132 of file configcontext.h.

Referenced by main(), nanoobey_setconfig(), and netio_new().

#define CONFIGNAME_COMPRESSTYPE   "compression_method"

Compression method (string)

Definition at line 134 of file configcontext.h.

#define CONFIGNAME_CPRS_THRESH   "compression_threshold"

Threshold for compressing (integer)

Definition at line 133 of file configcontext.h.

Referenced by nanoobey_setconfig().

#define CONFIGNAME_CRYPT   "crypt"

Frame to use for encrypting/decrypting packets.

Definition at line 131 of file configcontext.h.

#define CONFIGNAME_DEVNAME   "device"

Name of NIC for discovery.

Definition at line 128 of file configcontext.h.

Referenced by arpdiscovery_new(), and switchdiscovery_new().

#define CONFIGNAME_INITDELAY   "init_delay"

How long to wait before starting.

Definition at line 119 of file configcontext.h.

Referenced by _resource_queue_qelem_new().

#define CONFIGNAME_INSTANCE   "instance"

Instance name for discovery.

Definition at line 127 of file configcontext.h.

Referenced by _nano_send_rscexitstatus(), _resource_queue_cancel(), arpdiscovery_new(), resourcecmd_constructor(), and switchdiscovery_new().

#define CONFIGNAME_INTERVAL   "repeat"

How long to wait between events.

Definition at line 116 of file configcontext.h.

Referenced by _arpdiscovery_first_discovery(), arpdiscovery_new(), create_sendexpecthb(), main(), and nanoobey_sendhb().

#define CONFIGNAME_OUTSIG   "outsig"

SignFrame to use to sign/verify packets.

Definition at line 130 of file configcontext.h.

Referenced by main(), and netio_new().

#define CONFIGNAME_SWPROTOS   "swprotocols"

List of switch protocols as an array of strings.

Definition at line 129 of file configcontext.h.

Referenced by _switchdiscovery_setprotocols().

#define CONFIGNAME_TIMEOUT   "timeout"

How before declaring a serious problem...

Definition at line 118 of file configcontext.h.

Referenced by create_sendexpecthb(), hblistener_new(), main(), and nanoobey_expecthb().

#define CONFIGNAME_TYPE   "type"
#define CONFIGNAME_WARNTIME   "warn"

How long w/o heartbeats before whining?

Definition at line 117 of file configcontext.h.

Referenced by create_sendexpecthb(), hblistener_new(), and nanoobey_expecthb().

Typedef Documentation

typedef struct _ConfigValue ConfigValue

Definition at line 56 of file configcontext.h.

Enumeration Type Documentation

Enumerator
CFG_EEXIST 
CFG_NULL 
CFG_BOOL 
CFG_INT64 
CFG_STRING 
CFG_FLOAT 
CFG_ARRAY 
CFG_CFGCTX 
CFG_NETADDR 
CFG_FRAME 

Definition at line 44 of file configcontext.h.