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
7e7eafae
Commit
7e7eafae
authored
Oct 09, 2008
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement new protocol.
parent
4ebf4c38
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
803 additions
and
516 deletions
+803
-516
babel.c
babel.c
+1
-1
message.c
message.c
+763
-494
message.h
message.h
+37
-19
network.c
network.c
+2
-2
No files found.
babel.c
View file @
7e7eafae
...
...
@@ -492,7 +492,7 @@ main(int argc, char **argv)
gettime
(
&
now
);
send_hello
(
net
);
send_self_update
(
net
,
0
);
send_request
(
net
,
NULL
,
0
,
0
,
0
,
0
);
send_request
(
net
,
NULL
,
0
);
flushupdates
();
flushbuf
(
net
);
}
...
...
message.c
View file @
7e7eafae
This diff is collapsed.
Click to expand it.
message.h
View file @
7e7eafae
...
...
@@ -25,6 +25,19 @@ THE SOFTWARE.
#define BUCKET_TOKENS_MAX 200
#define BUCKET_TOKENS_PER_SEC 40
#define MESSAGE_PAD1 0
#define MESSAGE_PADN 1
#define MESSAGE_ACK_REQ 2
#define MESSAGE_ACK 3
#define MESSAGE_HELLO 4
#define MESSAGE_IHU 5
#define MESSAGE_ROUTER_ID 6
#define MESSAGE_NH 7
#define MESSAGE_UPDATE 8
#define MESSAGE_REQUEST 9
#define MESSAGE_MH_REQUEST 10
extern
unsigned
short
myseqno
;
extern
struct
timeval
seqno_time
;
extern
int
seqno_interval
;
...
...
@@ -35,32 +48,20 @@ extern int broadcast_ihu;
extern
int
split_horizon
;
extern
struct
timeval
update_flush_timeout
;
extern
const
unsigned
char
packet_header
[
8
];
extern
unsigned
char
packet_header
[
4
];
extern
struct
neighbour
*
unicast_neighbour
;
extern
struct
timeval
unicast_flush_timeout
;
unsigned
short
hash_id
(
const
unsigned
char
*
id
)
ATTRIBUTE
((
pure
));
void
parse_packet
(
const
unsigned
char
*
from
,
struct
network
*
net
,
const
unsigned
char
*
packet
,
int
len
);
void
handle_request
(
struct
neighbour
*
neigh
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
unsigned
char
hop_count
,
unsigned
short
seqno
,
unsigned
short
router_hash
);
const
unsigned
char
*
packet
,
int
packetlen
);
void
flushbuf
(
struct
network
*
net
);
void
flushupdates
(
void
);
void
send_ack
(
struct
neighbour
*
neigh
,
unsigned
short
nonce
,
unsigned
short
interval
);
void
send_hello_noupdate
(
struct
network
*
net
,
unsigned
interval
);
void
send_hello
(
struct
network
*
net
);
void
send_request
(
struct
network
*
net
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
unsigned
char
hop_count
,
unsigned
short
seqno
,
unsigned
short
router_hash
);
void
send_request_resend
(
struct
neighbour
*
neigh
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
unsigned
short
seqno
,
unsigned
short
router_hash
);
void
flush_unicast
(
int
dofree
);
void
send_unicast_request
(
struct
neighbour
*
neigh
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
unsigned
char
hop_count
,
unsigned
short
seqno
,
unsigned
short
router_hash
);
void
send_update
(
struct
network
*
net
,
int
urgent
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
);
void
send_update_resend
(
struct
network
*
net
,
...
...
@@ -69,5 +70,22 @@ void update_myseqno(int force);
void
send_self_update
(
struct
network
*
net
,
int
force_seqno
);
void
send_ihu
(
struct
neighbour
*
neigh
,
struct
network
*
net
);
void
send_marginal_ihu
(
struct
network
*
net
);
void
schedule_flush_now
(
struct
network
*
net
);
void
flushupdates
(
void
);
void
send_request
(
struct
network
*
net
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
);
void
send_unicast_request
(
struct
neighbour
*
neigh
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
);
void
send_multihop_request
(
struct
network
*
net
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
unsigned
short
seqno
,
const
unsigned
char
*
id
,
unsigned
short
hop_count
);
void
send_unicast_multihop_request
(
struct
neighbour
*
neigh
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
unsigned
short
seqno
,
const
unsigned
char
*
id
,
unsigned
short
hop_count
);
void
send_request_resend
(
struct
neighbour
*
neigh
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
unsigned
short
seqno
,
unsigned
char
*
id
);
void
handle_request
(
struct
neighbour
*
neigh
,
const
unsigned
char
*
prefix
,
unsigned
char
plen
,
unsigned
char
hop_count
,
unsigned
short
seqno
,
const
unsigned
char
*
id
);
network.c
View file @
7e7eafae
...
...
@@ -287,7 +287,7 @@ network_up(struct network *net, int up)
delay_jitter
(
&
net
->
update_time
,
&
net
->
update_timeout
,
update_interval
);
send_hello
(
net
);
send_request
(
net
,
NULL
,
0
,
0
,
0
,
0
);
send_request
(
net
,
NULL
,
0
);
}
else
{
net
->
buffered
=
0
;
net
->
bufsize
=
0
;
...
...
@@ -359,7 +359,7 @@ check_networks(void)
rc
=
check_network_ipv4
(
net
);
if
(
rc
>
0
)
{
send_request
(
net
,
NULL
,
0
,
0
,
0
,
0
);
send_request
(
net
,
NULL
,
0
);
send_update
(
net
,
0
,
NULL
,
0
);
}
}
...
...
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