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
f75b114e
Commit
f75b114e
authored
Jul 28, 2014
by
Matthieu Boutier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Format TLV for unicast multihop requests.
parent
3f0b34c2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
8 deletions
+29
-8
message.c
message.c
+26
-8
message.h
message.h
+2
-0
route.c
route.c
+1
-0
No files found.
message.c
View file @
f75b114e
...
...
@@ -1846,28 +1846,37 @@ send_multihop_request(struct interface *ifp,
void
send_unicast_multihop_request
(
struct
neighbour
*
neigh
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
const
unsigned
char
*
src_prefix
,
unsigned
char
src_plen
,
unsigned
short
seqno
,
const
unsigned
char
*
id
,
unsigned
short
hop_count
)
{
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 multi-hop request to %s for %s (%d hops).
\n
"
,
debugf
(
"Sending multi-hop request to %s for %s
from %s
(%d hops).
\n
"
,
format_address
(
neigh
->
address
),
format_prefix
(
prefix
,
plen
),
hop_count
);
format_prefix
(
prefix
,
plen
),
format_prefix
(
src_prefix
,
src_plen
),
hop_count
);
v4
=
plen
>=
96
&&
v4mapped
(
prefix
);
pb
=
v4
?
((
plen
-
96
)
+
7
)
/
8
:
(
plen
+
7
)
/
8
;
len
=
6
+
8
+
pb
;
if
(
src_plen
!=
0
)
{
spb
=
v4
?
((
src_plen
-
96
)
+
7
)
/
8
:
(
src_plen
+
7
)
/
8
;
len
+=
spb
;
rc
=
start_unicast_message
(
neigh
,
MESSAGE_MH_REQUEST_SRC_SPECIFIC
,
len
);
}
else
{
rc
=
start_unicast_message
(
neigh
,
MESSAGE_MH_REQUEST
,
len
);
}
if
(
rc
<
0
)
return
;
accumulate_unicast_byte
(
neigh
,
v4
?
1
:
2
);
accumulate_unicast_byte
(
neigh
,
v4
?
plen
-
96
:
plen
);
accumulate_unicast_short
(
neigh
,
seqno
);
accumulate_unicast_byte
(
neigh
,
hop_count
);
accumulate_unicast_byte
(
neigh
,
0
);
accumulate_unicast_byte
(
neigh
,
v4
?
src_plen
-
96
:
src_plen
);
accumulate_unicast_bytes
(
neigh
,
id
,
8
);
if
(
prefix
)
{
if
(
v4
)
...
...
@@ -1875,6 +1884,14 @@ send_unicast_multihop_request(struct neighbour *neigh,
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_MH_REQUEST_SRC_SPECIFIC
,
len
);
return
;
}
end_unicast_message
(
neigh
,
MESSAGE_MH_REQUEST
,
len
);
}
...
...
@@ -1884,7 +1901,8 @@ send_request_resend(struct neighbour *neigh,
unsigned
short
seqno
,
unsigned
char
*
id
)
{
if
(
neigh
)
send_unicast_multihop_request
(
neigh
,
prefix
,
plen
,
seqno
,
id
,
127
);
send_unicast_multihop_request
(
neigh
,
prefix
,
plen
,
zeroes
,
0
,
seqno
,
id
,
127
);
else
send_multihop_request
(
NULL
,
prefix
,
plen
,
zeroes
,
0
,
seqno
,
id
,
127
);
...
...
@@ -1958,8 +1976,8 @@ handle_request(struct neighbour *neigh, const unsigned char *prefix,
/* Give up */
return
;
send_unicast_multihop_request
(
successor
,
prefix
,
plen
,
seqno
,
id
,
hop_count
-
1
);
send_unicast_multihop_request
(
successor
,
prefix
,
plen
,
zeroes
,
0
,
seqno
,
id
,
hop_count
-
1
);
record_resend
(
RESEND_REQUEST
,
prefix
,
plen
,
zeroes
,
0
,
seqno
,
id
,
neigh
->
ifp
,
0
);
}
message.h
View file @
f75b114e
...
...
@@ -98,6 +98,8 @@ void send_multihop_request(struct interface *ifp,
void
send_unicast_multihop_request
(
struct
neighbour
*
neigh
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
const
unsigned
char
*
src_prefix
,
unsigned
char
src_plen
,
unsigned
short
seqno
,
const
unsigned
char
*
id
,
unsigned
short
hop_count
);
void
send_request_resend
(
struct
neighbour
*
neigh
,
...
...
route.c
View file @
f75b114e
...
...
@@ -981,6 +981,7 @@ send_unfeasible_request(struct neighbour *neigh, int force,
if
(
force
||
!
route
||
route_metric
(
route
)
>=
metric
+
512
)
{
send_unicast_multihop_request
(
neigh
,
src
->
prefix
,
src
->
plen
,
src
->
src_prefix
,
src
->
src_plen
,
src
->
metric
>=
INFINITY
?
src
->
seqno
:
seqno_plus
(
src
->
seqno
,
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