mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
cleanups
This commit is contained in:
parent
81c0a9e431
commit
375a16243e
6 changed files with 20 additions and 14 deletions
|
@ -1,9 +1,11 @@
|
|||
TARGETS = server send random receive test
|
||||
|
||||
# Common dependencies for all binaries
|
||||
OBJS = if.o utils.o msg.o node.o cfg.o tc.o hooks.o list.o path.o hist.o log.o
|
||||
# Common objs
|
||||
OBJS = msg.o cfg.o path.o node.o hooks.o
|
||||
# Helper libs
|
||||
OBJS += utils.o list.o hist.o log.o timing.o
|
||||
# Node types
|
||||
OBJS += socket.o file.o
|
||||
OBJS += file.o socket.o if.o tc.o
|
||||
|
||||
VPATH = src
|
||||
|
||||
|
@ -46,12 +48,12 @@ endif
|
|||
all: $(TARGETS)
|
||||
|
||||
# Dependencies for individual binaries
|
||||
server: server.o $(OBJS)
|
||||
send: send.o $(OBJS)
|
||||
server: server.o $(OBJS)
|
||||
send: send.o $(OBJS)
|
||||
receive: receive.o $(OBJS)
|
||||
random: random.o $(OBJS)
|
||||
test: test.o $(OBJS)
|
||||
|
||||
test: test.o $(OBJS)
|
||||
random: random.o $(OBJS)
|
||||
|
||||
protected: CFLAGS += -DPROTECT -DVALID_UNTIL=$(shell date -d "now +5months" +%s) -s -O3 -fvisibility=hidden
|
||||
protected: clean strip
|
||||
|
||||
|
|
|
@ -29,9 +29,9 @@ struct file {
|
|||
|
||||
const char *mode; /**< The mode for fopen() which is used for the out file. */
|
||||
|
||||
struct timespec offset; /**< An offset between the timestamp in the input file and the current time */
|
||||
double rate; /**< The sending rate. */
|
||||
int tfd; /**< Timer file descriptor. Blocks until 1/rate seconds are elapsed. */
|
||||
int timestamp; /**< Bolean flag, prepend timestamp in front of message */
|
||||
};
|
||||
|
||||
/** @see node_vtable::init */
|
||||
|
|
|
@ -93,15 +93,19 @@ skip: for(;;) {
|
|||
p->previous = &p->pool[(p->received-1) % p->poolsize];
|
||||
p->current = &p->pool[ p->received % p->poolsize];
|
||||
|
||||
if (settings.debug >= 10)
|
||||
msg_fprint(stdout, p->current);
|
||||
|
||||
p->received++;
|
||||
|
||||
/* Check header fields */
|
||||
if (msg_verify(p->current)) {
|
||||
p->invalid++;
|
||||
warn("Received invalid message!");
|
||||
goto skip; /* Drop message */
|
||||
}
|
||||
|
||||
/* Update histogram and handle wrap-around of sequence number */
|
||||
/* Handle wrap-around of sequence number */
|
||||
int dist = (UINT16_MAX + p->current->sequence - p->previous->sequence) % UINT16_MAX;
|
||||
if (dist > UINT16_MAX / 2)
|
||||
dist -= UINT16_MAX;
|
||||
|
|
|
@ -288,7 +288,7 @@ int socket_parse(config_setting_t *cfg, struct node *n)
|
|||
cerror(cfg, "Failed to resolve remote address '%s' of node '%s': %s",
|
||||
remote, n->name, gai_strerror(ret));
|
||||
|
||||
/** @todo Netem settings are not usable AF_UNIX */
|
||||
/** @todo Netem settings are not usable with AF_UNIX */
|
||||
config_setting_t *cfg_netem = config_setting_get_member(cfg, "netem");
|
||||
if (cfg_netem) {
|
||||
s->netem = alloc(sizeof(struct netem));
|
||||
|
|
|
@ -78,7 +78,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
printf("Simulator2Simulator Server %s (built on %s %s)\n",
|
||||
BLU(VERSION), MAG(__DATE__), MAG(__TIME__));
|
||||
printf(" Copyright 2015, Institute for Automation of Complex Power Systems, EONERC\n");
|
||||
printf(" copyright 2014-2015, Institute for Automation of Complex Power Systems, EONERC\n");
|
||||
printf(" Steffen Vogel <StVogel@eonerc.rwth-aachen.de>\n");
|
||||
|
||||
exit(EXIT_FAILURE);
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
#include <fstab.h>
|
||||
|
||||
#ifdef ENABLE_OPAL_ASYNC
|
||||
#define RTLAB
|
||||
#include <OpalPrint.h>
|
||||
#define RTLAB
|
||||
#include <OpalPrint.h>
|
||||
#endif
|
||||
|
||||
#include "config.h"
|
||||
|
|
Loading…
Add table
Reference in a new issue