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

Add manual sequence numbers for GTNET w/o header as temp solution

This commit is contained in:
Umar Farooq 2016-10-17 16:28:43 +02:00
parent 5aa4fec093
commit a5d50ea756
4 changed files with 5 additions and 5 deletions

View file

@ -50,6 +50,8 @@ struct node
qptr_t sent; /**< Number of samples sent / written to this node. */
qptr_t received; /**< Number of samples received / read from this node. */
qptr_t seq_num; /**< Manual sequence number in case a node doesn't support it. */
enum node_state {
NODE_INVALID, /**< This node object is not in a valid state. */

View file

@ -67,10 +67,6 @@ int hook_drop(struct path *p, struct hook *h, int when, struct sample *smps[], s
{
int i, ok, dist;
/** Don't check the sequence number order in case of gtnet-skt without header */
if(!strcmp(p->in->_vt->name, "socket") && !GTNET_SKT_HEADER)
return cnt;
for (i = 0, ok = 0; i < cnt; i++) {
h->last = smps[i];

View file

@ -113,6 +113,8 @@ int node_start(struct node *n)
if (ret == 0)
n->state = NODE_RUNNING;
n->seq_num = 0; /** @todo is it the appropriate place to initialize seq_num? */
return ret;
}

View file

@ -276,7 +276,7 @@ int socket_read(struct node *n, struct sample *smps[], unsigned cnt)
smp->ts.origin.tv_sec = header[1];
smp->ts.origin.tv_nsec = header[2];
#else
smp->sequence = -1;
smp->sequence = n->seq_num++;
smp->ts.origin.tv_sec = -1;
smp->ts.origin.tv_nsec = -1;
#endif