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
25ddad56
Commit
25ddad56
authored
Mar 31, 2008
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename struct request to resend.
parent
8a5109b3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
26 deletions
+26
-26
message.c
message.c
+1
-1
resend.c
resend.c
+21
-21
resend.h
resend.h
+4
-4
No files found.
message.c
View file @
25ddad56
...
...
@@ -834,7 +834,7 @@ send_update(struct network *net, int urgent,
const
unsigned
char
*
prefix
,
unsigned
char
plen
)
{
int
i
,
selfonly
;
struct
re
quest
*
request
;
struct
re
send
*
request
;
if
(
prefix
)
{
/* This is needed here, since really_send_update only handles the
...
...
resend.c
View file @
25ddad56
...
...
@@ -34,23 +34,23 @@ THE SOFTWARE.
#include "filter.h"
struct
timeval
resend_time
=
{
0
,
0
};
struct
re
quest
*
recorded_requests
=
NULL
;
struct
re
send
*
to_resend
=
NULL
;
static
int
request_match
(
struct
re
quest
*
request
,
request_match
(
struct
re
send
*
request
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
)
{
return
request
->
plen
==
plen
&&
memcmp
(
request
->
prefix
,
prefix
,
16
)
==
0
;
}
struct
re
quest
*
struct
re
send
*
find_request
(
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
struct
re
quest
**
previous_return
)
struct
re
send
**
previous_return
)
{
struct
re
quest
*
request
,
*
previous
;
struct
re
send
*
request
,
*
previous
;
previous
=
NULL
;
request
=
recorded_requests
;
request
=
to_resend
;
while
(
request
)
{
if
(
request_match
(
request
,
prefix
,
plen
))
{
if
(
previous_return
)
...
...
@@ -69,7 +69,7 @@ record_request(const unsigned char *prefix, unsigned char plen,
unsigned
short
seqno
,
unsigned
short
router_hash
,
struct
network
*
network
,
int
resend
)
{
struct
re
quest
*
request
;
struct
re
send
*
request
;
unsigned
int
ifindex
=
network
?
network
->
ifindex
:
0
;
if
(
input_filter
(
NULL
,
prefix
,
plen
,
NULL
,
ifindex
)
>=
INFINITY
||
...
...
@@ -92,7 +92,7 @@ record_request(const unsigned char *prefix, unsigned char plen,
if
(
request
->
network
!=
network
)
request
->
network
=
NULL
;
}
else
{
request
=
malloc
(
sizeof
(
struct
re
quest
));
request
=
malloc
(
sizeof
(
struct
re
send
));
if
(
request
==
NULL
)
return
-
1
;
memcpy
(
request
->
prefix
,
prefix
,
16
);
...
...
@@ -102,8 +102,8 @@ record_request(const unsigned char *prefix, unsigned char plen,
request
->
network
=
network
;
request
->
time
=
now
;
request
->
resend
=
resend
;
request
->
next
=
recorded_requests
;
recorded_requests
=
request
;
request
->
next
=
to_resend
;
to_resend
=
request
;
}
if
(
request
->
resend
)
{
...
...
@@ -118,7 +118,7 @@ int
unsatisfied_request
(
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
unsigned
short
seqno
,
unsigned
short
router_hash
)
{
struct
re
quest
*
request
;
struct
re
send
*
request
;
request
=
find_request
(
prefix
,
plen
,
NULL
);
if
(
request
==
NULL
)
...
...
@@ -136,7 +136,7 @@ satisfy_request(const unsigned char *prefix, unsigned char plen,
unsigned
short
seqno
,
unsigned
short
router_hash
,
struct
network
*
network
)
{
struct
re
quest
*
request
,
*
previous
;
struct
re
send
*
request
,
*
previous
;
request
=
find_request
(
prefix
,
plen
,
&
previous
);
if
(
request
==
NULL
)
...
...
@@ -148,7 +148,7 @@ satisfy_request(const unsigned char *prefix, unsigned char plen,
if
(
request
->
router_hash
!=
router_hash
||
seqno_compare
(
request
->
seqno
,
seqno
)
<=
0
)
{
if
(
previous
==
NULL
)
recorded_requests
=
request
->
next
;
to_resend
=
request
->
next
;
else
previous
->
next
=
request
->
next
;
free
(
request
);
...
...
@@ -162,17 +162,17 @@ satisfy_request(const unsigned char *prefix, unsigned char plen,
void
expire_requests
()
{
struct
re
quest
*
request
,
*
previous
;
struct
re
send
*
request
,
*
previous
;
int
recompute
=
0
;
previous
=
NULL
;
request
=
recorded_requests
;
request
=
to_resend
;
while
(
request
)
{
if
(
timeval_minus_msec
(
&
now
,
&
request
->
time
)
>=
REQUEST_TIMEOUT
)
{
if
(
previous
==
NULL
)
{
recorded_requests
=
request
->
next
;
to_resend
=
request
->
next
;
free
(
request
);
request
=
recorded_requests
;
request
=
to_resend
;
}
else
{
previous
->
next
=
request
->
next
;
free
(
request
);
...
...
@@ -190,10 +190,10 @@ expire_requests()
void
recompute_resend_time
()
{
struct
re
quest
*
request
;
struct
re
send
*
request
;
struct
timeval
resend
=
{
0
,
0
};
request
=
recorded_requests
;
request
=
to_resend
;
while
(
request
)
{
if
(
request
->
resend
)
{
struct
timeval
timeout
;
...
...
@@ -209,9 +209,9 @@ recompute_resend_time()
void
do_resend
()
{
struct
re
quest
*
request
;
struct
re
send
*
request
;
request
=
recorded_requests
;
request
=
to_resend
;
while
(
request
)
{
if
(
request
->
resend
)
{
struct
timeval
timeout
;
...
...
resend.h
View file @
25ddad56
...
...
@@ -22,7 +22,7 @@ THE SOFTWARE.
#define REQUEST_TIMEOUT 125000
struct
re
quest
{
struct
re
send
{
unsigned
char
prefix
[
16
];
unsigned
char
plen
;
unsigned
short
seqno
;
...
...
@@ -30,13 +30,13 @@ struct request {
struct
network
*
network
;
struct
timeval
time
;
int
resend
;
struct
re
quest
*
next
;
struct
re
send
*
next
;
};
extern
struct
timeval
resend_time
;
struct
re
quest
*
find_request
(
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
struct
request
**
previous_return
);
struct
re
send
*
find_request
(
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
struct
resend
**
previous_return
);
int
record_request
(
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
unsigned
short
seqno
,
unsigned
short
router_hash
,
struct
network
*
net
,
int
resend
);
...
...
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