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
4126868c
Commit
4126868c
authored
Oct 17, 2014
by
Cesar Prados
Committed by
Alessandro Rubini
May 16, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pdelay/msg: add pdelay request msg
Signed-off-by:
C.Prados
<
c.prados@gsi.de
>
parent
15d9f801
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
0 deletions
+49
-0
ppsi.h
include/ppsi/ppsi.h
+3
-0
msg.c
proto-standard/msg.c
+46
-0
No files found.
include/ppsi/ppsi.h
View file @
4126868c
...
@@ -398,6 +398,8 @@ extern void msg_pack_pdelay_resp_follow_up(struct pp_instance *ppi,
...
@@ -398,6 +398,8 @@ extern void msg_pack_pdelay_resp_follow_up(struct pp_instance *ppi,
Timestamp
*
prec_orig_tstamp
);
Timestamp
*
prec_orig_tstamp
);
extern
void
msg_pack_pdelay_resp
(
struct
pp_instance
*
ppi
,
MsgHeader
*
hdr
,
extern
void
msg_pack_pdelay_resp
(
struct
pp_instance
*
ppi
,
MsgHeader
*
hdr
,
Timestamp
*
rcv_tstamp
);
Timestamp
*
rcv_tstamp
);
extern
void
msg_pack_pdelay_req
(
struct
pp_instance
*
ppi
,
Timestamp
*
orig_tstamp
);
/* each of them returns 0 if ok, -1 in case of error in send, 1 if stamp err */
/* each of them returns 0 if ok, -1 in case of error in send, 1 if stamp err */
#define PP_SEND_OK 0
#define PP_SEND_OK 0
...
@@ -409,6 +411,7 @@ extern int msg_issue_announce(struct pp_instance *ppi);
...
@@ -409,6 +411,7 @@ extern int msg_issue_announce(struct pp_instance *ppi);
extern
int
msg_issue_sync_followup
(
struct
pp_instance
*
ppi
);
extern
int
msg_issue_sync_followup
(
struct
pp_instance
*
ppi
);
extern
int
msg_issue_delay_req
(
struct
pp_instance
*
ppi
);
extern
int
msg_issue_delay_req
(
struct
pp_instance
*
ppi
);
extern
int
msg_issue_delay_resp
(
struct
pp_instance
*
ppi
,
TimeInternal
*
time
);
extern
int
msg_issue_delay_resp
(
struct
pp_instance
*
ppi
,
TimeInternal
*
time
);
extern
int
msg_issue_pdelay_req
(
struct
pp_instance
*
ppi
);
extern
int
msg_issue_pdelay_resp_followup
(
struct
pp_instance
*
ppi
,
extern
int
msg_issue_pdelay_resp_followup
(
struct
pp_instance
*
ppi
,
TimeInternal
*
time
);
TimeInternal
*
time
);
extern
int
msg_issue_pdelay_resp
(
struct
pp_instance
*
ppi
,
TimeInternal
*
time
);
extern
int
msg_issue_pdelay_resp
(
struct
pp_instance
*
ppi
,
TimeInternal
*
time
);
...
...
proto-standard/msg.c
View file @
4126868c
...
@@ -292,6 +292,37 @@ static void msg_pack_delay_req(struct pp_instance *ppi, Timestamp *orig_tstamp)
...
@@ -292,6 +292,37 @@ static void msg_pack_delay_req(struct pp_instance *ppi, Timestamp *orig_tstamp)
*
(
UInteger32
*
)
(
buf
+
40
)
=
htonl
(
orig_tstamp
->
nanosecondsField
);
*
(
UInteger32
*
)
(
buf
+
40
)
=
htonl
(
orig_tstamp
->
nanosecondsField
);
}
}
/* pack DelayReq message into out buffer of ppi */
void
msg_pack_pdelay_req
(
struct
pp_instance
*
ppi
,
Timestamp
*
orig_tstamp
)
{
void
*
buf
;
buf
=
ppi
->
tx_ptp
;
/* changes in header 11.4.3 */
*
(
char
*
)(
buf
+
0
)
=
*
(
char
*
)(
buf
+
0
)
&
0xF0
;
/* RAZ messageType */
*
(
char
*
)(
buf
+
0
)
=
*
(
char
*
)(
buf
+
0
)
|
0x02
;
*
(
UInteger16
*
)
(
buf
+
2
)
=
htons
(
PP_PDELAY_REQ_LENGTH
);
ppi
->
sent_seq
[
PPM_DELAY_REQ
]
++
;
/* TO DO, 11.4.3 a.1) if synthed peer-to-peer TC */
/* *(char *)(buf + 4) = 0 .- not sythonized / X synt domain */
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
;
/* PDelay_req message */
*
(
UInteger16
*
)
(
buf
+
34
)
=
htons
(
orig_tstamp
->
secondsField
.
msb
);
*
(
UInteger32
*
)
(
buf
+
36
)
=
htonl
(
orig_tstamp
->
secondsField
.
lsb
);
*
(
UInteger32
*
)
(
buf
+
40
)
=
htonl
(
orig_tstamp
->
nanosecondsField
);
}
/* pack PDelayResp message into OUT buffer of ppi */
/* pack PDelayResp message into OUT buffer of ppi */
void
msg_pack_pdelay_resp
(
struct
pp_instance
*
ppi
,
void
msg_pack_pdelay_resp
(
struct
pp_instance
*
ppi
,
MsgHeader
*
hdr
,
Timestamp
*
rcv_tstamp
)
MsgHeader
*
hdr
,
Timestamp
*
rcv_tstamp
)
...
@@ -309,6 +340,7 @@ void msg_pack_pdelay_resp(struct pp_instance *ppi,
...
@@ -309,6 +340,7 @@ void msg_pack_pdelay_resp(struct pp_instance *ppi,
*
(
UInteger8
*
)
(
buf
+
4
)
=
hdr
->
domainNumber
;
*
(
UInteger8
*
)
(
buf
+
4
)
=
hdr
->
domainNumber
;
/* set 0 the correction field, 11.4.3 c.3) */
/* set 0 the correction field, 11.4.3 c.3) */
memset
((
buf
+
8
),
0
,
8
);
memset
((
buf
+
8
),
0
,
8
);
*
(
UInteger16
*
)
(
buf
+
30
)
=
htons
(
hdr
->
sequenceId
);
*
(
UInteger16
*
)
(
buf
+
30
)
=
htons
(
hdr
->
sequenceId
);
*
(
UInteger8
*
)
(
buf
+
32
)
=
0x05
;
/* controlField */
*
(
UInteger8
*
)
(
buf
+
32
)
=
0x05
;
/* controlField */
...
@@ -464,6 +496,20 @@ int msg_issue_delay_req(struct pp_instance *ppi)
...
@@ -464,6 +496,20 @@ int msg_issue_delay_req(struct pp_instance *ppi)
PP_NP_EVT
);
PP_NP_EVT
);
}
}
/* Pack and send on event multicast ip adress a PDelayReq message */
int
msg_issue_pdelay_req
(
struct
pp_instance
*
ppi
)
{
Timestamp
orig_tstamp
;
TimeInternal
now
;
ppi
->
t_ops
->
get
(
ppi
,
&
now
);
from_TimeInternal
(
&
now
,
&
orig_tstamp
);
msg_pack_pdelay_req
(
ppi
,
&
orig_tstamp
);
return
__send_and_log
(
ppi
,
PP_PDELAY_REQ_LENGTH
,
PPM_PDELAY_REQ
,
PP_NP_EVT
);
}
/* Pack and send on event multicast ip adress a DelayResp message */
/* Pack and send on event multicast ip adress a DelayResp message */
int
msg_issue_delay_resp
(
struct
pp_instance
*
ppi
,
TimeInternal
*
time
)
int
msg_issue_delay_resp
(
struct
pp_instance
*
ppi
,
TimeInternal
*
time
)
{
{
...
...
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