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
b7825f6b
Commit
b7825f6b
authored
Jun 28, 2014
by
Matthieu Boutier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement source-specific requests.
parent
53c84d91
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
18 deletions
+14
-18
message.c
message.c
+4
-5
resend.c
resend.c
+7
-13
resend.h
resend.h
+2
-0
route.c
route.c
+1
-0
No files found.
message.c
View file @
b7825f6b
...
...
@@ -2007,16 +2007,14 @@ handle_request(struct neighbour *neigh, const unsigned char *prefix,
update_myseqno
();
}
}
send_update
(
neigh
->
ifp
,
1
,
prefix
,
plen
,
xroute
->
src_prefix
,
xroute
->
src_plen
);
send_update
(
neigh
->
ifp
,
1
,
prefix
,
plen
,
src_prefix
,
src_plen
);
return
;
}
if
(
route
&&
(
memcmp
(
id
,
route
->
src
->
id
,
8
)
!=
0
||
seqno_compare
(
seqno
,
route
->
seqno
)
<=
0
))
{
send_update
(
neigh
->
ifp
,
1
,
prefix
,
plen
,
route
->
src
->
src_prefix
,
route
->
src
->
src_plen
);
send_update
(
neigh
->
ifp
,
1
,
prefix
,
plen
,
src_prefix
,
src_plen
);
return
;
}
...
...
@@ -2029,7 +2027,8 @@ handle_request(struct neighbour *neigh, const unsigned char *prefix,
return
;
}
if
(
request_redundant
(
neigh
->
ifp
,
prefix
,
plen
,
seqno
,
id
))
if
(
request_redundant
(
neigh
->
ifp
,
prefix
,
plen
,
src_prefix
,
src_plen
,
seqno
,
id
))
return
;
/* Let's try to forward this request. */
...
...
resend.c
View file @
b7825f6b
...
...
@@ -82,8 +82,6 @@ find_request(const unsigned char *prefix, unsigned char plen,
const
unsigned
char
*
src_prefix
,
unsigned
char
src_plen
,
struct
resend
**
previous_return
)
{
if
(
src_plen
!=
0
)
return
NULL
;
return
find_resend
(
RESEND_REQUEST
,
prefix
,
plen
,
src_prefix
,
src_plen
,
previous_return
);
}
...
...
@@ -97,11 +95,9 @@ record_resend(int kind, const unsigned char *prefix, unsigned char plen,
struct
resend
*
resend
;
unsigned
int
ifindex
=
ifp
?
ifp
->
ifindex
:
0
;
if
(
src_plen
!=
0
)
return
0
;
if
((
kind
==
RESEND_REQUEST
&&
input_filter
(
NULL
,
prefix
,
plen
,
NULL
,
0
,
NULL
,
ifindex
,
NULL
)
>=
input_filter
(
NULL
,
prefix
,
plen
,
src_prefix
,
src_plen
,
NULL
,
ifindex
,
NULL
)
>=
INFINITY
)
||
(
kind
==
RESEND_UPDATE
&&
output_filter
(
NULL
,
prefix
,
plen
,
src_prefix
,
src_plen
,
...
...
@@ -174,11 +170,12 @@ resend_expired(struct resend *resend)
int
unsatisfied_request
(
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
const
unsigned
char
*
src_prefix
,
unsigned
char
src_plen
,
unsigned
short
seqno
,
const
unsigned
char
*
id
)
{
struct
resend
*
request
;
request
=
find_request
(
prefix
,
plen
,
zeroes
,
0
,
NULL
);
request
=
find_request
(
prefix
,
plen
,
src_prefix
,
src_plen
,
NULL
);
if
(
request
==
NULL
||
resend_expired
(
request
))
return
0
;
...
...
@@ -193,11 +190,12 @@ unsatisfied_request(const unsigned char *prefix, unsigned char plen,
int
request_redundant
(
struct
interface
*
ifp
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
const
unsigned
char
*
src_prefix
,
unsigned
char
src_plen
,
unsigned
short
seqno
,
const
unsigned
char
*
id
)
{
struct
resend
*
request
;
request
=
find_request
(
prefix
,
plen
,
zeroes
,
0
,
NULL
);
request
=
find_request
(
prefix
,
plen
,
src_prefix
,
src_plen
,
NULL
);
if
(
request
==
NULL
||
resend_expired
(
request
))
return
0
;
...
...
@@ -228,11 +226,7 @@ satisfy_request(const unsigned char *prefix, unsigned char plen,
{
struct
resend
*
request
,
*
previous
;
/* TODO */
if
(
src_plen
!=
0
)
return
0
;
request
=
find_request
(
prefix
,
plen
,
zeroes
,
0
,
&
previous
);
request
=
find_request
(
prefix
,
plen
,
src_prefix
,
src_plen
,
&
previous
);
if
(
request
==
NULL
)
return
0
;
...
...
resend.h
View file @
b7825f6b
...
...
@@ -52,9 +52,11 @@ int record_resend(int kind, const unsigned char *prefix, unsigned char plen,
unsigned
short
seqno
,
const
unsigned
char
*
id
,
struct
interface
*
ifp
,
int
delay
);
int
unsatisfied_request
(
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
const
unsigned
char
*
src_prefix
,
unsigned
char
src_plen
,
unsigned
short
seqno
,
const
unsigned
char
*
id
);
int
request_redundant
(
struct
interface
*
ifp
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
const
unsigned
char
*
src_prefix
,
unsigned
char
src_plen
,
unsigned
short
seqno
,
const
unsigned
char
*
id
);
int
satisfy_request
(
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
const
unsigned
char
*
src_prefix
,
unsigned
char
src_plen
,
...
...
route.c
View file @
b7825f6b
...
...
@@ -1085,6 +1085,7 @@ send_triggered_update(struct babel_route *route, struct source *oldsrc,
/* Route getting significantly worse */
urgent
=
1
;
else
if
(
unsatisfied_request
(
route
->
src
->
prefix
,
route
->
src
->
plen
,
route
->
src
->
src_prefix
,
route
->
src
->
src_plen
,
route
->
seqno
,
route
->
src
->
id
))
/* Make sure that requests are satisfied speedily */
urgent
=
1
;
...
...
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