Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
babeld
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
babeld
Commits
d20d979b
Commit
d20d979b
authored
Apr 04, 2008
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement request_redundant.
parent
60025bc6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
0 deletions
+34
-0
resend.c
resend.c
+31
-0
resend.h
resend.h
+3
-0
No files found.
resend.c
View file @
d20d979b
...
@@ -156,6 +156,37 @@ unsatisfied_request(const unsigned char *prefix, unsigned char plen,
...
@@ -156,6 +156,37 @@ unsatisfied_request(const unsigned char *prefix, unsigned char plen,
return
0
;
return
0
;
}
}
/* Determine whether a given request should be forwarded. */
int
request_redundant
(
struct
network
*
net
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
unsigned
short
seqno
,
unsigned
short
router_hash
)
{
struct
resend
*
request
;
request
=
find_request
(
prefix
,
plen
,
NULL
);
if
(
request
==
NULL
||
resend_expired
(
request
))
return
0
;
if
(
request
->
router_hash
==
router_hash
&&
seqno_compare
(
request
->
seqno
,
seqno
)
>
0
)
return
0
;
if
(
request
->
network
!=
NULL
&&
request
->
network
!=
net
)
return
0
;
if
(
request
->
max
>
0
)
/* Will be resent. */
return
1
;
if
(
timeval_minus_msec
(
&
now
,
&
request
->
time
)
<
(
net
?
MIN
(
net
->
hello_interval
,
10000
)
:
10000
))
/* Fairly recent. */
return
1
;
return
0
;
}
int
int
satisfy_request
(
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
satisfy_request
(
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
unsigned
short
seqno
,
unsigned
short
router_hash
,
unsigned
short
seqno
,
unsigned
short
router_hash
,
...
...
resend.h
View file @
d20d979b
...
@@ -48,6 +48,9 @@ int record_resend(int kind, const unsigned char *prefix, unsigned char plen,
...
@@ -48,6 +48,9 @@ int record_resend(int kind, const unsigned char *prefix, unsigned char plen,
struct
network
*
net
,
int
delay
);
struct
network
*
net
,
int
delay
);
int
unsatisfied_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
);
unsigned
short
seqno
,
unsigned
short
router_hash
);
int
request_redundant
(
struct
network
*
net
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
unsigned
short
seqno
,
unsigned
short
router_hash
);
int
satisfy_request
(
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
int
satisfy_request
(
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
unsigned
short
seqno
,
unsigned
short
router_hash
,
unsigned
short
seqno
,
unsigned
short
router_hash
,
struct
network
*
net
);
struct
network
*
net
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment