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
50
Issues
50
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
84c4984a
Commit
84c4984a
authored
Jul 05, 2017
by
Sven Meier
Committed by
Adam Wujek
Jul 12, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msg: cleared out frames so all reserved fields are 0
parent
78f90b18
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
msg.c
proto-standard/msg.c
+8
-2
No files found.
proto-standard/msg.c
View file @
84c4984a
...
...
@@ -111,6 +111,7 @@ int msg_pack_sync(struct pp_instance *ppi, struct pp_time *orig_tstamp)
*
(
UInteger16
*
)
(
buf
+
30
)
=
htons
(
ppi
->
sent_seq
[
PPM_SYNC
]);
/* Sync message */
memset
((
buf
+
34
),
0
,
10
);
*
(
UInteger16
*
)(
buf
+
34
)
=
htons
(
orig_tstamp
->
secs
>>
32
);
*
(
UInteger32
*
)(
buf
+
36
)
=
htonl
(
orig_tstamp
->
secs
);
*
(
UInteger32
*
)(
buf
+
40
)
=
htonl
(
orig_tstamp
->
scaled_nsecs
>>
16
);
...
...
@@ -173,7 +174,7 @@ static int msg_pack_announce(struct pp_instance *ppi)
*
(
UInteger16
*
)
(
buf
+
30
)
=
htons
(
ppi
->
sent_seq
[
PPM_ANNOUNCE
]);
/* Announce message */
memset
((
buf
+
34
),
0
,
1
0
);
memset
((
buf
+
34
),
0
,
3
0
);
*
(
Integer16
*
)
(
buf
+
44
)
=
htons
(
DSPRO
(
ppi
)
->
currentUtcOffset
);
*
(
UInteger8
*
)
(
buf
+
47
)
=
DSPAR
(
ppi
)
->
grandmasterPriority1
;
*
(
UInteger8
*
)
(
buf
+
48
)
=
DSPAR
(
ppi
)
->
grandmasterClockQuality
.
clockClass
;
...
...
@@ -231,6 +232,7 @@ static int msg_pack_follow_up(struct pp_instance *ppi,
*
(
UInteger16
*
)
(
buf
+
30
)
=
htons
(
ppi
->
sent_seq
[
PPM_SYNC
]);
/* Follow Up message */
memset
((
buf
+
34
),
0
,
10
);
*
(
UInteger16
*
)(
buf
+
34
)
=
htons
(
prec_orig_tstamp
->
secs
>>
32
);
*
(
UInteger32
*
)(
buf
+
36
)
=
htonl
(
prec_orig_tstamp
->
secs
);
*
(
UInteger32
*
)(
buf
+
40
)
=
htonl
(
prec_orig_tstamp
->
scaled_nsecs
>>
16
);
...
...
@@ -260,6 +262,7 @@ static int msg_pack_pdelay_resp_follow_up(struct pp_instance *ppi,
*
(
UInteger16
*
)
(
buf
+
30
)
=
htons
(
hdr
->
sequenceId
);
/* requestReceiptTimestamp */
memset
((
buf
+
34
),
0
,
20
);
*
(
UInteger16
*
)(
buf
+
34
)
=
htons
(
prec_orig_tstamp
->
secs
>>
32
);
*
(
UInteger32
*
)(
buf
+
36
)
=
htonl
(
prec_orig_tstamp
->
secs
);
*
(
UInteger32
*
)(
buf
+
40
)
=
htonl
(
prec_orig_tstamp
->
scaled_nsecs
>>
16
);
...
...
@@ -320,6 +323,7 @@ static int msg_pack_delay_req(struct pp_instance *ppi,
*
(
UInteger16
*
)
(
buf
+
30
)
=
htons
(
ppi
->
sent_seq
[
PPM_DELAY_REQ
]);
/* Delay_req message - we may send zero instead */
memset
((
buf
+
34
),
0
,
10
);
*
(
UInteger16
*
)
(
buf
+
34
)
=
htons
(
now
->
secs
>>
32
);
*
(
UInteger32
*
)
(
buf
+
36
)
=
htonl
(
now
->
secs
);
*
(
UInteger32
*
)
(
buf
+
40
)
=
htonl
(
now
->
scaled_nsecs
>>
16
);
...
...
@@ -338,10 +342,10 @@ static int msg_pack_pdelay_req(struct pp_instance *ppi,
*
(
UInteger16
*
)
(
buf
+
30
)
=
htons
(
ppi
->
sent_seq
[
PPM_PDELAY_REQ
]);
/* PDelay_req message - we may send zero instead */
memset
((
buf
+
34
),
0
,
20
);
*
(
UInteger16
*
)
(
buf
+
34
)
=
htons
(
now
->
secs
>>
32
);
*
(
UInteger32
*
)
(
buf
+
36
)
=
htonl
(
now
->
secs
);
*
(
UInteger32
*
)
(
buf
+
40
)
=
htonl
(
now
->
scaled_nsecs
>>
16
);
memset
(
buf
+
44
,
0
,
10
);
/* reserved to match pdelay_resp length */
return
len
;
}
...
...
@@ -362,6 +366,7 @@ static int msg_pack_pdelay_resp(struct pp_instance *ppi,
=
htonl
(
rcv_tstamp
->
scaled_nsecs
&
0xffff
);
/* requestReceiptTimestamp */
memset
((
buf
+
34
),
0
,
20
);
*
(
UInteger16
*
)
(
buf
+
34
)
=
htons
(
rcv_tstamp
->
secs
>>
32
);
*
(
UInteger32
*
)
(
buf
+
36
)
=
htonl
(
rcv_tstamp
->
secs
);
*
(
UInteger32
*
)
(
buf
+
40
)
=
htonl
(
rcv_tstamp
->
scaled_nsecs
>>
16
);
...
...
@@ -390,6 +395,7 @@ static int msg_pack_delay_resp(struct pp_instance *ppi,
*
(
UInteger16
*
)
(
buf
+
30
)
=
htons
(
hdr
->
sequenceId
);
/* Delay_resp message */
memset
((
buf
+
34
),
0
,
20
);
*
(
UInteger16
*
)(
buf
+
34
)
=
htons
(
rcv_tstamp
->
secs
>>
32
);
*
(
UInteger32
*
)(
buf
+
36
)
=
htonl
(
rcv_tstamp
->
secs
);
*
(
UInteger32
*
)(
buf
+
40
)
=
htonl
(
rcv_tstamp
->
scaled_nsecs
>>
16
);
...
...
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