1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

moved setting struct

This commit is contained in:
Steffen Vogel 2015-05-06 11:43:05 +02:00
parent 39ff4bb035
commit 17a3ff8869
4 changed files with 28 additions and 26 deletions

View file

@ -24,21 +24,7 @@ struct socket;
struct opal;
struct gtfpga;
struct netem;
/** Global configuration */
struct settings {
/** Process priority (lower is better) */
int priority;
/** Process affinity of the server and all created threads */
int affinity;
/** Debug log level */
int debug;
/** Interval for path statistics. Set to 0 to disable themo disable them. */
double stats;
/** A libconfig object pointing to the root of the config file */
config_setting_t *cfg;
};
struct settings;
/** Parse config file and store settings in supplied struct settings.
*

View file

@ -12,26 +12,43 @@
#define _CONFIG_H_
#ifndef _GIT_REV
#define _GIT_REV "nogit"
#define _GIT_REV "nogit"
#endif
/** The version number of the s2ss server */
#define VERSION "v0.4-" _GIT_REV
#define VERSION "v0.4-" _GIT_REV
/** Maximum number of float values in a message */
#define MAX_VALUES 16
#define MAX_VALUES 16
/** Maximum number of messages in the circular history buffer */
#define POOL_SIZE 16
#define DEFAULT_POOLSIZE 32
/** Width of log output in characters */
#define LOG_WIDTH 100
#define LOG_WIDTH 100
/** Socket priority */
#define SOCKET_PRIO 7
#define SOCKET_PRIO 7
/* Protocol numbers */
#define IPPROTO_S2SS 137
#define ETH_P_S2SS 0xBABE
#define IPPROTO_S2SS 137
#define ETH_P_S2SS 0xBABE
/* Hook function configuration */
#define HOOK_FIR_INDEX 1 /**< The first value of message should be filtered. */
#define HOOK_TS_INDEX -1 /**< The last value of message should be overwritten by a timestamp. */
#define HOOK_DECIMATE_RATIO 30 /**< Only forward every 10th message to the destination nodes. */
/** Global configuration */
struct settings {
/** Process priority (lower is better) */
int priority;
/** Process affinity of the server and all created threads */
int affinity;
/** Debug log level */
int debug;
/** Interval for path statistics. Set to 0 to disable themo disable them. */
double stats;
};
#endif /* _CONFIG_H_ */

View file

@ -86,7 +86,7 @@ int config_parse_global(config_setting_t *cfg, struct settings *set)
config_setting_lookup_int(cfg, "debug", &set->debug);
config_setting_lookup_float(cfg, "stats", &set->stats);
set->cfg = cfg;
log_setlevel(set->debug);
return 0;
}

View file

@ -15,10 +15,9 @@
#include <netinet/ip.h>
#include "config.h"
#include "cfg.h"
#include "if.h"
#include "msg.h"
#include "utils.h"
#include "cfg.h"
#include "path.h"
#include "node.h"