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
45
Issues
45
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
522aad54
Commit
522aad54
authored
Jan 10, 2012
by
Aurelio Colosimo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flagField bits now handled in a more readable way and by using symbolic names
parent
9d478441
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
12 deletions
+18
-12
bmc.c
proto-standard/bmc.c
+16
-9
common-fun.c
proto-standard/common-fun.c
+1
-1
state-master.c
proto-standard/state-master.c
+1
-2
No files found.
proto-standard/bmc.c
View file @
522aad54
...
...
@@ -6,6 +6,14 @@
#include <pptp/pptp.h>
#include <pptp/diag.h>
/* Flag Field bits symbolic names (table 57, pag. 151) */
#define FFB_LI61 0x01
#define FFB_LI59 0x02
#define FFB_UTCV 0x04
#define FFB_PTP 0x08
#define FFB_TTRA 0x10
#define FFB_FTRA 0x20
/* Local clock is becoming Master. Table 13 (9.3.5) of the spec. */
void
m1
(
struct
pp_instance
*
ppi
)
{
...
...
@@ -67,15 +75,14 @@ void s1(struct pp_instance *ppi, MsgHeader *hdr, MsgAnnounce *ann)
/* Timeproperties DS */
DSPRO
(
ppi
)
->
currentUtcOffset
=
ann
->
currentUtcOffset
;
/* "Valid" is bit 2 in second octet of flagfield */
DSPRO
(
ppi
)
->
currentUtcOffsetValid
=
((
hdr
->
flagField
[
1
]
&
0x04
)
==
0x04
);
DSPRO
(
ppi
)
->
leap59
=
((
hdr
->
flagField
[
1
]
&
0x02
)
==
0x02
);
DSPRO
(
ppi
)
->
leap61
=
((
hdr
->
flagField
[
1
]
&
0x01
)
==
0x01
);
DSPRO
(
ppi
)
->
timeTraceable
=
((
hdr
->
flagField
[
1
]
&
0x10
)
==
0x10
);
DSPRO
(
ppi
)
->
frequencyTraceable
=
((
hdr
->
flagField
[
1
]
&
0x20
)
==
0x20
);
DSPRO
(
ppi
)
->
ptpTimescale
=
((
hdr
->
flagField
[
1
]
&
0x08
)
==
0x08
);
DSPRO
(
ppi
)
->
currentUtcOffsetValid
=
((
hdr
->
flagField
[
1
]
&
FFB_UTCV
)
!=
0
);
DSPRO
(
ppi
)
->
leap59
=
((
hdr
->
flagField
[
1
]
&
FFB_LI59
)
!=
0
);
DSPRO
(
ppi
)
->
leap61
=
((
hdr
->
flagField
[
1
]
&
FFB_LI61
)
!=
0
);
DSPRO
(
ppi
)
->
timeTraceable
=
((
hdr
->
flagField
[
1
]
&
FFB_TTRA
)
!=
0
);
DSPRO
(
ppi
)
->
frequencyTraceable
=
((
hdr
->
flagField
[
1
]
&
FFB_FTRA
)
!=
0
);
DSPRO
(
ppi
)
->
ptpTimescale
=
((
hdr
->
flagField
[
1
]
&
FFB_PTP
)
!=
0
);
DSPRO
(
ppi
)
->
timeSource
=
ann
->
timeSource
;
}
...
...
proto-standard/common-fun.c
View file @
522aad54
...
...
@@ -181,7 +181,7 @@ int st_com_slave_handle_sync(struct pp_instance *ppi, unsigned char *buf,
time->nanoseconds));
*/
if
((
hdr
->
flagField
[
0
]
&
0x02
)
==
PP_TWO_STEP_FLAG
)
{
if
((
hdr
->
flagField
[
0
]
&
PP_TWO_STEP_FLAG
)
!=
0
)
{
ppi
->
waiting_for_follow
=
TRUE
;
ppi
->
recv_sync_sequence_id
=
hdr
->
sequenceId
;
/* Save correctionField of Sync message */
...
...
proto-standard/state-master.c
View file @
522aad54
...
...
@@ -96,8 +96,7 @@ int pp_master(struct pp_instance *ppi, unsigned char *pkt, int plen)
&&
(
DSPOR
(
ppi
)
->
portIdentity
.
portNumber
==
ppi
->
msg_tmp
.
presp
.
requestingPortIdentity
.
portNumber
))
)
{
if
((
hdr
->
flagField
[
0
]
&
0x02
)
==
PP_TWO_STEP_FLAG
)
{
if
((
hdr
->
flagField
[
0
]
&
PP_TWO_STEP_FLAG
)
!=
0
)
{
/* Two Step Clock */
/* Store t4 (Fig 35) */
ppi
->
pdelay_resp_receive_time
.
seconds
=
...
...
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