Commit f7217359 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Implement unsatisfied_request.

parent 2f36ab75
......@@ -114,6 +114,23 @@ record_request(const unsigned char *prefix, unsigned char plen,
}
}
int
unsatisfied_request(const unsigned char *prefix, unsigned char plen,
unsigned short seqno, unsigned short router_hash)
{
struct request *request;
request = find_request(prefix, plen, NULL);
if(request == NULL)
return 0;
if(request->router_hash != router_hash ||
seqno_compare(request->seqno, seqno) <= 0)
return 1;
return 0;
}
int
satisfy_request(const unsigned char *prefix, unsigned char plen,
unsigned short seqno, unsigned short router_hash,
......
......@@ -40,6 +40,8 @@ struct request *find_request(const unsigned char *prefix, unsigned char plen,
int record_request(const unsigned char *prefix, unsigned char plen,
unsigned short seqno, unsigned short router_hash,
struct network *net, int resend);
int unsatisfied_request(const unsigned char *prefix, unsigned char plen,
unsigned short seqno, unsigned short router_hash);
int satisfy_request(const unsigned char *prefix, unsigned char plen,
unsigned short seqno, unsigned short router_hash,
struct network *net);
......
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