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
81b8db7d
Commit
81b8db7d
authored
Oct 25, 2016
by
Alessandro Rubini
Committed by
Adam Wujek
Nov 04, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trivial: msg.c: fix references to tables
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
8d12b26d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
28 deletions
+13
-28
msg.c
proto-standard/msg.c
+13
-28
No files found.
proto-standard/msg.c
View file @
81b8db7d
...
...
@@ -69,8 +69,7 @@ void msg_pack_header(struct pp_instance *ppi, void *buf)
PP_CLOCK_IDENTITY_LENGTH
);
*
(
UInteger16
*
)
(
buf
+
28
)
=
htons
(
DSPOR
(
ppi
)
->
portIdentity
.
portNumber
);
*
(
UInteger8
*
)
(
buf
+
33
)
=
0x7F
;
/* Default value(spec Table 24) */
*
(
UInteger8
*
)
(
buf
+
33
)
=
0x7F
;
/* Default value(spec Table 24) */
}
/* Pack Sync message into out buffer of ppi */
...
...
@@ -93,10 +92,8 @@ static void msg_pack_sync(struct pp_instance *ppi, Timestamp *orig_tstamp)
/* We're a two step clock, set relevant flag in sync (see Table 20) */
flags
[
0
]
=
PP_TWO_STEP_FLAG
;
*
(
UInteger16
*
)
(
buf
+
30
)
=
htons
(
ppi
->
sent_seq
[
PPM_SYNC
]);
*
(
UInteger8
*
)
(
buf
+
32
)
=
0x00
;
/* Table 23 */
*
(
Integer8
*
)
(
buf
+
33
)
=
DSPOR
(
ppi
)
->
logSyncInterval
;
*
(
UInteger8
*
)
(
buf
+
32
)
=
0x00
;
/* Table 23 */
*
(
Integer8
*
)
(
buf
+
33
)
=
DSPOR
(
ppi
)
->
logSyncInterval
;
/* Table 24 */
memset
((
buf
+
8
),
0
,
8
);
/* Sync message */
...
...
@@ -168,9 +165,8 @@ static int msg_pack_announce(struct pp_instance *ppi)
/* Table 21, set cf to zero */
memset
(
buf
+
8
,
0
,
8
);
*
(
UInteger16
*
)
(
buf
+
30
)
=
htons
(
ppi
->
sent_seq
[
PPM_ANNOUNCE
]);
*
(
UInteger8
*
)
(
buf
+
32
)
=
0x05
;
/* Table 23 */
*
(
Integer8
*
)
(
buf
+
33
)
=
DSPOR
(
ppi
)
->
logAnnounceInterval
;
*
(
UInteger8
*
)(
buf
+
32
)
=
0x05
;
/* Table 23 */
*
(
Integer8
*
)(
buf
+
33
)
=
DSPOR
(
ppi
)
->
logAnnounceInterval
;
/* Tab 24 */
/* Announce message */
memset
((
buf
+
34
),
0
,
10
);
...
...
@@ -235,10 +231,8 @@ static void msg_pack_follow_up(struct pp_instance *ppi, Timestamp *prec_orig_tst
*
(
UInteger16
*
)
(
buf
+
30
)
=
htons
(
ppi
->
sent_seq
[
PPM_SYNC
]);
/* sentSyncSequenceId has already been incremented in msg_issue_sync */
*
(
UInteger8
*
)
(
buf
+
32
)
=
0x02
;
/* Table 23 */
*
(
Integer8
*
)
(
buf
+
33
)
=
DSPOR
(
ppi
)
->
logSyncInterval
;
*
(
UInteger8
*
)
(
buf
+
32
)
=
0x02
;
/* Table 23 */
*
(
Integer8
*
)
(
buf
+
33
)
=
DSPOR
(
ppi
)
->
logSyncInterval
;
/* Table 24 */
/* Follow Up message */
*
(
UInteger16
*
)
(
buf
+
34
)
=
...
...
@@ -326,12 +320,9 @@ static void msg_pack_delay_req(struct pp_instance *ppi, Timestamp *orig_tstamp)
*
(
UInteger16
*
)
(
buf
+
2
)
=
htons
(
PP_DELAY_REQ_LENGTH
);
ppi
->
sent_seq
[
PPM_DELAY_REQ
]
++
;
*
(
UInteger16
*
)
(
buf
+
30
)
=
htons
(
ppi
->
sent_seq
[
PPM_DELAY_REQ
]);
*
(
UInteger8
*
)
(
buf
+
32
)
=
0x01
;
/* Table 23 */
*
(
Integer8
*
)
(
buf
+
33
)
=
0x7F
;
*
(
UInteger8
*
)
(
buf
+
32
)
=
0x01
;
/* Table 23 */
*
(
Integer8
*
)
(
buf
+
33
)
=
0x7F
;
/* Table 24 */
/* Table 24 */
memset
((
buf
+
8
),
0
,
8
);
/* Delay_req message */
...
...
@@ -366,10 +357,8 @@ static void msg_pack_pdelay_req(struct pp_instance *ppi,
memset
((
buf
+
8
),
0
,
8
);
*
(
UInteger16
*
)
(
buf
+
30
)
=
htons
(
ppi
->
sent_seq
[
PPM_PDELAY_REQ
]);
*
(
UInteger8
*
)
(
buf
+
32
)
=
0x05
;
/* Table 23 */
*
(
Integer8
*
)
(
buf
+
33
)
=
0x7F
;
*
(
UInteger8
*
)
(
buf
+
32
)
=
0x05
;
/* Table 23 */
*
(
Integer8
*
)
(
buf
+
33
)
=
0x7F
;
/* Table 24 */
/* PDelay_req message */
*
(
UInteger16
*
)
(
buf
+
34
)
=
htons
(
orig_tstamp
->
secondsField
.
msb
);
...
...
@@ -443,12 +432,8 @@ static void msg_pack_delay_resp(struct pp_instance *ppi,
*
(
UInteger16
*
)
(
buf
+
30
)
=
htons
(
hdr
->
sequenceId
);
*
(
UInteger8
*
)
(
buf
+
32
)
=
0x03
;
/* Table 23 */
*
(
Integer8
*
)
(
buf
+
33
)
=
DSPOR
(
ppi
)
->
logMinDelayReqInterval
;
/* Table 24 */
*
(
UInteger8
*
)
(
buf
+
32
)
=
0x03
;
/* Table 23 */
*
(
Integer8
*
)(
buf
+
33
)
=
DSPOR
(
ppi
)
->
logMinDelayReqInterval
;
/* T 24 */
/* Delay_resp message */
*
(
UInteger16
*
)
(
buf
+
34
)
=
...
...
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