Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PPSi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
47
Issues
47
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
PPSi
Commits
33a26719
Commit
33a26719
authored
Jan 10, 2012
by
Aurelio Colosimo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
st_com_add_foreign function rewritten without empty if branches
parent
ae289632
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
23 deletions
+25
-23
common-fun.c
proto-standard/common-fun.c
+25
-23
No files found.
proto-standard/common-fun.c
View file @
33a26719
...
...
@@ -92,36 +92,38 @@ void st_com_add_foreign(struct pp_instance *ppi, unsigned char *buf)
j
=
(
j
+
1
)
%
ppi
->
number_foreign_records
;
}
/* Old foreign master */
if
(
found
)
return
;
/* New foreign master */
if
(
!
found
)
{
if
(
ppi
->
number_foreign_records
<
ppi
->
max_foreign_records
)
{
ppi
->
number_foreign_records
++
;
}
if
(
ppi
->
number_foreign_records
<
ppi
->
max_foreign_records
)
{
ppi
->
number_foreign_records
++
;
}
j
=
ppi
->
foreign_record_i
;
j
=
ppi
->
foreign_record_i
;
/* Copy new foreign master data set from announce message */
pp_memcpy
(
ppi
->
frgn_master
[
j
].
port_identity
.
clockIdentity
,
hdr
->
sourcePortIdentity
.
clockIdentity
,
PP_CLOCK_IDENTITY_LENGTH
);
ppi
->
frgn_master
[
j
].
port_identity
.
portNumber
=
hdr
->
sourcePortIdentity
.
portNumber
;
ppi
->
frgn_master
[
j
].
ann_messages
=
0
;
/* Copy new foreign master data set from announce message */
pp_memcpy
(
ppi
->
frgn_master
[
j
].
port_identity
.
clockIdentity
,
hdr
->
sourcePortIdentity
.
clockIdentity
,
PP_CLOCK_IDENTITY_LENGTH
);
ppi
->
frgn_master
[
j
].
port_identity
.
portNumber
=
hdr
->
sourcePortIdentity
.
portNumber
;
ppi
->
frgn_master
[
j
].
ann_messages
=
0
;
/*
* header and announce field of each Foreign Master are
* usefull to run Best Master Clock Algorithm
*/
msg_copy_header
(
&
ppi
->
frgn_master
[
j
].
hdr
,
hdr
);
/*
* header and announce field of each Foreign Master are
* usefull to run Best Master Clock Algorithm
*/
msg_copy_header
(
&
ppi
->
frgn_master
[
j
].
hdr
,
hdr
);
msg_unpack_announce
(
buf
,
&
ppi
->
frgn_master
[
j
].
ann
);
msg_unpack_announce
(
buf
,
&
ppi
->
frgn_master
[
j
].
ann
);
DBGV
(
"New foreign Master added
\n
"
);
DBGV
(
"New foreign Master added
\n
"
);
ppi
->
foreign_record_i
=
(
ppi
->
foreign_record_i
+
1
)
%
ppi
->
max_foreign_records
;
}
ppi
->
foreign_record_i
=
(
ppi
->
foreign_record_i
+
1
)
%
ppi
->
max_foreign_records
;
}
...
...
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