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
d0cd3a24
Commit
d0cd3a24
authored
Jul 28, 2014
by
Matthieu Boutier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Format TLV for (standard) requests.
parent
4df8ccad
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
11 deletions
+35
-11
babeld.c
babeld.c
+1
-1
interface.c
interface.c
+2
-2
message.c
message.c
+27
-6
message.h
message.h
+3
-1
route.c
route.c
+2
-1
No files found.
babeld.c
View file @
d0cd3a24
...
...
@@ -540,7 +540,7 @@ main(int argc, char **argv)
send_hello
(
ifp
);
send_wildcard_retraction
(
ifp
);
send_self_update
(
ifp
);
send_request
(
ifp
,
NULL
,
0
);
send_request
(
ifp
,
NULL
,
0
,
NULL
,
0
);
flushupdates
(
ifp
);
flushbuf
(
ifp
);
}
...
...
interface.c
View file @
d0cd3a24
...
...
@@ -381,7 +381,7 @@ interface_up(struct interface *ifp, int up)
send_hello
(
ifp
);
if
(
rc
>
0
)
send_update
(
ifp
,
0
,
NULL
,
0
,
NULL
,
0
);
send_request
(
ifp
,
NULL
,
0
);
send_request
(
ifp
,
NULL
,
0
,
NULL
,
0
);
}
else
{
flush_interface_routes
(
ifp
,
0
);
ifp
->
buffered
=
0
;
...
...
@@ -466,7 +466,7 @@ check_interfaces(void)
check_interface_channel
(
ifp
);
rc
=
check_interface_ipv4
(
ifp
);
if
(
rc
>
0
)
{
send_request
(
ifp
,
NULL
,
0
);
send_request
(
ifp
,
NULL
,
0
,
NULL
,
0
);
send_update
(
ifp
,
0
,
NULL
,
0
,
NULL
,
0
);
}
}
...
...
message.c
View file @
d0cd3a24
...
...
@@ -1670,16 +1670,17 @@ send_marginal_ihu(struct interface *ifp)
void
send_request
(
struct
interface
*
ifp
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
)
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
const
unsigned
char
*
src_prefix
,
unsigned
char
src_plen
)
{
int
v4
,
pb
,
len
;
int
v4
,
pb
,
spb
,
len
;
if
(
ifp
==
NULL
)
{
struct
interface
*
ifp_auxn
;
FOR_ALL_INTERFACES
(
ifp_auxn
)
{
if
(
if_up
(
ifp_auxn
))
continue
;
send_request
(
ifp_auxn
,
prefix
,
plen
);
send_request
(
ifp_auxn
,
prefix
,
plen
,
src_prefix
,
src_plen
);
}
return
;
}
...
...
@@ -1690,21 +1691,41 @@ send_request(struct interface *ifp,
if
(
!
if_up
(
ifp
))
return
;
debugf
(
"sending request to %s for %s.
\n
"
,
ifp
->
name
,
prefix
?
format_prefix
(
prefix
,
plen
)
:
"any"
);
if
(
!
prefix
)
debugf
(
"sending request to %s for any.
\n
"
,
ifp
->
name
);
else
debugf
(
"sending request to %s for %s from %s.
\n
"
,
ifp
->
name
,
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
;
start_message
(
ifp
,
MESSAGE_REQUEST
,
len
);
if
(
src_plen
!=
0
)
{
spb
=
v4
?
((
src_plen
-
96
)
+
7
)
/
8
:
(
src_plen
+
7
)
/
8
;
len
+=
spb
+
1
;
start_message
(
ifp
,
MESSAGE_REQUEST_SRC_SPECIFIC
,
len
);
}
else
{
start_message
(
ifp
,
MESSAGE_REQUEST
,
len
);
}
accumulate_byte
(
ifp
,
!
prefix
?
0
:
v4
?
1
:
2
);
accumulate_byte
(
ifp
,
!
prefix
?
0
:
v4
?
plen
-
96
:
plen
);
if
(
src_plen
!=
0
)
accumulate_byte
(
ifp
,
v4
?
src_plen
-
96
:
src_plen
);
if
(
prefix
)
{
if
(
v4
)
accumulate_bytes
(
ifp
,
prefix
+
12
,
pb
);
else
accumulate_bytes
(
ifp
,
prefix
,
pb
);
}
if
(
src_plen
!=
0
)
{
if
(
v4
)
accumulate_bytes
(
ifp
,
src_prefix
+
12
,
spb
);
else
accumulate_bytes
(
ifp
,
src_prefix
,
spb
);
end_message
(
ifp
,
MESSAGE_REQUEST_SRC_SPECIFIC
,
len
);
return
;
}
end_message
(
ifp
,
MESSAGE_REQUEST
,
len
);
}
...
...
message.h
View file @
d0cd3a24
...
...
@@ -41,6 +41,7 @@ THE SOFTWARE.
#define MESSAGE_MH_REQUEST 10
/* 11 and 12 are for authentication */
#define MESSAGE_UPDATE_SRC_SPECIFIC 13
#define MESSAGE_REQUEST_SRC_SPECIFIC 14
/* Protocol extension through sub-TLVs. */
#define SUBTLV_PAD1 0
...
...
@@ -81,7 +82,8 @@ void send_self_update(struct interface *ifp);
void
send_ihu
(
struct
neighbour
*
neigh
,
struct
interface
*
ifp
);
void
send_marginal_ihu
(
struct
interface
*
ifp
);
void
send_request
(
struct
interface
*
ifp
,
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_unicast_request
(
struct
neighbour
*
neigh
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
);
void
send_multihop_request
(
struct
interface
*
ifp
,
...
...
route.c
View file @
d0cd3a24
...
...
@@ -1115,7 +1115,8 @@ send_triggered_update(struct babel_route *route, struct source *oldsrc,
seqno_plus
(
route
->
src
->
seqno
,
1
),
route
->
src
->
id
);
}
else
if
(
newmetric
>=
oldmetric
+
288
)
{
send_request
(
NULL
,
route
->
src
->
prefix
,
route
->
src
->
plen
);
send_request
(
NULL
,
route
->
src
->
prefix
,
route
->
src
->
plen
,
route
->
src
->
src_prefix
,
route
->
src
->
src_plen
);
}
}
}
...
...
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