mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
fixed simulation restart
git-svn-id: https://zerberus.eonerc.rwth-aachen.de:8443/svn/s2ss/trunk@233 8ec27952-4edc-4aab-86aa-e87bb2611832
This commit is contained in:
parent
6a5418a851
commit
be4cb8d9b4
1 changed files with 13 additions and 13 deletions
|
@ -75,6 +75,18 @@ static void * path_run(void *arg)
|
|||
while (1) {
|
||||
msg_recv(m, p->in); /* Receive message */
|
||||
|
||||
/* Check sequence number */
|
||||
if (m->sequence == 0) {
|
||||
path_stats(p);
|
||||
info("Simulation started");
|
||||
|
||||
p->sent = 0;
|
||||
p->received = 0;
|
||||
p->invalid = 0;
|
||||
p->skipped = 0;
|
||||
p->dropped = 0;
|
||||
}
|
||||
|
||||
lag = m->sequence - p->sequence;
|
||||
|
||||
p->received++;
|
||||
|
@ -82,7 +94,7 @@ static void * path_run(void *arg)
|
|||
if (HIST_SEQ/2 + lag < HIST_SEQ && HIST_SEQ/2 + lag >= 0)
|
||||
p->histogram[HIST_SEQ/2 + lag]++;
|
||||
|
||||
/** Check header fields */
|
||||
/* Check header fields */
|
||||
if (m->version != MSG_VERSION ||
|
||||
m->type != MSG_TYPE_DATA) {
|
||||
p->invalid++;
|
||||
|
@ -100,18 +112,6 @@ static void * path_run(void *arg)
|
|||
continue;
|
||||
}
|
||||
|
||||
/* Check sequence number */
|
||||
if (m->sequence == 0) {
|
||||
path_stats(p);
|
||||
info("Simulation started");
|
||||
|
||||
p->sent = 0;
|
||||
p->received = 0;
|
||||
p->invalid = 0;
|
||||
p->skipped = 0;
|
||||
p->dropped = 0;
|
||||
}
|
||||
|
||||
/* Update last known sequence number */
|
||||
p->sequence = m->sequence;
|
||||
p->last = m;
|
||||
|
|
Loading…
Add table
Reference in a new issue