Commit 86c82f44 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Maintain ihu_interval for each neighbour.

parent bb29dc92
...@@ -135,6 +135,7 @@ parse_packet(const unsigned char *from, struct network *net, ...@@ -135,6 +135,7 @@ parse_packet(const unsigned char *from, struct network *net,
if(plen == 0xFF || memcmp(myid, address, 16) == 0) { if(plen == 0xFF || memcmp(myid, address, 16) == 0) {
neigh->txcost = metric; neigh->txcost = metric;
neigh->ihu_time = now.tv_sec; neigh->ihu_time = now.tv_sec;
neigh->ihu_interval = seqno;
update_neighbour_metric(neigh); update_neighbour_metric(neigh);
} }
} else if(type == 2) { } else if(type == 2) {
......
...@@ -108,6 +108,7 @@ add_neighbour(const unsigned char *id, const unsigned char *address, ...@@ -108,6 +108,7 @@ add_neighbour(const unsigned char *id, const unsigned char *address,
neigh->ihu_time = now.tv_sec; neigh->ihu_time = now.tv_sec;
neigh->hello_time = zero; neigh->hello_time = zero;
neigh->hello_interval = 0; neigh->hello_interval = 0;
neigh->ihu_interval = 0;
neigh->hello_seqno = -1; neigh->hello_seqno = -1;
neigh->network = net; neigh->network = net;
send_hello(net); send_hello(net);
......
...@@ -30,6 +30,7 @@ struct neighbour { ...@@ -30,6 +30,7 @@ struct neighbour {
int ihu_time; int ihu_time;
struct timeval hello_time; struct timeval hello_time;
unsigned short hello_interval; /* in centiseconds */ unsigned short hello_interval; /* in centiseconds */
unsigned short ihu_interval; /* in centiseconds */
struct network *network; struct network *network;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment