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

cleanups and documentation

This commit is contained in:
Steffen Vogel 2015-06-02 22:29:15 +02:00
parent ef8011725b
commit a3908af4da
8 changed files with 22 additions and 10 deletions

View file

@ -23,7 +23,7 @@
struct file {
FILE *in;
FILE *out;
const char *path_in;
char *path_out;

View file

@ -1,12 +1,11 @@
/** Histogram functions.
*
* @file
* @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
* @copyright 2014-2015, Institute for Automation of Complex Power Systems, EONERC
* This file is part of S2SS. All Rights Reserved. Proprietary and confidential.
* Unauthorized copying of this file, via any medium is strictly prohibited.
*********************************************************************************/
* @file
*/
#ifndef _HIST_H_
#define _HIST_H_

View file

@ -14,7 +14,15 @@
#include <time.h>
#include <sys/ptrace.h>
/** Check for correct license */
/** Simple copy protection.
*
* This function does:
* - checks several machine IDs for predefined values.
* - checks if program is debugged / traced
*
* This function shall be executed during program startup to
* check if this host is allowed to execute S2SS.
*/
static inline __attribute__((always_inline)) int check_license()
{
const struct {

View file

@ -23,8 +23,7 @@
/** Debug level used by the debug() macro.
* It defaults to V (defined by the Makefile) and can be
* overwritten by the 'debug' setting in the configuration file.
*/
* overwritten by the 'debug' setting in the configuration file. */
static int level = V;
/** A global clock used to prefix the log messages. */

View file

@ -82,7 +82,7 @@ static void * path_run(void *arg)
node_start_defer(it->node); */
/* Main thread loop */
skip: while (1) {
skip: for(;;) {
/* Receive message */
int recv = node_read(p->in, p->pool, p->poolsize, p->received, p->in->combine);

View file

@ -39,7 +39,7 @@ static struct settings set;
static struct msg *pool;
static struct node *node;
static void quit(int sig, siginfo_t *si, void *ptr)
static void quit()
{
node_stop(node);
node_deinit();

View file

@ -108,13 +108,20 @@ int main(int argc, char *argv[])
node_reverse(node);
node->refcnt++;
pool = alloc(sizeof(struct msg) * node->combine);
node->vt->refcnt++;
info("Initialize node types");
node_init(argc-optind, argv+optind, &set);
info("Start node");
node_start(node);
node_start_defer(node);
pool = alloc(sizeof(struct msg) * node->combine);
/* Print header */
fprintf(stderr, "# %-20s\t%s\t%s\n", "timestamp", "seqno", "data[]");
while (!feof(stdin)) {
for (int i = 0; i < node->combine; i++) {
msg_fscan(stdin, &pool[i]);

View file

@ -150,7 +150,6 @@ int main(int argc, char *argv[])
info("Initialize node types");
node_init(argc, argv, &settings);
/* Connect all nodes and start one thread per path */
info("Starting nodes");
FOREACH(&nodes, it)
node_start(it->node);