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
57d9928c
Commit
57d9928c
authored
Jul 28, 2014
by
Matthieu Boutier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Format TLV for unicast requests.
parent
d0cd3a24
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
9 deletions
+34
-9
message.c
message.c
+28
-6
message.h
message.h
+3
-1
neighbour.c
neighbour.c
+1
-1
route.c
route.c
+2
-1
No files found.
message.c
View file @
57d9928c
...
...
@@ -1731,30 +1731,52 @@ send_request(struct interface *ifp,
void
send_unicast_request
(
struct
neighbour
*
neigh
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
)
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
const
unsigned
char
*
src_prefix
,
unsigned
char
src_plen
)
{
int
rc
,
v4
,
pb
,
len
;
int
rc
,
v4
,
pb
,
spb
,
len
;
/* make sure any buffered updates go out before this request. */
flushupdates
(
neigh
->
ifp
);
debugf
(
"sending unicast request to %s for %s.
\n
"
,
format_address
(
neigh
->
address
),
prefix
?
format_prefix
(
prefix
,
plen
)
:
"any"
);
if
(
!
prefix
)
debugf
(
"sending unicast request to %s for any.
\n
"
,
format_address
(
neigh
->
address
));
else
debugf
(
"sending unicast request to %s for %s from %s.
\n
"
,
format_address
(
neigh
->
address
),
format_prefix
(
prefix
,
plen
),
format_prefix
(
src_prefix
,
src_plen
));
v4
=
plen
>=
96
&&
v4mapped
(
prefix
);
pb
=
v4
?
((
plen
-
96
)
+
7
)
/
8
:
(
plen
+
7
)
/
8
;
len
=
!
prefix
?
2
:
2
+
pb
;
rc
=
start_unicast_message
(
neigh
,
MESSAGE_REQUEST
,
len
);
if
(
src_plen
!=
0
)
{
spb
=
v4
?
((
src_plen
-
96
)
+
7
)
/
8
:
(
src_plen
+
7
)
/
8
;
len
+=
spb
+
1
;
rc
=
start_unicast_message
(
neigh
,
MESSAGE_REQUEST_SRC_SPECIFIC
,
len
);
}
else
{
rc
=
start_unicast_message
(
neigh
,
MESSAGE_REQUEST
,
len
);
}
if
(
rc
<
0
)
return
;
accumulate_unicast_byte
(
neigh
,
!
prefix
?
0
:
v4
?
1
:
2
);
accumulate_unicast_byte
(
neigh
,
!
prefix
?
0
:
v4
?
plen
-
96
:
plen
);
if
(
src_plen
!=
0
)
accumulate_unicast_byte
(
neigh
,
v4
?
src_plen
-
96
:
src_plen
);
if
(
prefix
)
{
if
(
v4
)
accumulate_unicast_bytes
(
neigh
,
prefix
+
12
,
pb
);
else
accumulate_unicast_bytes
(
neigh
,
prefix
,
pb
);
}
if
(
src_plen
!=
0
)
{
if
(
v4
)
accumulate_unicast_bytes
(
neigh
,
src_prefix
+
12
,
spb
);
else
accumulate_unicast_bytes
(
neigh
,
src_prefix
,
spb
);
end_unicast_message
(
neigh
,
MESSAGE_REQUEST_SRC_SPECIFIC
,
len
);
return
;
}
end_unicast_message
(
neigh
,
MESSAGE_REQUEST
,
len
);
}
...
...
message.h
View file @
57d9928c
...
...
@@ -85,7 +85,9 @@ void send_request(struct interface *ifp,
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
const
unsigned
char
*
src_prefix
,
unsigned
char
src_plen
);
void
send_unicast_request
(
struct
neighbour
*
neigh
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
);
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
const
unsigned
char
*
src_prefix
,
unsigned
char
src_plen
);
void
send_multihop_request
(
struct
interface
*
ifp
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
unsigned
short
seqno
,
const
unsigned
char
*
id
,
...
...
neighbour.c
View file @
57d9928c
...
...
@@ -193,7 +193,7 @@ update_neighbour(struct neighbour *neigh, int hello, int hello_interval)
if
((
neigh
->
reach
&
0xFC00
)
==
0xC000
)
{
/* This is a newish neighbour, let's request a full route dump.
We ought to avoid this when the network is dense */
send_unicast_request
(
neigh
,
NULL
,
0
);
send_unicast_request
(
neigh
,
NULL
,
0
,
NULL
,
0
);
send_ihu
(
neigh
,
NULL
);
}
return
rc
;
...
...
route.c
View file @
57d9928c
...
...
@@ -1198,7 +1198,8 @@ expire_routes(void)
if
(
route_old
(
r
))
/* Route about to expire, send a request. */
send_unicast_request
(
r
->
neigh
,
r
->
src
->
prefix
,
r
->
src
->
plen
);
r
->
src
->
prefix
,
r
->
src
->
plen
,
r
->
src
->
src_prefix
,
r
->
src
->
src_plen
);
}
r
=
r
->
next
;
}
...
...
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