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
4d129353
Commit
4d129353
authored
Oct 02, 2007
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement hash_id.
parent
9abe7c66
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
message.c
message.c
+10
-0
message.h
message.h
+1
-0
No files found.
message.c
View file @
4d129353
...
@@ -58,6 +58,16 @@ struct buffered_update buffered_updates[MAX_BUFFERED_UPDATES];
...
@@ -58,6 +58,16 @@ struct buffered_update buffered_updates[MAX_BUFFERED_UPDATES];
struct
network
*
update_net
=
NULL
;
struct
network
*
update_net
=
NULL
;
int
updates
=
0
;
int
updates
=
0
;
unsigned
short
hash_id
(
const
unsigned
char
*
id
)
{
int
i
;
unsigned
short
hash
=
0
;
for
(
i
=
0
;
i
<
8
;
i
++
)
hash
^=
(
id
[
2
*
i
]
<<
8
)
|
id
[
2
*
i
+
1
];
return
hash
;
}
void
void
parse_packet
(
const
unsigned
char
*
from
,
struct
network
*
net
,
parse_packet
(
const
unsigned
char
*
from
,
struct
network
*
net
,
const
unsigned
char
*
packet
,
int
len
)
const
unsigned
char
*
packet
,
int
len
)
...
...
message.h
View file @
4d129353
...
@@ -35,6 +35,7 @@ extern int split_horizon;
...
@@ -35,6 +35,7 @@ extern int split_horizon;
extern
struct
timeval
update_flush_time
;
extern
struct
timeval
update_flush_time
;
extern
const
unsigned
char
packet_header
[
8
];
extern
const
unsigned
char
packet_header
[
8
];
unsigned
short
hash_id
(
const
unsigned
char
*
id
)
ATTRIBUTE
((
pure
));
void
parse_packet
(
const
unsigned
char
*
from
,
struct
network
*
net
,
void
parse_packet
(
const
unsigned
char
*
from
,
struct
network
*
net
,
const
unsigned
char
*
packet
,
int
len
);
const
unsigned
char
*
packet
,
int
len
);
void
flushbuf
(
struct
network
*
net
);
void
flushbuf
(
struct
network
*
net
);
...
...
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